Commits on Source (11)
-
More tests are going to need this. The API is changed to work by copy in and copy out to match the other color_util API. Hopefully this makes the caller code easier to read. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
0d385ffa -
Seems it will be common to print all four min/max/avg sets of errors, so move the printing code into a shared place. While 0.0-1.0 is the natural range for color values, people are often accustomed to working with 8-bit or even 10-bit pixel values. An error of +/- 1 in 8-bit is more intuitive than +/- 0.004 in floating-point. Hence 'scaling_bits' is added so the caller can determine the value scaling. This will scale both the reported error numbers, and the recorded error positions (rgb-tuples), so they are all comparable. I'm happy to get rid of those two macros as well. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
9026293b -
These arguments are not meant to be changed, and a new test will need this const. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
f31d2666 -
The new field in struct scalar_stat allows recording all tested values into a file. This is intended to replace ad hoc dumping code like in alpha-blending-test.c. To make it easy to set up, also offer a helper to open a writable file whose name consists of a custom prefix and test name. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
912ea2cb -
The recently introduced rgb_diff_stat value dumping feature logs the "position" where the value or error was measured. The reference value was used as the position, but the problem with the reference value is that it is an output value and not an input value. Therefore mapping that back to which input values promoted the error is not easy. Fix that problem by passing the position explicitly into rgb_diff_stat_update(), just like it is already passed in to scalar_stat_update(). Currently the only user simply passes the reference value as position, because there the input value is also the reference value. This is not true for future uses of rgb_diff_stat. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
3f605424 -
This is a special case of scalar_stat dumps to record all of two-norm and RGB differences on the same line in the dump file. This makes the dump file easier to handle when you want full RGB errors recorded. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
e103ef4d -
Add documentation for test authors. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
be281478 -
compare_float() was an ad hoc max error logger with optional debug logging. Now that we have rgb_diff_stat, we can get the same statistics and more with less code. It looks like we would lose the pixel index x, but that can be recovered from the dump file line number. This patch takes care to keep the test condition exactly the same as it was before. The statistics print-out has more details now. The recorded dump position is the foreground color as that varies while the background color is constant. An example Octave function is included to show how to visualize the rgb_diff_stat dump. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
a0584e64 -
Switch from per-channel max error tolerance to max two-norm (Euclidean distance) error. Geometrically this means that previously the accepted volume was a +/- tolerance cube around the reference point, and now it is a sphere with tolerance radius. This makes the check slightly stricter. The real benefit is simplifying the code. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
baf7ab57 -
compare_float() was an ad hoc max error logger with optional debug logging. Now that we have rgb_diff_stat, we can get the same statistics and more with less code. It looks like we would lose the pixel index x, but that can be recovered from the dump file line number. This patch takes care to keep the test condition exactly the same as it was before. The statistics print-out has more details now. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
3acb1c47 -
Switch from per-channel max error tolerance to max two-norm (Euclidean distance) error. Geometrically this means that previously the accepted volume was a +/- tolerance cube around the reference point, and now it is a sphere with tolerance radius. The real benefit is simplifying the code. The error tolerance are also changed to float. Integers cannot represent values between 1 and 2, and the jump from 1 to 2 would have been too much. AdobeRGB tolerance gets relaxed a bit, while BT2020 tolerance becomes stricter. The new tolerance values are the reported achieved two-norm max errors plus a bit of margin. Surprisingly the sRGB case tolerances remain strictly at zero, and that's no bug in the test. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
b5467ba2