aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-12-02 23:33:15 +0100
committerMattias Andrée <maandree@kth.se>2016-12-02 23:33:15 +0100
commitb51a413074a9844e3c045c743dc1ba56414b6263 (patch)
tree77a564ee78eb059d13d45191783857bd87901960 /doc
parentAdd new colour spaces (diff)
downloadlibclut-b51a413074a9844e3c045c743dc1ba56414b6263.tar.gz
libclut-b51a413074a9844e3c045c743dc1ba56414b6263.tar.bz2
libclut-b51a413074a9844e3c045c743dc1ba56414b6263.tar.xz
Add libclut_model_rgb_to_ciexyz and libclut_model_ciexyz_to_rgb
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'doc')
-rw-r--r--doc/info/chap/colour-spaces.texinfo75
1 files changed, 72 insertions, 3 deletions
diff --git a/doc/info/chap/colour-spaces.texinfo b/doc/info/chap/colour-spaces.texinfo
index e1dfae1..b190ada 100644
--- a/doc/info/chap/colour-spaces.texinfo
+++ b/doc/info/chap/colour-spaces.texinfo
@@ -895,9 +895,11 @@ This function is not available as a macro, thus, linking with
Parameters:
@table @code
@item const libclut_rgb_colour_space_t* from
-Description of the input colour space.
+Description of the input colour space. CIE XYZ is
+used use if this parameter is @code{NULL}.
@item const libclut_rgb_colour_space_t* to
-Description of the output colour space.
+Description of the output colour space. CIE XYZ is
+used use if this parameter is @code{NULL}.
@item libclut_colour_space_conversion_matrix_t M
Matrix to fill with values so it can be used for
converting from the input colour space to the
@@ -923,7 +925,7 @@ function.
@table @code
@item libclut_model_convert_rgb(r, g, b, M, *out_r, *out_g, *out_b)
Convert a single RGB colour into another RGB colour space.
-The colour space must have same gamma functions as RGB.
+The colour space must have same gamma functions as sRGB.
This macro is also available a function. If the function is
used, linking with @option{-lclut} is required, otherwise,
@@ -949,6 +951,7 @@ Output parameter for the green value of the colour after conversion.
Output parameter for the blue value of the colour after conversion.
@end table
+
@item libclut_convert_rgb_inplace(clut, max, type, m, trunc)
Convert the curves between two RGB colour spaces.
@@ -986,6 +989,7 @@ out of gamut are truncated. (Not necessarily the best
approximation.)
@end table
+
@item libclut_convert_rgb(clut, max, type, m, trunc, out)
Convert the curves between two RGB colour spaces.
@@ -1031,3 +1035,68 @@ the same data type as @code{clut}. And have the same values on
@code{clut}.
@end table
@end table
+
+There is also two functions for converting between a custom RGB
+colour space and CIE XYZ, one function in each direction. Note
+that the three functions above do not work if one of the colour
+spaces is CIE XYZ.
+
+@table @code
+@item libclut_model_rgb_to_ciexyz(r, g, b, M, *X, *Y, *Z)
+Convert a single RGB colour if a custom RGB colour space
+to CIE XYZ.
+
+The RGB colour space must have the same gamma function as sRGB.
+
+This macro is also available a function. If the function is
+used, linking with @option{-lclut} is required, otherwise,
+linking with @option{-lm} is required, or @option{-lclut} if
+@code{libclut_model_standard_to_linear1} is undefined.
+
+Parameters:
+@table @code
+@item double r
+The red component.
+@item double g
+The green component.
+@item double b
+The blue component.
+@item libclut_colour_space_conversion_matrix_t M
+The conversion matrix.
+@item double* X
+Output parameter for the X component.
+@item double* Y
+Output parameter for the Y component.
+@item double* Z
+Output parameter for the Z component.
+@end table
+
+
+@item libclut_model_rgb_to_ciexyz(X, Y, Z, M, *r, *g, *b)
+Convert a single colour from CIE XYZ to a custom RGB colour space.
+
+The RGB colour space must have the same gamma function as sRGB.
+
+This macro is also available a function. If the function is
+used, linking with @option{-lclut} is required, otherwise,
+linking with @option{-lm} is required, or @option{-lclut} if
+@code{libclut_model_linear_to_standard1} is undefined.
+
+Parameters:
+@table @code
+@item double X
+The X component.
+@item double Y
+The Y component.
+@item double Z
+The Z component.
+@item libclut_colour_space_conversion_matrix_t M
+The conversion matrix.
+@item double* r
+Output parameter for the red component.
+@item double* g
+Output parameter for the green component.
+@item double* b
+Output parameter for the blue component.
+@end table
+@end table