From 40dd55ac041362648c1c05cd47ae41d9c9a05fe2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 5 Dec 2016 15:22:09 +0100 Subject: m + new colour spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- NEWS | 6 ++ doc/info/chap/colour-spaces.texinfo | 41 +++++++++- src/libclut.h | 145 +++++++++++++++++++++++++++++------- 3 files changed, 164 insertions(+), 28 deletions(-) diff --git a/NEWS b/NEWS index d758883..3d556a0 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,11 @@ libclut NEWS -*- outline -*- +* Noteworthy changes in release 1.2 (TBA) [stable] + + New RGB colour spaces added: ITU-R BT.2020, ITU-R BT.2100, + ITU-R BT.601 625 line, ITU-R BT.601 525 line, DCI-P3 D65, + and DCI-P3 Theater. + * Noteworthy changes in release 1.1 (2016-(12)Dec-03) [stable] Support for CIELUV, CIELCh, YIQ, YDbDr, YPbPr, YCgCo, diff --git a/doc/info/chap/colour-spaces.texinfo b/doc/info/chap/colour-spaces.texinfo index b190ada..89e7677 100644 --- a/doc/info/chap/colour-spaces.texinfo +++ b/doc/info/chap/colour-spaces.texinfo @@ -730,7 +730,7 @@ below, along with the gamma each colour space uses. @item sRGB @tab -sRGB +custom @tab @code{LIBCLUT_RGB_COLOUR_SPACE_SRGB_INITIALISER} @item @@ -776,6 +776,18 @@ ColorMatch RGB @tab @code{LIBCLUT_RGB_COLOUR_SPACE_COLORMATCH_RGB_INITIALISER} @item +DCI-P3 D65 +@tab +2.6 +@tab +@code{LIBCLUT_RGB_COLOUR_SPACE_DCI_P3_D65_INITIALISER} +@item +DCI-P3 Theater +@tab +2.6 +@tab +@code{LIBCLUT_RGB_COLOUR_SPACE_DCI_P3_THEATER_INITIALISER} +@item Don RGB 4 @tab 2.2 @@ -794,15 +806,39 @@ Ekta Space PS5 @tab @code{LIBCLUT_RGB_COLOUR_SPACE_EKTA_SPACE_PS5_INITIALISER} @item +525 line@footnote{ITU-R Recommendation BT.601 (ITU-R BT.601), 525 line} +@tab +custom +@tab +@code{LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_601_525_LINE_INITIALISER} +@item +625 line@footnote{ITU-R Recommendation BT.601 (ITU-R BT.601), 625 line} +@tab +custom +@tab +@code{LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_601_625_LINE_INITIALISER} +@item ITU-R BT.709@footnote{ITU-R Recommendation BT.709} @tab 2.4 @tab @code{LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_709_INITIALISER} @item +ITU-R BT.2020@footnote{ITU-R Recommendation BT.2020} +@tab +custom +@tab +@code{LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_2020_INITIALISER} +@item +ITU-R BT.2100@footnote{ITU-R Recommendation BT.2100} +@tab +custom +@tab +@code{LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_2100_INITIALISER} +@item Lightroom RGB @tab -1.0 +linear @tab @code{LIBCLUT_RGB_COLOUR_SPACE_LIGHTROOM_RGB_INITIALISER} @item @@ -837,6 +873,7 @@ Wide Gamut RGB @code{LIBCLUT_RGB_COLOUR_SPACE_WIDE_GAMUT_RGB_INITIALISER} @end multitable +@page To create a description for the sRGB colour space write: @example diff --git a/src/libclut.h b/src/libclut.h index 80a2ce6..26e27a9 100644 --- a/src/libclut.h +++ b/src/libclut.h @@ -66,7 +66,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Adobe RGB (1998) colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -82,7 +82,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Apple RGB colour space. * - * This gamma colour space's gamma is 1.8. It cannot be used with + * This colour space's gamma is 1.8. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -98,7 +98,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Best RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -114,7 +114,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Beta RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -130,7 +130,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Bruce RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -146,7 +146,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the CIE RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -162,7 +162,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the ColorMatch RGB colour space. * - * This gamma colour space's gamma is 1.8. It cannot be used with + * This colour space's gamma is 1.8. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -174,11 +174,43 @@ LIBCLUT_ILLUMINANT_D50 \ } +/** + * Initialiser for `struct libclut_rgb_colour_space` with the values + * of the DCI-P3 D65 colour space. + * + * This colour space's gamma is 2.6. It cannot be used with + * RGB colour space conversion unless the values are tranlated into + * using the sRGB gamma function. + */ +#define LIBCLUT_RGB_COLOUR_SPACE_DCI_P3_D65_INITIALISER \ + { \ + .red_x = 0.680, .red_y = 0.320, .red_Y = 0.22897344, \ + .green_x = 0.265, .green_y = 0.690, .green_Y = 0.69175166, \ + .blue_x = 0.150, .blue_y = 0.060, .blue_Y = 0.07927490, \ + LIBCLUT_ILLUMINANT_D50 \ + } + +/** + * Initialiser for `struct libclut_rgb_colour_space` with the values + * of the DCI-P3 Theater colour space. + * + * This colour space's gamma is 2.6. It cannot be used with + * RGB colour space conversion unless the values are tranlated into + * using the sRGB gamma function. + */ +#define LIBCLUT_RGB_COLOUR_SPACE_DCI_P3_THEATER_INITIALISER \ + { \ + .red_x = 0.680, .red_y = 0.320, .red_Y = 0.20949168, \ + .green_x = 0.265, .green_y = 0.690, .green_Y = 0.72159525, \ + .blue_x = 0.150, .blue_y = 0.060, .blue_Y = 0.06891307, \ + .white_x = 0.314, .white_y = 0.351, .white_Y = 1 \ + } + /** * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Don RGB 4 colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -194,7 +226,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the ECI RGB v2 colour space. * - * This gamma colour space's used the L* gamma function. It cannot + * This colour space's used the L* gamma function. It cannot * be used with RGB colour space conversion unless the values are * tranlated into using the sRGB gamma function. */ @@ -210,7 +242,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Ekta Space PS5 colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -222,11 +254,45 @@ LIBCLUT_ILLUMINANT_D50 \ } +/** + * Initialiser for `struct libclut_rgb_colour_space` with the values + * of the ITU-R Recommendation BT.601 (ITU-R BT.601), 625 line colour + * space. + * + * This colour space uses a custom gamma function. It cannot be used + * with RGB colour space conversion unless the values are tranlated + * into using the sRGB gamma function. + */ +#define LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_601_625_LINE_INITIALISER \ + { \ + .red_x = 0.640, .red_y = 0.330, .red_Y = 0.2220023, \ + .green_x = 0.290, .green_y = 0.600, .green_Y = 0.7066689, \ + .blue_x = 0.150, .blue_y = 0.060, .blue_Y = 0.0713288, \ + LIBCLUT_ILLUMINANT_D65 \ + } + +/** + * Initialiser for `struct libclut_rgb_colour_space` with the values + * of the ITU-R Recommendation BT.601 (ITU-R BT.601), 525 line colour + * space. + * + * This colour space uses a custom gamma function. It cannot be used + * with RGB colour space conversion unless the values are tranlated + * into using the sRGB gamma function. + */ +#define LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_601_525_LINE_INITIALISER \ + { \ + .red_x = 0.630, .red_y = 0.340, .red_Y = 0.2220023, \ + .green_x = 0.310, .green_y = 0.595, .green_Y = 0.7066689, \ + .blue_x = 0.155, .blue_y = 0.070, .blue_Y = 0.0713288, \ + LIBCLUT_ILLUMINANT_D65 \ + } + /** * Initialiser for `struct libclut_rgb_colour_space` with the values * of the ITU-R Recommendation BT.709 (ITU-R BT.709) colour space. * - * This gamma colour space's gamma is 2.4. It cannot be used with + * This colour space's gamma is 2._. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -238,11 +304,43 @@ LIBCLUT_ILLUMINANT_D65 \ } +/** + * Initialiser for `struct libclut_rgb_colour_space` with the values + * of the ITU-R Recommendation BT.2020 (ITU-R BT.2020) colour space. + * + * This colour space uses a custom gamma function. It cannot be used + * with RGB colour space conversion unless the values are tranlated + * into using the sRGB gamma function. + */ +#define LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_2020_INITIALISER \ + { \ + .red_x = 0.7080, .red_y = 0.2920, .red_Y = 0.2627296, \ + .green_x = 0.1700, .green_y = 0.7970, .green_Y = 0.6767483, \ + .blue_x = 0.1310, .blue_y = 0.0460, .blue_Y = 0.0605221, \ + LIBCLUT_ILLUMINANT_D65 \ + } + +/** + * Initialiser for `struct libclut_rgb_colour_space` with the values + * of the ITU-R Recommendation BT.2100 (ITU-R BT.2100) colour space. + * + * This colour space uses a custom gamma function. It cannot be used + * with RGB colour space conversion unless the values are tranlated + * into using the sRGB gamma function. + */ +#define LIBCLUT_RGB_COLOUR_SPACE_ITU_R_BT_2100_INITIALISER \ + { \ + .red_x = 0.7080, .red_y = 0.2920, .red_Y = 0.2627296, \ + .green_x = 0.1700, .green_y = 0.7970, .green_Y = 0.6767483, \ + .blue_x = 0.1310, .blue_y = 0.0460, .blue_Y = 0.0605221, \ + LIBCLUT_ILLUMINANT_D65 \ + } + /** * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Lightroom RGB colour space. * - * This gamma colour space's gamma is 1.0. It cannot be used with + * This colour space's gamma is 1 (linear). It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -258,7 +356,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the NTSC RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -274,7 +372,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the PAL/SECAM RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -290,7 +388,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the ProPhoto RGB colour space. * - * This gamma colour space's gamma is 1.8. It cannot be used with + * This colour space's gamma is 1.8. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -306,7 +404,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the SMPTE-C RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -322,7 +420,7 @@ * Initialiser for `struct libclut_rgb_colour_space` with the values * of the Wide Gamut RGB colour space. * - * This gamma colour space's gamma is 2.2. It cannot be used with + * This colour space's gamma is 2.2. It cannot be used with * RGB colour space conversion unless the values are tranlated into * using the sRGB gamma function. */ @@ -335,15 +433,10 @@ } /* - * name gamma xw yw xr yr xg yg xb yb - * ITU-R Recommendation BT.2020 (ITU-R BT.2020) *1 { D65 } 0.708 0.292 0.170 0.797 0.131 0.046 - * ITU-R Recommendation BT.2100 (ITU-R BT.2100) *2 { D65 } 0.708 0.292 0.170 0.797 0.131 0.046 - * DCI-P3 D65 ? { D65 } 0.680 0.320 0.265 0.690 0.150 0.060 - * DCI-P3 Theater ? 0.314 0.351 0.680 0.320 0.265 0.690 0.150 0.060 - * https://en.wikipedia.org/wiki/Rec._601 - * - * *1 https://en.wikipedia.org/wiki/Rec._2020#Transfer_characteristics - * *2 http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2100-0-201607-I!!PDF-E.pdf + * TODO gamma functions: + * https://en.wikipedia.org/wiki/Rec._2020#Transfer_characteristics + * http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2100-0-201607-I!!PDF-E.pdf + * https://en.wikipedia.org/wiki/Rec._601 */ -- cgit v1.2.3-70-g09d2