This new test makes sure that a large segment is handled correctly and
also with reasonable performance. The timeout of 10ms is still
relatively slow (on a mid-class laptop it takes 0.001ms currently) but
the test shouldn't fail when e.g. the build machine is under (mild to
heavy) load.
The old implementation did a linear scan over the values. This was
slow with slowly changing keyframes. This new implementation skips
over constant (when rounded) segments and performs binary search
in (possibly long) interpolated segments to find the X coordinates
where a change occurs quickly.
Bezier interpolation code is now in a dedicated function and can be
used to either find a Y from a known X or a X from a known Y, with a
given allowed error.
- Define `USE_IMAGEMAGICK` and `USE_BLACKMAGIC` unconditionally when
building docs, so that the classes will be documented.
- Improve handling of `std::`-prefixed types in doxygen output.
As suggested in the code review:
- More traditional placment of the const specifier, e.g. const unsigned char * instead of unsigned char const *
- Matching casts to also cast to const unsigned char * instead of of unsigned char *
Co-Authored-By: Frank Dana <ferdnyc@gmail.com>
As mentioned in issue #202 QImage::bits() and QImage::scanLine() make
a deep copy of the source image. This is completely unnecessary when
read-only access to the pixel data is required. Changing to
QImage::constBits() and QImage::constScanLine() solves this. Both
functions were introduced in Qt 4.7.
https://doc.qt.io/qt-5/qimage.html#constBits
Using switch allows (some) compilers to emit a warning if a possible
enum value for the interpolation type has been forgotten. This is not
the case now, but might guard against future errors (e.g. adding an
interpolation type)