From 42ca750430bf40ba13493ac46028d22e6f3555b9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 10 Jun 2017 10:48:21 +0200 Subject: m + add libcolour_delta_e.3, libcolour_srgb_decode.3, and libcolour_srgb_encode.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- LIBCOLOUR_CIE1960UCS.7 | 18 +++++------ LIBCOLOUR_CIELAB.7 | 18 +++++------ LIBCOLOUR_CIELCHUV.7 | 22 ++++++------- LIBCOLOUR_CIELUV.7 | 20 ++++++------ LIBCOLOUR_CIEUVW.7 | 22 ++++++------- LIBCOLOUR_CIEXYY.7 | 18 +++++------ LIBCOLOUR_CIEXYZ.7 | 18 +++++------ LIBCOLOUR_RGB.7 | 82 ++++++++++++++++++++++++------------------------- LIBCOLOUR_SRGB.7 | 20 ++++++------ LIBCOLOUR_YCGCO.7 | 18 +++++------ LIBCOLOUR_YDBDR.7 | 18 +++++------ LIBCOLOUR_YIQ.7 | 18 +++++------ LIBCOLOUR_YPBPR.7 | 18 +++++------ LIBCOLOUR_YUV.7 | 18 +++++------ libcolour.7.in | 2 +- libcolour_delta_e.3 | 42 +++++++++++++++++++++++++ libcolour_srgb_decode.3 | 35 +++++++++++++++++++++ libcolour_srgb_encode.3 | 35 +++++++++++++++++++++ 18 files changed, 277 insertions(+), 165 deletions(-) create mode 100644 libcolour_delta_e.3 create mode 100644 libcolour_srgb_decode.3 create mode 100644 libcolour_srgb_encode.3 diff --git a/LIBCOLOUR_CIE1960UCS.7 b/LIBCOLOUR_CIE1960UCS.7 index 95dff79..a736cfe 100644 --- a/LIBCOLOUR_CIE1960UCS.7 +++ b/LIBCOLOUR_CIE1960UCS.7 @@ -6,9 +6,9 @@ CIE 1960 UCS colours are presented with either of .nf - \fBtypedef struct libcolour_cie1960ucs_f libcolour_cie1960ucs_f_t;\fP - \fBtypedef struct libcolour_cie1960ucs_lf libcolour_cie1960ucs_lf_t;\fP - \fBtypedef struct libcolour_cie1960ucs_llf libcolour_cie1960ucs_llf_t;\fP + typedef struct libcolour_cie1960ucs_f libcolour_cie1960ucs_f_t; + typedef struct libcolour_cie1960ucs_lf libcolour_cie1960ucs_lf_t; + typedef struct libcolour_cie1960ucs_llf libcolour_cie1960ucs_llf_t; .fi These @@ -24,12 +24,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_cie1960ucs_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIu\fP\fB;\fP - \fBfloat\fP \fIv\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fB};\fP + struct libcolour_cie1960ucs_f { + enum libcolour_model \fImodel\fP; + float \fIu\fP; + float \fIv\fP; + float \fIY\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_CIELAB.7 b/LIBCOLOUR_CIELAB.7 index 853a04f..ff5cfad 100644 --- a/LIBCOLOUR_CIELAB.7 +++ b/LIBCOLOUR_CIELAB.7 @@ -6,9 +6,9 @@ CIE L*a*b* colours are presented with either of .nf - \fBtypedef struct libcolour_cielab_f libcolour_cielab_f_t;\fP - \fBtypedef struct libcolour_cielab_lf libcolour_cielab_lf_t;\fP - \fBtypedef struct libcolour_cielab_llf libcolour_cielab_llf_t;\fP + typedef struct libcolour_cielab_f libcolour_cielab_f_t; + typedef struct libcolour_cielab_lf libcolour_cielab_lf_t; + typedef struct libcolour_cielab_llf libcolour_cielab_llf_t; .fi These @@ -24,12 +24,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_cielab_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIL\fP\fB;\fP - \fBfloat\fP \fIa\fP\fB;\fP - \fBfloat\fP \fIb\fP\fB;\fP - \fB};\fP + struct libcolour_cielab_f { + enum libcolour_model \fImodel\fP; + float \fIL\fP; + float \fIa\fP; + float \fIb\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_CIELCHUV.7 b/LIBCOLOUR_CIELCHUV.7 index 1b551c7..cae33cf 100644 --- a/LIBCOLOUR_CIELCHUV.7 +++ b/LIBCOLOUR_CIELCHUV.7 @@ -7,9 +7,9 @@ subsequent characters] (also known as CIE HLC_uv) colours are presented with either of .nf - \fBtypedef struct libcolour_cielchuv_f libcolour_cielchuv_f_t;\fP - \fBtypedef struct libcolour_cielchuv_lf libcolour_cielchuv_lf_t;\fP - \fBtypedef struct libcolour_cielchuv_llf libcolour_cielchuv_llf_t;\fP + typedef struct libcolour_cielchuv_f libcolour_cielchuv_f_t; + typedef struct libcolour_cielchuv_lf libcolour_cielchuv_lf_t; + typedef struct libcolour_cielchuv_llf libcolour_cielchuv_llf_t; .fi These @@ -25,14 +25,14 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_cielchuv_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIL\fP\fB;\fP - \fBfloat\fP \fIC\fP\fB;\fP - \fBfloat\fP \fIh\fP\fB;\fP - \fBstruct libcolour_ciexyz\fP \fIwhite\fP\fB;\fP - \fBdouble\fP \fIone_revolution\fP\fB;\fP - \fB};\fP + struct libcolour_cielchuv_f { + enum libcolour_model \fImodel\fP; + float \fIL\fP; + float \fIC\fP; + float \fIh\fP; + struct libcolour_ciexyz \fIwhite\fP; + double \fIone_revolution\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_CIELUV.7 b/LIBCOLOUR_CIELUV.7 index 24d5d88..607415e 100644 --- a/LIBCOLOUR_CIELUV.7 +++ b/LIBCOLOUR_CIELUV.7 @@ -6,9 +6,9 @@ CIE 1976 (L*, u*, v*) (also known simply as CIE L*u*v*) colours are presented with either of .nf - \fBtypedef struct libcolour_cieluv_f libcolour_cieluv_f_t;\fP - \fBtypedef struct libcolour_cieluv_lf libcolour_cieluv_lf_t;\fP - \fBtypedef struct libcolour_cieluv_llf libcolour_cieluv_llf_t;\fP + typedef struct libcolour_cieluv_f libcolour_cieluv_f_t; + typedef struct libcolour_cieluv_lf libcolour_cieluv_lf_t; + typedef struct libcolour_cieluv_llf libcolour_cieluv_llf_t; .fi These @@ -24,13 +24,13 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_cieluv_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIL\fP\fB;\fP - \fBfloat\fP \fIu\fP\fB;\fP - \fBfloat\fP \fIv\fP\fB;\fP - \fBstruct libcolour_ciexyz\fP \fIwhite\fP\fB;\fP - \fB};\fP + struct libcolour_cieluv_f { + enum libcolour_model \fImodel\fP; + float \fIL\fP; + float \fIu\fP; + float \fIv\fP; + struct libcolour_ciexyz \fIwhite\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_CIEUVW.7 b/LIBCOLOUR_CIEUVW.7 index 6cb42af..1b07f61 100644 --- a/LIBCOLOUR_CIEUVW.7 +++ b/LIBCOLOUR_CIEUVW.7 @@ -6,9 +6,9 @@ CIE 1964 (U*, V*, W*) (also known simply as CIE UVW) colours are presented with either of .nf - \fBtypedef struct libcolour_cieuvw_f libcolour_cieuvw_f_t;\fP - \fBtypedef struct libcolour_cieuvw_lf libcolour_cieuvw_lf_t;\fP - \fBtypedef struct libcolour_cieuvw_llf libcolour_cieuvw_llf_t;\fP + typedef struct libcolour_cieuvw_f libcolour_cieuvw_f_t; + typedef struct libcolour_cieuvw_lf libcolour_cieuvw_lf_t; + typedef struct libcolour_cieuvw_llf libcolour_cieuvw_llf_t; .fi These @@ -24,14 +24,14 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_cieuvw_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIU\fP\fB;\fP - \fBfloat\fP \fIV\fP\fB;\fP - \fBfloat\fP \fIW\fP\fB;\fP - \fBfloat\fP \fIu0\fP\fB;\fP - \fBfloat\fP \fIv0\fP\fB;\fP - \fB};\fP + struct libcolour_cieuvw_f { + enum libcolour_model \fImodel\fP; + float \fIU\fP; + float \fIV\fP; + float \fIW\fP; + float \fIu0\fP; + float \fIv0\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_CIEXYY.7 b/LIBCOLOUR_CIEXYY.7 index 989b170..1e039f8 100644 --- a/LIBCOLOUR_CIEXYY.7 +++ b/LIBCOLOUR_CIEXYY.7 @@ -5,9 +5,9 @@ LIBCOLOUR_CIEXYY - CIE xyY CIE xyY colours are presented with either of .nf - \fBtypedef struct libcolour_ciexyy_f libcolour_ciexyy_f_t;\fP - \fBtypedef struct libcolour_ciexyy_lf libcolour_ciexyy_lf_t;\fP - \fBtypedef struct libcolour_ciexyy_llf libcolour_ciexyy_llf_t;\fP + typedef struct libcolour_ciexyy_f libcolour_ciexyy_f_t; + typedef struct libcolour_ciexyy_lf libcolour_ciexyy_lf_t; + typedef struct libcolour_ciexyy_llf libcolour_ciexyy_llf_t; .fi These @@ -23,12 +23,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_ciexyy_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIx\fP\fB;\fP - \fBfloat\fP \fIy\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fB};\fP + struct libcolour_ciexyy_f { + enum libcolour_model \fImodel\fP; + float \fIx\fP; + float \fIy\fP; + float \fIY\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_CIEXYZ.7 b/LIBCOLOUR_CIEXYZ.7 index cb5cd31..0b06ea0 100644 --- a/LIBCOLOUR_CIEXYZ.7 +++ b/LIBCOLOUR_CIEXYZ.7 @@ -6,9 +6,9 @@ CIE 1931 XYZ (also known simply as CIE XYZ) colours are presented with either of .nf - \fBtypedef struct libcolour_ciexyz_f libcolour_ciexyz_f_t;\fP - \fBtypedef struct libcolour_ciexyz_lf libcolour_ciexyz_lf_t;\fP - \fBtypedef struct libcolour_ciexyz_llf libcolour_ciexyz_llf_t;\fP + typedef struct libcolour_ciexyz_f libcolour_ciexyz_f_t; + typedef struct libcolour_ciexyz_lf libcolour_ciexyz_lf_t; + typedef struct libcolour_ciexyz_llf libcolour_ciexyz_llf_t; .fi These @@ -24,12 +24,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_ciexyz_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIX\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fBfloat\fP \fIZ\fP\fB;\fP - \fB};\fP + struct libcolour_ciexyz_f { + enum libcolour_model \fImodel\fP; + float \fIX\fP; + float \fIY\fP; + float \fIZ\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_RGB.7 b/LIBCOLOUR_RGB.7 index af49fe2..eb26b4a 100644 --- a/LIBCOLOUR_RGB.7 +++ b/LIBCOLOUR_RGB.7 @@ -5,9 +5,9 @@ LIBCOLOUR_RGB - Generic RGB Generic RGB colours are presented with either of .nf - \fBtypedef struct libcolour_rgb_f libcolour_rgb_f_t;\fP - \fBtypedef struct libcolour_rgb_lf libcolour_rgb_lf_t;\fP - \fBtypedef struct libcolour_rgb_llf libcolour_rgb_llf_t;\fP + typedef struct libcolour_rgb_f libcolour_rgb_f_t; + typedef struct libcolour_rgb_lf libcolour_rgb_lf_t; + typedef struct libcolour_rgb_llf libcolour_rgb_llf_t; .fi These @@ -23,44 +23,44 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_rgb_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIR\fP\fB;\fP - \fBfloat\fP \fIG\fP\fB;\fP - \fBfloat\fP \fIB\fP\fB;\fP - \fBint\fP \fIwith_transfer\fP\fB;\fP - \fBenum libcolour_encoding_type\fP \fIencoding_type\fP\fB;\fP - \fBunion {\fP - \fBstruct {\fP - \fBfloat\fP \fIgamma\fP\fB;\fP - \fB}\fP \fIsimple\fB;\fP - \fBstruct {\fP - \fBfloat\fP \fIgamma\fP\fB;\fP - \fBfloat\fP \fIoffset\fP\fB;\fP - \fBfloat\fP \fIslope\fP\fB;\fP - \fBfloat\fP \fItransition\fP\fB;\fP - \fBfloat\fP \fItransitioninv\fP\fB;\fP - \fB}\fP \fIregular\fB;\fP - \fBstruct {\fP - \fBfloat (*\fP\fIto_encoded_red\fP\fB)(float);\fP - \fBfloat (*\fP\fIto_decoded_red\fP\fB)(float);\fP - \fBfloat (*\fP\fIto_encoded_green\fP\fB)(float);\fP - \fBfloat (*\fP\fIto_decoded_green\fP\fB)(float);\fP - \fBfloat (*\fP\fIto_encoded_blue\fP\fB)(float);\fP - \fBfloat (*\fP\fIto_decoded_blue\fP\fB)(float);\fP - \fB}\fP \fIcustom\fB;\fP - \fB}\fP \fItransfer\fB;\fP - \fBstruct libcolour_ciexyy\fP \fIred\fP\fB;\fP - \fBstruct libcolour_ciexyy\fP \fIgreen\fP\fB;\fP - \fBstruct libcolour_ciexyy\fP \fIblue\fP\fB;\fP - \fBstruct libcolour_ciexyy\fP \fIwhite\fP\fB;\fP - \fBfloat\fP \fIwhite_r\fP\fB;\fP - \fBfloat\fP \fIwhite_g\fP\fB;\fP - \fBfloat\fP \fIwhite_b\fP\fB;\fP - \fBfloat\fP \fIM\fP\fB[3][3];\fP - \fBfloat\fP \fIMinv\fP\fB[3][3];\fP - \fBenum libcolour_rgb_colour_space\fP \fIcolour_space\fP\fB;\fP - \fB};\fP + struct libcolour_rgb_f { + enum libcolour_model \fImodel\fP; + float \fIR\fP; + float \fIG\fP; + float \fIB\fP; + int \fIwith_transfer\fP; + enum libcolour_encoding_type \fIencoding_type\fP; + union { + struct { + float \fIgamma\fP; + } \fIsimple\fP; + struct { + float \fIgamma\fP; + float \fIoffset\fP; + float \fIslope\fP; + float \fItransition\fP; + float \fItransitioninv\fP; + } \fIregular\fP; + struct { + float (*\fIto_encoded_red\fP)(float); + float (*\fIto_decoded_red\fP)(float); + float (*\fIto_encoded_green\fP)(float); + float (*\fIto_decoded_green\fP)(float); + float (*\fIto_encoded_blue\fP)(float); + float (*\fIto_decoded_blue\fP)(float); + } \fIcustom\fP; + } \fItransfer\fP; + struct libcolour_ciexyy \fIred\fP; + struct libcolour_ciexyy \fIgreen\fP; + struct libcolour_ciexyy \fIblue\fP; + struct libcolour_ciexyy \fIwhite\fP; + float \fIwhite_r\fP; + float \fIwhite_g\fP; + float \fIwhite_b\fP; + float \fIM\fP[3][3]; + float \fIMinv\fP[3][3]; + enum libcolour_rgb_colour_space \fIcolour_space\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_SRGB.7 b/LIBCOLOUR_SRGB.7 index f5bff7b..e6f7888 100644 --- a/LIBCOLOUR_SRGB.7 +++ b/LIBCOLOUR_SRGB.7 @@ -5,9 +5,9 @@ LIBCOLOUR_SRGB - Standard RGB sRGB colours are presented with either of .nf - \fBtypedef struct libcolour_srgb_f libcolour_srgb_f_t;\fP - \fBtypedef struct libcolour_srgb_lf libcolour_srgb_lf_t;\fP - \fBtypedef struct libcolour_srgb_llf libcolour_srgb_llf_t;\fP + typedef struct libcolour_srgb_f libcolour_srgb_f_t; + typedef struct libcolour_srgb_lf libcolour_srgb_lf_t; + typedef struct libcolour_srgb_llf libcolour_srgb_llf_t; .fi These @@ -23,13 +23,13 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_srgb_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIR\fP\fB;\fP - \fBfloat\fP \fIG\fP\fB;\fP - \fBfloat\fP \fIB\fP\fB;\fP - \fBint\fP \fIwith_transfer\fP\fB;\fP - \fB};\fP + struct libcolour_srgb_f { + enum libcolour_model \fImodel\fP; + float \fIR\fP; + float \fIG\fP; + float \fIB\fP; + int \fIwith_transfer\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_YCGCO.7 b/LIBCOLOUR_YCGCO.7 index 095cb0a..2d4ffbd 100644 --- a/LIBCOLOUR_YCGCO.7 +++ b/LIBCOLOUR_YCGCO.7 @@ -5,9 +5,9 @@ LIBCOLOUR_YCGCO - YCgCo YCgCo colours are presented with either of .nf - \fBtypedef struct libcolour_ycgco_f libcolour_ycgco_f_t;\fP - \fBtypedef struct libcolour_ycgco_lf libcolour_ycgco_lf_t;\fP - \fBtypedef struct libcolour_ycgco_llf libcolour_ycgco_llf_t;\fP + typedef struct libcolour_ycgco_f libcolour_ycgco_f_t; + typedef struct libcolour_ycgco_lf libcolour_ycgco_lf_t; + typedef struct libcolour_ycgco_llf libcolour_ycgco_llf_t; .fi These @@ -23,12 +23,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_ycgco_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fBfloat\fP \fICg\fP\fB;\fP - \fBfloat\fP \fICo\fP\fB;\fP - \fB};\fP + struct libcolour_ycgco_f { + enum libcolour_model \fImodel\fP; + float \fIY\fP; + float \fICg\fP; + float \fICo\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_YDBDR.7 b/LIBCOLOUR_YDBDR.7 index 6281813..a62e46a 100644 --- a/LIBCOLOUR_YDBDR.7 +++ b/LIBCOLOUR_YDBDR.7 @@ -5,9 +5,9 @@ LIBCOLOUR_YDBDR - YDbDr YDbDr colours are presented with either of .nf - \fBtypedef struct libcolour_ydbdr_f libcolour_ydbdr_f_t;\fP - \fBtypedef struct libcolour_ydbdr_lf libcolour_ydbdr_lf_t;\fP - \fBtypedef struct libcolour_ydbdr_llf libcolour_ydbdr_llf_t;\fP + typedef struct libcolour_ydbdr_f libcolour_ydbdr_f_t; + typedef struct libcolour_ydbdr_lf libcolour_ydbdr_lf_t; + typedef struct libcolour_ydbdr_llf libcolour_ydbdr_llf_t; .fi These @@ -23,12 +23,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_ydbdr_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fBfloat\fP \fIDb\fP\fB;\fP - \fBfloat\fP \fIDr\fP\fB;\fP - \fB};\fP + struct libcolour_ydbdr_f { + enum libcolour_model \fImodel\fP; + float \fIY\fP; + float \fIDb\fP; + float \fIDr\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_YIQ.7 b/LIBCOLOUR_YIQ.7 index e618217..bf06eca 100644 --- a/LIBCOLOUR_YIQ.7 +++ b/LIBCOLOUR_YIQ.7 @@ -5,9 +5,9 @@ LIBCOLOUR_YIQ - YIQ YIQ colours are presented with either of .nf - \fBtypedef struct libcolour_yiq_f libcolour_yiq_f_t;\fP - \fBtypedef struct libcolour_yiq_lf libcolour_yiq_lf_t;\fP - \fBtypedef struct libcolour_yiq_llf libcolour_yiq_llf_t;\fP + typedef struct libcolour_yiq_f libcolour_yiq_f_t; + typedef struct libcolour_yiq_lf libcolour_yiq_lf_t; + typedef struct libcolour_yiq_llf libcolour_yiq_llf_t; .fi These @@ -23,12 +23,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_yiq_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fBfloat\fP \fII\fP\fB;\fP - \fBfloat\fP \fIQ\fP\fB;\fP - \fB};\fP + struct libcolour_yiq_f { + enum libcolour_model \fImodel\fP; + float \fIY\fP; + float \fII\fP; + float \fIQ\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_YPBPR.7 b/LIBCOLOUR_YPBPR.7 index 380e1e4..5a04c4b 100644 --- a/LIBCOLOUR_YPBPR.7 +++ b/LIBCOLOUR_YPBPR.7 @@ -6,9 +6,9 @@ YPbPr [the \(aqb\(a and the \(aqr\(aq should be in subscript and capitalised] colours are presented with either of .nf - \fBtypedef struct libcolour_ypbpr_f libcolour_ypbpr_f_t;\fP - \fBtypedef struct libcolour_ypbpr_lf libcolour_ypbpr_lf_t;\fP - \fBtypedef struct libcolour_ypbpr_llf libcolour_ypbpr_llf_t;\fP + typedef struct libcolour_ypbpr_f libcolour_ypbpr_f_t; + typedef struct libcolour_ypbpr_lf libcolour_ypbpr_lf_t; + typedef struct libcolour_ypbpr_llf libcolour_ypbpr_llf_t; .fi These @@ -24,12 +24,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_ypbpr_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fBfloat\fP \fIPb\fP\fB;\fP - \fBfloat\fP \fIPr\fP\fB;\fP - \fB};\fP + struct libcolour_ypbpr_f { + enum libcolour_model \fImodel\fP; + float \fIY\fP; + float \fIPb\fP; + float \fIPr\fP; + }; .fi .I .model diff --git a/LIBCOLOUR_YUV.7 b/LIBCOLOUR_YUV.7 index 784a60b..d9580ae 100644 --- a/LIBCOLOUR_YUV.7 +++ b/LIBCOLOUR_YUV.7 @@ -5,9 +5,9 @@ LIBCOLOUR_YUV - YUV YUV colours are presented with either of .nf - \fBtypedef struct libcolour_yuv_f libcolour_yuv_f_t;\fP - \fBtypedef struct libcolour_yuv_lf libcolour_yuv_lf_t;\fP - \fBtypedef struct libcolour_yuv_llf libcolour_yuv_llf_t;\fP + typedef struct libcolour_yuv_f libcolour_yuv_f_t; + typedef struct libcolour_yuv_lf libcolour_yuv_lf_t; + typedef struct libcolour_yuv_llf libcolour_yuv_llf_t; .fi These @@ -23,12 +23,12 @@ and are otherwise identical. is defined as .nf - \fBstruct libcolour_yuv_f {\fP - \fBenum libcolour_model\fP \fImodel\fP\fB;\fP - \fBfloat\fP \fIY\fP\fB;\fP - \fBfloat\fP \fIU\fP\fB;\fP - \fBfloat\fP \fIV\fP\fB;\fP - \fB};\fP + struct libcolour_yuv_f { + enum libcolour_model \fImodel\fP; + float \fIY\fP; + float \fIU\fP; + float \fIV\fP; + }; .fi .I .model diff --git a/libcolour.7.in b/libcolour.7.in index d842151..2e0d385 100644 --- a/libcolour.7.in +++ b/libcolour.7.in @@ -373,7 +373,7 @@ Apply the sRGB transfer function. Unapply the sRGB transfer function. .TP .BR libcolour_delta_e (3) -Calculate delta E*_ab distance. +Calculate the delta E*_ab distance. .TP .BR libcolour_proper (3) Sets any member or submember that may diff --git a/libcolour_delta_e.3 b/libcolour_delta_e.3 new file mode 100644 index 0000000..84e9d7c --- /dev/null +++ b/libcolour_delta_e.3 @@ -0,0 +1,42 @@ +.TH LIBCOLOUR_DELTA_E 3 libcolour +.SH NAME +libcolour_delta_e - Calculate the delta E*_ab distance +.SH SYNOPSIS +.nf +#include + +int \fBlibcolour_delta_e_f\fP(const libcolour_colour_f_t *\fIa\fP, + const libcolour_colour_f_t *\fIb\fP, float *\fIresult\fP); +int \fBlibcolour_delta_e_lf\fP(const libcolour_colour_lf_t *\fIa\fP, + const libcolour_colour_lf_t *\fIb\fP, double *\fIresult\fP); +int \fBlibcolour_delta_e_llf\fP(const libcolour_colour_llf_t *\fIa\fP, + const libcolour_colour_llf_t *\fIb\fP, long double *\fIresult\fP); + +#define \fBlibcolour_delta_e\fP(\fIa\fP, \fIb\fP, \fIresult\fP)\\ + (_Generic((\fIa\fP),\\ + const libcolour_colour_f_t *: \fBlibcolour_delta_e_f\fP(\fIa\fP, \fIb\fP, \fIresult\fP),\\ + const libcolour_colour_lf_t *: \fBlibcolour_delta_e_lf\fP(\fIa\fP, \fIb\fP, \fIresult\fP),\\ + const libcolour_colour_llf_t *: \fBlibcolour_delta_e_llf\fP(\fIa\fP, \fIb\fP, \fIresult\fP))) +.fi +.SH DESCRIPTION +.B libcolour_delta_e +and its non-generic functions calculate the delta E*_ab +.RB [ _ +denotes that the following characters shall be subscripted] +(the distance in CIE L*a*b*) of two colours, and stores the +distance in +.IR *result . +.SH RETURN VALUES +Upon successful completion, the functions returns 0. +Otherwise the function return -1 with +.I errno +set to indicate the error. +.SH ERRORS +These functions fail if and only if +.BR libcolour_convert (3) +fails. +.SH SEE ALSO +.BR libcolour (7) +.SH AUTHORS +Mattias Andrée +.RI < maandree@kth.se > diff --git a/libcolour_srgb_decode.3 b/libcolour_srgb_decode.3 new file mode 100644 index 0000000..a04ee99 --- /dev/null +++ b/libcolour_srgb_decode.3 @@ -0,0 +1,35 @@ +.TH LIBCOLOUR_SRGB_DECODE 3 libcolour +.SH NAME +libcolour_srgb_decode - Unapply the sRGB transfer function +.SH SYNOPSIS +.nf +#include + +float \fBlibcolour_srgb_decode_f\fP(float \fIvalue\fP); +double \fBlibcolour_srgb_decode_lf\fP(double \fIvalue\fP); +long double \fBlibcolour_srgb_decode_llf\fP(long double \fIvalue\fP); + +#define \fBlibcolour_srgb_decode\fP(\fIvalue\fP)\\ + (_Generic((\fIvalue\fP),\\ + float: \fBlibcolour_srgb_decode_f\fP(\fIvalue\fP),\\ + double: \fBlibcolour_srgb_decode_lf\fP(\fIvalue\fP),\\ + long double: \fBlibcolour_srgb_decode_llf\fP(\fIvalue\fP))) +.fi +.SH DESCRIPTION +.B libcolour_srgb_decode +and its non-generic functions unapply the sRGB transfer +function to a +.IR value . +If +.I value +is negative, the transfer function is unapplied to the +absolute value of +.I value +and the negative of the result is returned. +.SH SEE ALSO +.BR libcolour (7), +.BR libcolour_srgb_encode (3), +.BR LIBCOLOUR_SRGB (7) +.SH AUTHORS +Mattias Andrée +.RI < maandree@kth.se > diff --git a/libcolour_srgb_encode.3 b/libcolour_srgb_encode.3 new file mode 100644 index 0000000..37b7585 --- /dev/null +++ b/libcolour_srgb_encode.3 @@ -0,0 +1,35 @@ +.TH LIBCOLOUR_SRGB_ENCODE 3 libcolour +.SH NAME +libcolour_srgb_encode - Apply the sRGB transfer function +.SH SYNOPSIS +.nf +#include + +float \fBlibcolour_srgb_encode_f\fP(float \fIvalue\fP); +double \fBlibcolour_srgb_encode_lf\fP(double \fIvalue\fP); +long double \fBlibcolour_srgb_encode_llf\fP(long double \fIvalue\fP); + +#define \fBlibcolour_srgb_encode\fP(\fIvalue\fP)\\ + (_Generic((\fIvalue\fP),\\ + float: \fBlibcolour_srgb_encode_f\fP(\fIvalue\fP),\\ + double: \fBlibcolour_srgb_encode_lf\fP(\fIvalue\fP),\\ + long double: \fBlibcolour_srgb_encode_llf\fP(\fIvalue\fP))) +.fi +.SH DESCRIPTION +.B libcolour_srgb_encode +and its non-generic functions apply the sRGB transfer +function to a +.IR value . +If +.I value +is negative, the transfer function is applied to the +absolute value of +.I value +and the negative of the result is returned. +.SH SEE ALSO +.BR libcolour (7), +.BR libcolour_srgb_decode (3), +.BR LIBCOLOUR_SRGB (7) +.SH AUTHORS +Mattias Andrée +.RI < maandree@kth.se > -- cgit v1.2.3-70-g09d2