summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* main args not used.Axel Viala2022-08-21
|
* Fix warn in CHECK_CONV_FLOATAxel Viala2022-08-21
|
* -Wsign-compare conversions.cAxel Viala2022-08-21
|
* meson: Various fixesXavier Claessens2022-04-25
| | | | | | | | | | - Add missing lcms dependencies. That's needed when lcms is a subproject otherwise those targets does not find its headers. - Add lcms2 wrap so meson can build it as subproject in case the dependency is not found on system. - Fix couple meson warnings - Use meson.override_dependency() so babl can be used as subproject without hardcoding "babl_dep" variable name in main project.
* tests: add a xyz to lab testØyvind Kolås2021-10-30
| | | | | This is testing D50 XYZ to D50 CIE Lab the use of D50 for all XYZ and Lab is currently implicit in all babl code.
* build: remove unnecessary environment variablesJohn Marshall2020-06-25
|
* git: remove obsolete .gitignore filesJohn Marshall2020-06-25
|
* build: add build path variablesJohn Marshall2020-06-25
| | | | - add build path variables for library and extensions
* tests: use putenv when setting env vars, for win32 compatibilityØyvind Kolås2020-05-28
|
* tests: add test that creates the base fishes expected by GIMPØyvind Kolås2020-05-27
|
* tests: add a test for naive CMYK conversionØyvind Kolås2020-05-03
|
* tests: squelch clang warnings of using fabs on integerØyvind Kolås2019-11-28
|
* build: remove autotoolsØyvind Kolås2019-07-29
|
* meson: fix typoed filenameØyvind Kolås2019-06-19
|
* tests: rename from transparent_symmetry to alpha_symmetric_transformØyvind Kolås2019-06-19
|
* docs: updateØyvind Kolås2019-06-19
|
* meson: add transparent_symmetry testØyvind Kolås2019-06-13
|
* babl: symmetric conversions between associated and separate alpha.Øyvind Kolås2019-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide symmetric, color data preserving conversions between associated and separate alpha for alpha values near and equal to 0.0 at single precision floating point. Thus these symmetric conversions also augment associated alpha to always maintain color information. This is achieved by clamping the alpha used when computing the color components when multiplying/dividing components between separate and associated alpha to BABL_ALPHA_FLOOR and -BABL_ALPHA_FLOOR for values near 0.0, the alpha value is copied unmodified between pixels; the main improvement of this commit. In the implementation BABL_ALPHA_FLOOR is 1/65536 = 0.00001526.. small enough that it vanishing in rounding for 16bit integer alpha but large enough to retain color data. The following table illustrates what corresponding values are between the two alpha encodings supported. We here usea BABL_ALPHA_FLOOR of 0.01 instead of 0.00001526 to make it easier to see what happens. ``` "RGBA float" "RaGaBaA float" separate alpha associated alpha non-premultiplied pre-multiplied alpha R G B A Ra Ga Ba A 10.000 1.000 0.100 0.000 0.100 0.010 0.001 0.000 10.000 1.000 0.100 0.005 0.100 0.010 0.001 0.005 __10.000___1.000__0.100__0.010_____0.100__0.010__0.001__0.010__ 10.000 1.000 0.100 0.020 0.200 0.020 0.002 0.020 10.000 1.000 0.100 0.200 2.000 0.200 0.020 0.200 10.000 1.000 0.100 0.400 4.000 0.400 0.040 0.400 1000.000 100.000 10.000 0.000 10.000 1.000 0.100 0.000 1000.000 100.000 10.000 0.005 10.000 1.000 0.100 0.005 1000.000_100.000_10.000__0.010____10.000__1.000__0.100__0.010___ 500.000 50.000 5.000 0.020 10.000 1.000 0.100 0.020 50.000 5.000 0.500 0.200 10.000 1.000 0.100 0.200 25.000 2.500 0.250 0.400 10.000 1.000 0.100 0.400 ``` GEGL lets each operation compute with it's preferred encoding - for some operations like blurs this is associated alpha, for others like color adjustments it is separate alpha, perhaps even in CIE Lab based encodings rather than RGB. An earlier iteration of this approach was already in use in babl making un-erase mode and similar features in GIMP-2.10 work correctly after blurring, the previous implementation did not preserve the alpha value. Just the core of the implementation follows: ``` #define BABL_ALPHA_FLOOR_F (1.0f/65536.0f) static inline float babl_epsilon_for_zero_float (float value) { if (value <= BABL_ALPHA_FLOOR_F) { /* for performance one could directly retun BABL_ALPHA_FLOOR_F here and dropping handling negative values consistently. */ if (value >= 0.0f) return BABL_ALPHA_FLOOR_F; else if (value >= -BABL_ALPHA_FLOOR_F) return -BABL_ALPHA_FLOOR_F; } return value; /* most common case, return input value */ } static inline void separate_to_associated_rgba (const float *separate_rgba, float *associated_rgba) { float alpha = babl_epsilon_for_zero_float (separate_rgba[3]); associated_rgba[0] = separate_rgba[0] * alpha; associated_rgba[1] = separate_rgba[1] * alpha; associated_rgba[2] = separate_rgba[2] * alpha; associated_rgba[3] = separate_rgba[3]; /* direct copy */ } static inline void associated_to_separate_rgba (const float *associated_rgba, float *separate_rgba) { float alpha = babl_epsilon_for_zero_float (associated_rgba[3]); float reciprocal_alpha = 1.0f / alpha; /* the conditional normally in this conversion to avoid division by zero is handled by epsilon_for_zero */ separate_rgba[0] = associated_rgba[0] * reciprocal_alpha; separate_rgba[1] = associated_rgba[1] * reciprocal_alpha; separate_rgba[2] = associated_rgba[2] * reciprocal_alpha; separate_rgba[3] = associated_rgba[3]; /* direct copy */ } ```
* meson build: add new testsJohn Marshall2019-05-25
|
* git: build cleanup - add missing build objects to .gitignoreJohn Marshall2019-05-25
|
* tests: remove duplicate extract testJohn Marshall2019-05-25
|
* build: add meson build files to EXTRA_DIST to include in autotools make distJohn Marshall2019-04-13
|
* tests: remove context-less debug printfsØyvind Kolås2018-12-06
|
* tests: add code that processes a palette format with changed spaceØyvind Kolås2018-12-06
|
* tests: fix bit-rot in palette testsØyvind Kolås2018-12-06
| | | | | | Update to use R'G'B' u8 formats, which is what is now used internally as well well, along with updating to use the current way of creating formats with/without transparency.
* tests: update cairo hack with final format namesØyvind Kolås2018-12-04
|
* add a format for muxing cmyk u8 in and out of rgba u8 buffersØyvind Kolås2018-12-03
|
* */Makefile.am: add LCMS_CFLAGS to CPPFLAGSEll2018-11-28
| | | | | Since babl-space.h includes lcms2.h, we need to include LCMS_CFLAGS everywhere that includes babl-internal.h.
* tests: make srgb-to-lab-u8 also compile stand-aloneØyvind Kolås2018-11-16
|
* Change the license URL from http://www.gnu.org/licenses/ to https://Michael Natterer2018-07-11
|
* tests: add format_with_space testØyvind Kolås2018-06-21
| | | | | Testing that both R'G'B' formats and CIE Lab float keep the space they have been created with.
* tests: fix palette-concurrency-stress-testEll2018-05-19
| | | | | | | | | | Fix palette-concurrency-stress-test to accommodate the change to a gamma-corrected 8-bit format (commit fabcc6729ed453fb5c5affc565d0e837a78afc5c), and to little-endian hash indices (commit 55ca45c8233af138d3fd388587b203d802b8396c). The test should pass regardless, it simply didn't actually test for the intended issue previously.
* Meson build: Improve host environment detection / handlingJohn Marshall2018-05-19
|
* palette: expect palettes/formats to be gamma corrected in 8bitØyvind Kolås2018-01-03
| | | | | | | A correctness correction related to bug #763581 the formats wanted by GIMP and expected are gamma corrected not linear, I expect this fix either does not much for GIMP or fixes an unknown 8bit linear vs gamma quantization problem that has been lurking in INDEXED mode.
* Add testsFélix Piédallu2017-12-16
|
* tests: not all UNIX-like OSes have a libpthread.Jehan2017-12-04
| | | | | | | In particular Android systems don't need to link with -lpthread (actually the link would fail with "ld: cannot find -lpthread"). Use the $(THREAD_LIB) variable which is set correctly during configure since commit c02af82.
* babl: use -no-install to avoid libtool .sh wrappersØyvind Kolås2017-09-28
|
* tests/grayscale_to_rgb: increase printed debug precisionØyvind Kolås2017-09-25
|
* tests: move non-test binaries from here to ../toolsØyvind Kolås2017-09-25
|
* tests: use a epsilon instead of == for float compareØyvind Kolås2017-09-25
|
* tests: make babl build on haikuØyvind Kolås2017-09-14
| | | | | Using -lphtread instead of -pthread in Makefile.am fixes the build when using gcc-x86 under haiku, figured out by schumaml.
* tests: add a test verifying that buffers are converted between RGB spacesØyvind Kolås2017-08-18
|
* palette: make palette conversion thread safeEll2017-06-21
| | | | | | | | | | | | | | | | | | Conversion from RGBA u8 to an 8-bit palette format caches conversion results in a hash table, belonging to the palette model. Currently, manipulation of the hash table is not thread safe -- when multiple threads convert to the same palette format concurrently, the result may be wrong. In particular, there is a race condition when two different colors that share the same hash are converted concurrently. Fix this by changing the hash table layout, so that it can be modified atomically. We assume that aligned 32-bit writes are atomic. Note that the new layout is only suitable for palettes with up to 256 colors, but this is all we use the hash table for ATM anyway. Add a regression test.
* tests: fix typo in hsva.cEll2017-06-11
| | | | | | "rgba to hsva" -> "hsva to rgba"; got swapped by commit c8b5eee3f86a49bd093929f0bd16ef780de88c67. Thanks to Edward_E for catching that.
* Bug 780016 - Conversion path between nonpremultiplied formats ...Ell2017-06-08
| | | | | | | | | | | .. may pass through a premultiplied format, losing color information of fully transparent pixels Add a few pixels with zero alpha to the test pixels array, to penalize such paths. 16 pixels seem to be enough for the conversions tested, using the default tolerance. Add a regression test.
* tests: add CHECK_CONV_FLOAT to common.incEll2017-06-08
| | | | | | | Like CHECK_CONV, but for floating point destination types. Use CHECK_CONV_FLOAT in hsva.c and hsl.c, instead of custom CHECK_CONV implementations. To be used by another test soon.
* remove babl-fish-statsØyvind Kolås2016-11-19
|
* babl_fish_path_fitness: gcc6: fix -Wmisleading-indentation warningsRoman Lebedev2016-08-26
|
* Revert "build: add --enable-installed-tests parameter"Øyvind Kolås2015-05-29
| | | | This reverts commit 1457ff4d59f1e2fccdf7e09e5725a698afbc5d22.
* build: add --enable-installed-tests parameterVadim Rutkovsky2015-05-23
| | | | | | | See https://live.gnome.org/GnomeGoals/InstalledTests for more information. Those tests will also be executed on http://build.gnome.org It's still possible to run `make check` with locally uninstalled tests.