summaryrefslogtreecommitdiff
path: root/babl/base
Commit message (Collapse)AuthorAge
* -Wsign-compare conversions.cAxel Viala2022-08-21
|
* Fix warning: comparison of integer expressions of different signedness: ↵Axel Viala2022-08-21
| | | | ‘int’ and ‘long unsigned int’ [-Wsign-compare]
* babl/base/babl-rgb-converter.c: Fix universal_nonlinear_rgb_u8_converter_sse2Sergey Torokhov2022-07-16
| | | | | | | | | | Fix alignment of vector of floats in babl-rgb-converter.c Downstream Bug (Gentoo): https://bugs.gentoo.org/857708 Bug: https://gitlab.gnome.org/GNOME/babl/-/issues/76 Thanks-to: Alexander Bezrukov <phmagic@mail.ru> Signed-off-by: Alexander Bezrukov <phmagic@mail.ru> Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
* avoid some avoidable implicit promotion to doubleØyvind Kolås2022-02-26
|
* babl: make unified alpha conversion branchlessØyvind Kolås2022-01-26
|
* Revert "make trampoline for lut processing"Øyvind Kolås2022-01-24
| | | | | | | This reverts commit b3e884edf3b5c58fb4c2cede1346bd8a9d9c4a1e. benchmarking on x86_64 saw no effect, and as a surprise on arm it pessimises performance.
* build: fix append of sse2 cflagsØyvind Kolås2022-01-24
|
* make trampoline for lut processingØyvind Kolås2022-01-24
|
* build: append list of one element rather than stringØyvind Kolås2022-01-24
|
* babl: free LUTs that have been unused for more than 5 minutesØyvind Kolås2022-01-24
|
* babl: add sse2 flags when building RGB converterØyvind Kolås2022-01-23
|
* babl: remove some now dead u8 codeØyvind Kolås2022-01-23
|
* babl: add u8 code paths to trc/matrix space conversionØyvind Kolås2022-01-23
| | | | | This is relevant for ARM, on modern x86_64 at least it is cheaper to convert to/from float with external loops.
* babl: remove allocations in u8 variants of RGB space conversionsØyvind Kolås2022-01-23
|
* babl: add more missing SIMD build related filesØyvind Kolås2022-01-23
|
* babl: add missing files babl-trc.[ch]Øyvind Kolås2022-01-23
|
* multipass build, with SIMD variants for x86_64 and armØyvind Kolås2022-01-23
| | | | | | Some extensions have their own separate build, so does the RGB color space conversions, trc computations and base set of conversions.
* base: x86-64-v2 and x86-64-v3 variantsØyvind Kolås2022-01-22
|
* build: code cleanupJohn Marshall2020-06-25
|
* git: remove obsolete .gitignore filesJohn Marshall2020-06-25
|
* Revert "build: opt out of unsafe math optimizations in reference and base"Øyvind Kolås2020-01-12
| | | | | This reverts commit 84128d538aa4f189c31d296d04084762ce062107. after having set global cflags opting out of unsafe math see issue #49.
* build: opt out of unsafe math optimizations in reference and baseØyvind Kolås2019-11-08
| | | | | | This makes the reference code paths used for verifying conversions in extensions not involve for instance fast reciprocal approximations, see issue #49. The extensions are still compiled with full optimizations.
* babl: simplify logic in babl_epsilon_for_zeroØyvind Kolås2019-08-16
| | | | | | | We do not need to treate positive/negative avoided infinities differently, the result is the same as long as we are consistent, and only using the positive epsilon value leads to slightly simpler per-pixel conversion code in both directions.
* build: remove autotoolsØyvind Kolås2019-07-29
|
* docs: improve generated referenceØyvind Kolås2019-07-22
| | | | | When registering types, models, formats and components one can now specify override "doc" strings that end up in this reference.
* base: s/premultiplied/associated_alpha/Øyvind Kolås2019-07-22
|
* babl: replace premultiplied with associated in BablModelFlagsØyvind Kolås2019-07-22
| | | | | The terminology that babl has settled for - for the different types of alpha is associated- and separate- alpha.
* docs: improve the generated referenceØyvind Kolås2019-07-22
|
* babl: performance improvement in model-grayThomas Manni2019-06-24
| | | | | Use multiplication by the inverse instead of division in premultiplied to non-premultiplied alpha conversion functions.
* babl/base: use symmetric alpha transformations for CMYKØyvind Kolås2019-06-19
|
* 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 */ } ```
* remove unused file conversions-type.cØyvind Kolås2019-05-28
| | | | Really resolving merge request !12 this time.
* meson build: improve lcms dependency handlingJohn Marshall2019-05-25
|
* removing conversions-type.c is best done in a different commitNuno Ferreira2019-05-25
|
* remove 'conversions-type.c' file since it is emptyNuno Ferreira2019-05-25
|
* babl: add Y~aA formats - for completenessØyvind Kolås2019-05-09
| | | | | In order for higher level code to be abstracted across all available permutations we need this. This fixes gegl issue no 151
* build: add meson build files to EXTRA_DIST to include in autotools make distJohn Marshall2019-04-13
|
* code style reviewNuno Ferreira2019-02-22
| | | | fixed style of function headers in the babl/base folder
* meson: Add missing mode-cmyk.c file to source listJan Vesely2018-12-06
| | | | | Fix meson build. Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
* base: add more u8 cmyk formatsØyvind Kolås2018-12-02
|
* base: add half version of CMYK formatsØyvind Kolås2018-12-01
|
* */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.
* base: add linear meta-data to relevant gray modelØyvind Kolås2018-11-28
|
* base: ass linear bit to rgb and ragaba modelsØyvind Kolås2018-11-28
|
* babl: add bitmask flags for meta-data about modelsØyvind Kolås2018-11-27
| | | | | | | | | Refactored from new API needed internally for knowing if a model is CMYK based or not, this permits adding meta-data that can be quickly figured out in possible fast code paths. The API is not complete, and it probably doesn't harm to include as many features from different models as possible that fit in a bitmask, adding the most important ones first and maintaining the order of the enum will ensure API compatibility once it is in a release.
* babl: implement CMYK color model in reference and baseØyvind Kolås2018-11-24
| | | | | | This commit adds support to the reference fishes of babl to deal with CMYK based pixel format encodings, backed by babl spaces with ICC CMYK ICC profiles.
* base: model-gray: remove special case for black transparent premulØyvind Kolås2018-08-31
|
* Revert "special case all 0 to map to all 0 in nonpremul"Øyvind Kolås2018-08-30
| | | | | | | | This reverts commit 18dea5104f3de79af5e9641a0ef47435b112d44b. We want to be able to do component by component average/weighting of remultiplied values, by breaking the floor for black alpha zero we break the consistency of such arithmetic.
* base: fix misregistred Y float to RGBA float conversionØyvind Kolås2018-08-30
|
* base: use f suffix on float literalsØyvind Kolås2018-08-30
|