From 5f3a2e9c9abe48fb834c73e36e8bdc3b8dfbbae2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 25 Jul 2019 12:29:39 +0200 Subject: [PATCH] docs: remove duplicate files --- docs/CMYK.html | 88 -------------------------- docs/ColorManagement.html | 91 --------------------------- docs/SymmetricAlpha.html | 129 -------------------------------------- 3 files changed, 308 deletions(-) delete mode 100644 docs/CMYK.html delete mode 100644 docs/ColorManagement.html delete mode 100644 docs/SymmetricAlpha.html diff --git a/docs/CMYK.html b/docs/CMYK.html deleted file mode 100644 index 25ea943..0000000 --- a/docs/CMYK.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - CMYK - babl - - - - - - - -
- -
- -
-
-

Contents

-
- -
- -
-
- -

CMYK

- -

CMYK handling is done using babl-spaces created with ICC profiles -containing CMYK profiles. BablSpaces for these ICC profiles handle color conversions using lcms2 - or if compiled without lcms2 support a naive profile independent fallback.

-

When a babl space derived from a CMYK ICC profile is used to instantiate -RGB formats, the resulting formats are using the default/NULL space for -primaries and TRCs.

- -

The CMYK formats that use lcms2 for color interchange with the rest of -babl are the following, which are available for all data types, u8, u16, half -and float:

-
-
CMYK
Cyan Magenta Yellow Key, with 0 being white and 1.0 full ink coverage.
-
CMYKA
as previous, with separate alpha channel
-
CaMaYaKaA
as previous but associated alpha
-
cmyk
inverted CMYK, where 0.0 is full ink coverage and 1.0 is none
-
cmykA
as previous, with separate alpha channel
-
camayakaA
as previous but associated alpha
-
- - - /babl -
-
- -
-
-  -
-
- - - diff --git a/docs/ColorManagement.html b/docs/ColorManagement.html deleted file mode 100644 index 50c0460..0000000 --- a/docs/ColorManagement.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - babl color management - - - - - - - - - -
-
-

Contents

-
- -
- - -
-
-

Color Management

- -

By default the babl API is assuming data to be (unbounded) sRGB data, data - being sRGB defines the conversion to and from gray-scale as well as the gamma - - or Transfer Response Curve, TRC, used for converting between linear and - non-linear variants of the data. -

- -

babl has API for creating a format for a specific space: - babl_format_with_space("R'G'B' u16", babl_space ("Rec2020")) creates - a 16 bit integer format for the Rec2020 color space. Babl knows internally - about "sRGB", "Rec2020", "Adobe", "Apple" and "ProPhoto" spaces, as they are - defined with constants on their wikipedia pages. -

- -

Additional spaces can be loaded from monitor-class matrix+TRC ICC v2 and - v4 profiles. Using babl_icc_make_space (see babl.h for details). The space of - a babl format can also be queried with babl_format_get_space. -

- -

The conversions babl does with ICC profiles are according to what is known - as the relative-colorimetric intent, monitor profiles containing both the - matrices used by babl and 3d CLUTs (color look up tables) sometimes also do - relative-colorimetric transfer for the "perceptual" intent CLUTs, but with - a more flexible and possibly higher accuracy conversions.

- -

Handling of CMYK is in a separate document.

- - /babl -
-
- -
-
-  -
-
- - - diff --git a/docs/SymmetricAlpha.html b/docs/SymmetricAlpha.html deleted file mode 100644 index 838b5cc..0000000 --- a/docs/SymmetricAlpha.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - Symmetric Alpha - babl - - - - - - - -
- -
- -
-
-

Contents

-
- -
- -
-
- -

Symmetric transformations for floating point alpha

- - -

babl clamps the alpha used when going from separate alpha to associated -alpha or from associated alpha to separate alpha to BABL_ALPHA_FLOOR. This -replaces asymptotic behavior and direct precision loss of color precision when -multiplying or dividing by alphas near 0.0 with a consistent symmetric -transformation.

- -

Original intent of data as well as non-asymptotic precision loss is thus -maintained when the processing chain might temporarily use the other alpha -representation.

- -
-    #define BABL_ALPHA_FLOOR    (1.0/65536.0)
-    #define BABL_ALPHA_FLOOR_F  (1.0f/65536.0f)
-
- -

The deviation from not clamping near 0.0 is within the quantization margin -of 16bit integer alpha, thus no adaptations for any SIMD or and similar 8bit -and 16bit extensions of pixel format conversions are needed. -

- -

This is the clamping function in use:

-
-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 */
-}
-
-

And an example use of this clamping function that is consistent with babls behavior:

-
-static inline void
-associated_to_separate_rgba (const float *associated_rgba,
-                                   float *separate_rgba)
-{
-  float alpha = associated_rgba[3];
-  float clamped_alpha = babl_epsilon_for_zero_float (alpha);
-  float reciprocal_alpha = 1.0f / clamped_alpha;
-
-  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] = alpha;
-}
-
- - -

For more detils see the commit message of the most recent refinement as well as blog post with further background.

- - - - /babl -
-
- -
-
-  -
-
- - - -- 2.30.2