From 6469bcb86799d01f2c8ff339b7620eda3c233b77 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 6 Jun 2017 20:00:17 +0200 Subject: Add libcolour.7 and macros for testing existance of definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .gitignore | 1 + Makefile | 75 ++++++++++- README | 249 +++++++++++++++++++++++++++++++++++- libcolour.7.in | 397 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ libcolour.h | 55 ++++++++ 5 files changed, 771 insertions(+), 6 deletions(-) create mode 100644 libcolour.7.in diff --git a/.gitignore b/.gitignore index 2a188aa..f0c9d82 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ *.so *.a /test +/libcolour.7 diff --git a/Makefile b/Makefile index bde589b..4ab5b6b 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,39 @@ TEMPLATES =\ convert-template.c\ libcolour-template.c - -all: libcolour.a libcolour.so.$(SO_VERSION) test +MAN7 =\ + libcolour.7 + +MAN3 = + +MAN3_SYMLINKS =\ + libcolour_convert_f.3\ + libcolour_convert_lf.3\ + libcolour_convert_llf.3\ + libcolour_srgb_encode_f.3\ + libcolour_srgb_encode_lf.3\ + libcolour_srgb_encode_llf.3\ + libcolour_srgb_decode_f.3\ + libcolour_srgb_decode_lf.3\ + libcolour_srgb_decode_llf.3\ + libcolour_delta_e_f.3\ + libcolour_delta_e_lf.3\ + libcolour_delta_e_llf.3\ + libcolour_proper_f.3\ + libcolour_proper_lf.3\ + libcolour_proper_llf.3\ + libcolour_get_rgb_colour_space_f.3\ + libcolour_get_rgb_colour_space_lf.3\ + libcolour_get_rgb_colour_space_llf.3\ + libcolour_marshal_f.3\ + libcolour_marshal_lf.3\ + libcolour_marshal_llf.3\ + libcolour_unmarshal_f.3\ + libcolour_unmarshal_lf.3\ + libcolour_unmarshal_llf.3 + + +all: libcolour.a libcolour.so.$(SO_VERSION) libcolour.7 test float.o: float.c $(TEMPLATES) $(HDR) @@ -56,17 +87,51 @@ test: test.o libcolour.a $(CC) -o $@ $^ $(LDFLAGS) -install: +libcolour.7: libcolour.7.in + sed 's:/usr/local:$(PREFIX):g' < libcolour.7.in > libcolour.7 + + +install: libcolour.a libcolour.so.$(SO_VERSION) libcolour.7 mkdir -p -- "$(DESTDIR)$(PREFIX)/include" - mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" cp -- libcolour.h "$(DESTDIR)$(PREFIX)/include/libcolour.h" chmod -- 644 "$(DESTDIR)$(PREFIX)/include/libcolour.h" + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" cp -- libcolour.a "$(DESTDIR)$(PREFIX)/lib/libcolour.a" chmod -- 644 "$(DESTDIR)$(PREFIX)/lib/libcolour.a" cp -- libcolour.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/libcolour.so.$(SO_VERSION)" chmod -- 755 "$(DESTDIR)$(PREFIX)/lib/libcolour.so.$(SO_VERSION)" ln -sf -- libcolour.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/libcolour.so.$(VERSION_MAJOR)" ln -sf -- libcolour.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/libcolour.so" + mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man7" + cp -- $(MAN7) "$(DESTDIR)$(MANPREFIX)/man7/" + cd -- "$(DESTDIR)$(MANPREFIX)/man7" && chmod -- 644 $(MAN7) + mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man3" + cp -- $(MAN3) "$(DESTDIR)$(MANPREFIX)/man3/" + cd -- "$(DESTDIR)$(MANPREFIX)/man3" && chmod -- 644 $(MAN3) + ln -sf -- libcolour_convert.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_convert_f.3" + ln -sf -- libcolour_convert.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_convert_lf.3" + ln -sf -- libcolour_convert.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_convert_llf.3" + ln -sf -- libcolour_srgb_encode.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_srgb_encode_f.3" + ln -sf -- libcolour_srgb_encode.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_srgb_encode_lf.3" + ln -sf -- libcolour_srgb_encode.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_srgb_encode_llf.3" + ln -sf -- libcolour_srgb_decode.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_srgb_decode_f.3" + ln -sf -- libcolour_srgb_decode.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_srgb_decode_lf.3" + ln -sf -- libcolour_srgb_decode.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_srgb_decode_llf.3" + ln -sf -- libcolour_delta_e.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_delta_e_f.3" + ln -sf -- libcolour_delta_e.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_delta_e_lf.3" + ln -sf -- libcolour_delta_e.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_delta_e_llf.3" + ln -sf -- libcolour_proper.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_proper_f.3" + ln -sf -- libcolour_proper.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_proper_lf.3" + ln -sf -- libcolour_proper.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_proper_llf.3" + ln -sf -- libcolour_get_rgb_colour_space.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_get_rgb_colour_space_f.3" + ln -sf -- libcolour_get_rgb_colour_space.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_get_rgb_colour_space_lf.3" + ln -sf -- libcolour_get_rgb_colour_space.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_get_rgb_colour_space_llf.3" + ln -sf -- libcolour_marshal.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_marshal_f.3" + ln -sf -- libcolour_marshal.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_marshal_lf.3" + ln -sf -- libcolour_marshal.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_marshal_llf.3" + ln -sf -- libcolour_unmarshal.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_unmarshal_f.3" + ln -sf -- libcolour_unmarshal.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_unmarshal_lf.3" + ln -sf -- libcolour_unmarshal.3 "$(DESTDIR)$(MANPREFIX)/man3/libcolour_unmarshal_llf.3" uninstall: @@ -75,6 +140,8 @@ uninstall: -rm -- "$(DESTDIR)$(PREFIX)/lib/libcolour.so.$(SO_VERSION)" -rm -- "$(DESTDIR)$(PREFIX)/lib/libcolour.so.$(VERSION_MAJOR)" -rm -- "$(DESTDIR)$(PREFIX)/lib/libcolour.so" + -cd -- "$(DESTDIR)$(MANPREFIX)/man7" && rm -- $(MAN7) + -cd -- "$(DESTDIR)$(MANPREFIX)/man3" && rm -- $(MAN3) $(MAN3_SYMLINKS) check: test diff --git a/README b/README index b3ae8d6..16c1af3 100644 --- a/README +++ b/README @@ -3,7 +3,252 @@ NAME DESCRIPTION libcolour is C library for colour space conversions. + libcolour provides conversion between a large number of colour + spaces, including many different RGB colour spaces. It also + supports encode and non-encoded representations. libcolour + futhermore provides access to custom RGB colour spaces. -SEE ALSO - libclut(7) + To use libcolour, include the header file and + link with /usr/local/lib/libcolour.a -lm or -lcolour. +COLOUR MODELS + libcolour supports a number of colour models. A colour model + is specified with a value of + + typedef enum libcolour_model libcolour_model_t; + + The colour models can listed using the macros + + LIBCOLOUR_LIST_MODELS(IMACRO, TYPE_AFFIX) + + or + + LIBCOLOUR_LIST_MODELS_N(MACRO, TYPE_AFFIX, ...) + + where MACRO is the macro that shall be expanded, and + TYPE_AFFIX shall be f, lf, or llf for float-typed, + double-typed, and long double-typed colour module stuctures, + respectively. LIBCOLOUR_LIST_MODELS expands MACRO with three + parameters: enum libcolour_model value of the colour model, + typedef-name of struct used to store colours of the colour + model, and the name of the member in union libcolour_colour_f, + union libcolour_colour_lf, and union libcolour_colour_llf that + is used to store a colour with the colour model. + LIBCOLOUR_LIST_MODELS_N is identical to LIBCOLOUR_LIST_MODELS + except allows the programmer to specify additional parameters + to pass MACRO when it is expanded. + + There there are three structs defined for each colour model, + the first member in each struct is + + enum libcolour_model model; + + The three structs for each colour model are for different data + types: float, double, and long double. For example, for sRGB, + the follow structs are defined: + + 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; + + for float, double, and long double, respectively. Similarly, + + typedef union libcolour_colour_f libcolour_colour_f_t; + typedef union libcolour_colour_lf libcolour_colour_lf_t; + typedef union libcolour_colour_llf libcolour_colour_llf_t; + + are used for float, double, long double, respectively, and all + have the member + + enum libcolour_model model; + + The structs are not padded to be of the same size. + + defines structs the following for colour models: + + Generic RGB + See LIBCOLOUR_RGB(7). + + Standard RGB + See LIBCOLOUR_SRGB(7). + + CIE xyY + See LIBCOLOUR_CIEXYY(7). + + CIE 1931 XYZ + See LIBCOLOUR_CIEXYZ(7). + + CIE L*a*b* + See LIBCOLOUR_CIELAB(7). + + CIE 1976 (L*, u*, v*) + See LIBCOLOUR_CIELUV(7). + + CIE LChuv (also known as CIE HLCuv) + See LIBCOLOUR_CIELCHUV(7). + + YIQ + See LIBCOLOUR_YIQ(7). + + YDbDr + See LIBCOLOUR_YDBDR(7). + + YUV + See LIBCOLOUR_YUV(7). + + YPBPR + See LIBCOLOUR_YPBPR(7). + + YCgCo + See LIBCOLOUR_YCGCO(7). + + CIE 1960 UCS + See LIBCOLOUR_CIE1960UCS(7). + + CIE 1964 (U*, V*, W*) + See LIBCOLOUR_CIEUVW(7). + +ILLUMINANTS + libcolour provides a number of initialiser macros for standard + illuminants. The following macros expand to a + libcolour_ciexyy_f_t with the standard 2 degrees observer + value in CIE xyY, each have a supplementary 10 degrees + observer counterpart using suffix _10DEG_OBS, both with the Y + value set to 1. Additionally, each macro, including the + _10DEG_OBS variants, have a variant that uses the _LF affix + that expands to a libcolour_ciexyy_lf_t and a variant that + uses the _LLF affix that expands to a libcolour_ciexyy_llf_t + in addition to the listed variants that uses the _F affix. + + LIBCOLOUR_ILLUMINANT_A_F + CIE Standard Illuminant A. + Incandescent/Tungsten. + 2855.54K (2848K in old definition of 1K). + + LIBCOLOUR_ILLUMINANT_B_F + CIE Standard Illuminant B. + Direct sunlight at noon (obsolete). + 4874K. + + LIBCOLOUR_ILLUMINANT_C_F + CIE Standard Illuminant C. + Average/north sky daylight (obsolete). + 6774K. + + LIBCOLOUR_ILLUMINANT_D50_F + CIE Standard Illuminant D50. + Horizon Light. + 5002.78K (5000K in old definition of 1K). + + LIBCOLOUR_ILLUMINANT_D55_F + CIE Standard Illuminant D55. + Mid-morning/mid-afternoon daylight. + 5503.06K (5500K in old definition of 1K). + + LIBCOLOUR_ILLUMINANT_D65_F + CIE Standard Illuminant D65. + Noon daylight. + 6503.62K (6500K in old definition of 1K). + + LIBCOLOUR_ILLUMINANT_D75_F + CIE Standard Illuminant D75. + North sky daylight. + 7504.17K (7500K in old definition of 1K). + + LIBCOLOUR_ILLUMINANT_E_F + CIE Standard Illuminant E. + Equal energy. + 5454K. + + LIBCOLOUR_ILLUMINANT_F1_F + CIE Standard Illuminant F1. + Daylight fluorescent. + 6430K. + + LIBCOLOUR_ILLUMINANT_F2_F + CIE Standard Illuminant F2. + Cool white fluorescent. + 4230K. + + LIBCOLOUR_ILLUMINANT_F3_F + CIE Standard Illuminant F3. + White fluorescent. + 3450K. + + LIBCOLOUR_ILLUMINANT_F4_F + CIE Standard Illuminant F4. + Warm white fluorescent. + 2940K. + + LIBCOLOUR_ILLUMINANT_F5_F + CIE Standard Illuminant F5. + Daylight fluorescent. + 6350K. + + LIBCOLOUR_ILLUMINANT_F6_F + CIE Standard Illuminant F6. + Lite white fluorescent. + 4150K. + + LIBCOLOUR_ILLUMINANT_F7_F + CIE Standard Illuminant F7. + D65 simulator, daylight simulator. + 6500K. + + LIBCOLOUR_ILLUMINANT_F8_F + CIE Standard Illuminant F8. + D50 simulator, Sylvania F40 Design 50. + 5000K. + + LIBCOLOUR_ILLUMINANT_F9_F + CIE Standard Illuminant F9. + Cool white deluxe fluorescent. + 4150K. + + LIBCOLOUR_ILLUMINANT_F10_F + CIE Standard Illuminant F10. + Philips TL85, Ultralume 50. + 5000K. + + LIBCOLOUR_ILLUMINANT_F11_F + CIE Standard Illuminant F11. + Philips TL84, Ultralume 40. + 4000K. + + LIBCOLOUR_ILLUMINANT_F12_F + CIE Standard Illuminant F12. + Philips TL83, Ultralume 30. + 3000K. + +FUNCTIONS + libcolour_convert(3) + Colour space and colour model conversion. + + libcolour_srgb_encode(3) + Apply the sRGB transfer function. + + libcolour_srgb_decode(3) + Unapply the sRGB transfer function. + + libcolour_delta_e(3) + Calculate delta E*_ab distance. + + libcolour_proper(3) + Sets any member or submember that may be incorrectly + set. + + libcolour_get_rgb_colour_space(3) + Selects RGB colour space. + + libcolour_marshal(3) + Marshal a colour record. + + libcolour_unmarshal(3) + Unmarshal a colour record. + +NOTES + All enum values have a macro with the same name defined which + can be used to test the existance of value. + +AUTHORS + Mattias Andrée diff --git a/libcolour.7.in b/libcolour.7.in new file mode 100644 index 0000000..d842151 --- /dev/null +++ b/libcolour.7.in @@ -0,0 +1,397 @@ +.TH LIBCOLOUR 7 libcolour +.SH NAME +libcolour - A C colour space library +.SH DESCRIPTION +.B libcolour +is C library for colour space conversions. +.B libcolour +provides conversion between a large number of colour +spaces, including many different RGB colour spaces. +It also supports encode and non-encoded representations. +libcolour futhermore provides access to custom RGB +colour spaces. +.P +To use libcolour, include the header file +.B +and link with +.B /usr/local/lib/libcolour.a -lm +or +.BR -lcolour . +.SH COLOUR MODELS +.B libcolour +supports a number of colour models. A colour model +is specified with a value of +.nf + + \fBtypedef enum libcolour_model libcolour_model_t;\fP + +.fi +The colour models can listed using the macros +.nf + + \fBLIBCOLOUR_LIST_MODELS\fP(\fIMACRO\fP, \fITYPE_AFFIX\fP) + +.fi +or +.nf + + \fBLIBCOLOUR_LIST_MODELS_N\fP(\fIMACRO\fP, \fITYPE_AFFIX\fP, ...) + +.fi +where +.I MACRO +is the macro that shall be expanded, and +.I TYPE_AFFIX +shall be +.BR f , +.BR lf , +or +.BR llf +for +.BR float -typed, +.BR double -typed, +and +.BR long\ double -typed +colour module stuctures, respectively. +.B LIBCOLOUR_LIST_MODELS +expands +.I MACRO +with three parameters: +.B enum libcolour_model +value of the colour model, +.BR typedef -name +of +.B struct +used to store colours of the colour model, +and the name of the member in +.BR union\ libcolour_colour_f , +.BR union\ libcolour_colour_lf , +and +.B union libcolour_colour_llf +that is used to store a colour with the colour model. +.B LIBCOLOUR_LIST_MODELS_N +is identical to +.B LIBCOLOUR_LIST_MODELS +except allows the programmer to specify additional +parameters to pass +.I MACRO +when it is expanded. +.P +There there are three +.BR struct s +defined for each colour model, the first member +in each +.B struct +is +.nf + + \fBenum libcolour_model model;\fP + +.fi +The three +.BR struct s +for each colour model are for different data types: +.BR float , +.BR double , +and +.BR long\ double . +For example, for sRGB, the follow +.BR struct s +are defined: +.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 + +.fi +for +.BR float , +.BR double , +and +.BR long\ double , +respectively. Similarly, +.nf + + \fBtypedef union libcolour_colour_f libcolour_colour_f_t;\fP + \fBtypedef union libcolour_colour_lf libcolour_colour_lf_t;\fP + \fBtypedef union libcolour_colour_llf libcolour_colour_llf_t;\fP + +.fi +are used for +.BR float , +.BR double , +and +.BR long\ double , +respectively, and all have the member +.nf + + \fBenum libcolour_model model;\fP + +.fi +The +.BR struct s +are +.I not +padded to be of the same size. +.P +.B +defines +.BR struct s +the following for colour models: +.P +.TP +Generic RGB +See +.BR LIBCOLOUR_RGB (7). +.TP +Standard RGB +See +.BR LIBCOLOUR_SRGB (7). +.TP +CIE xyY +See +.BR LIBCOLOUR_CIEXYY (7). +.TP +CIE 1931 XYZ +See +.BR LIBCOLOUR_CIEXYZ (7). +.TP +CIE L*a*b* +See +.BR LIBCOLOUR_CIELAB (7). +.TP +CIE 1976 (L*, u*, v*) +See +.BR LIBCOLOUR_CIELUV (7). +.TP +CIE LChuv (also known as CIE HLCuv) +See +.BR LIBCOLOUR_CIELCHUV (7). +.TP +YIQ +See +.BR LIBCOLOUR_YIQ (7). +.TP +YDbDr +See +.BR LIBCOLOUR_YDBDR (7). +.TP +YUV +See +.BR LIBCOLOUR_YUV (7). +.TP +YPBPR +See +.BR LIBCOLOUR_YPBPR (7). +.TP +YCgCo +See +.BR LIBCOLOUR_YCGCO (7). +.TP +CIE 1960 UCS +See +.BR LIBCOLOUR_CIE1960UCS (7). +.TP +CIE 1964 (U*, V*, W*) +See +.BR LIBCOLOUR_CIEUVW (7). +.SH ILLUMINANTS +.B libcolour +provides a number of initialiser macros for standard +illuminants. The following macros expand to a +.B libcolour_ciexyy_f_t +with the standard 2 degrees observer value in CIE +xyY, each have a supplementary 10 degrees observer +counterpart using suffix +.BR _10DEG_OBS , +both with the Y value set to 1. Additionally, each +macro, including the +.B _10DEG_OBS +variants, have a variant that uses the +.B _LF +affix that expands to a +.B libcolour_ciexyy_lf_t +and a variant that uses the +.B _LLF +affix that expands to a +.B libcolour_ciexyy_llf_t +in addition to the listed variants that uses +the +.B _F +affix. +.P +.TP +.B LIBCOLOUR_ILLUMINANT_A_F +.nf +CIE Standard Illuminant A. +Incandescent/Tungsten. +2855.54 Kelvin (2848 Kelvin in old definition of 1 Kelvin). +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_B_F +.nf +CIE Standard Illuminant B. +Direct sunlight at noon (obsolete). +4874 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_C_F +.nf +CIE Standard Illuminant C. +Average/north sky daylight (obsolete). +6774 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_D50_F +.nf +CIE Standard Illuminant D50. +Horizon Light. +5002.78 Kelvin (5000 Kelvin in old definition of 1 Kelvin). +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_D55_F +.nf +CIE Standard Illuminant D55. +Mid-morning/mid-afternoon daylight. +5503.06 Kelvin (5500 Kelvin in old definition of 1 Kelvin). +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_D65_F +.nf +CIE Standard Illuminant D65. +Noon daylight. +6503.62 Kelvin (6500 Kelvin in old definition of 1 Kelvin). +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_D75_F +.nf +CIE Standard Illuminant D75. +North sky daylight. +7504.17 Kelvin (7500 Kelvin in old definition of 1 Kelvin). +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_E_F +.nf +CIE Standard Illuminant E. +Equal energy. +5454 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F1_F +.nf +CIE Standard Illuminant F1. +Daylight fluorescent. +6430 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F2_F +.nf +CIE Standard Illuminant F2. +Cool white fluorescent. +4230 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F3_F +.nf +CIE Standard Illuminant F3. +White fluorescent. +3450 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F4_F +.nf +CIE Standard Illuminant F4. +Warm white fluorescent. +2940 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F5_F +.nf +CIE Standard Illuminant F5. +Daylight fluorescent. +6350 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F6_F +.nf +CIE Standard Illuminant F6. +Lite white fluorescent. +4150 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F7_F +.nf +CIE Standard Illuminant F7. +D65 simulator, daylight simulator. +6500 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F8_F +.nf +CIE Standard Illuminant F8. +D50 simulator, Sylvania F40 Design 50. +5000 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F9_F +.nf +CIE Standard Illuminant F9. +Cool white deluxe fluorescent. +4150 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F10_F +.nf +CIE Standard Illuminant F10. +Philips TL85, Ultralume 50. +5000 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F11_F +.nf +CIE Standard Illuminant F11. +Philips TL84, Ultralume 40. +4000 Kelvin. +.fi +.TP +.B LIBCOLOUR_ILLUMINANT_F12_F +.nf +CIE Standard Illuminant F12. +Philips TL83, Ultralume 30. +3000 Kelvin. +.fi +.SH FUNCTIONS +.TP +.BR libcolour_convert (3) +Colour space and colour model conversion. +.TP +.BR libcolour_srgb_encode (3) +Apply the sRGB transfer function. +.TP +.BR libcolour_srgb_decode (3) +Unapply the sRGB transfer function. +.TP +.BR libcolour_delta_e (3) +Calculate delta E*_ab distance. +.TP +.BR libcolour_proper (3) +Sets any member or submember that may +be incorrectly set. +.TP +.BR libcolour_get_rgb_colour_space (3) +Selects RGB colour space. +.TP +.BR libcolour_marshal (3) +Marshal a colour record. +.TP +.BR libcolour_unmarshal (3) +Unmarshal a colour record. +.SH NOTES +All +.B enum +values have a macro with the same name defined +which can be used to test the existance of value. +.SH AUTHORS +Mattias Andrée +.RI < maandree@kth.se > diff --git a/libcolour.h b/libcolour.h index 4379709..63d37a1 100644 --- a/libcolour.h +++ b/libcolour.h @@ -181,6 +181,22 @@ _(LIBCOLOUR_CIEUVW, libcolour_cieuvw_##RES##_t, cieuvw) +#define LIBCOLOUR_RGB LIBCOLOUR_RGB +#define LIBCOLOUR_SRGB LIBCOLOUR_SRGB +#define LIBCOLOUR_CIEXYY LIBCOLOUR_CIEXYY +#define LIBCOLOUR_CIEXYZ LIBCOLOUR_CIEXYZ +#define LIBCOLOUR_CIELAB LIBCOLOUR_CIELAB +#define LIBCOLOUR_CIELUV LIBCOLOUR_CIELUV +#define LIBCOLOUR_CIELCHUV LIBCOLOUR_CIELCHUV +#define LIBCOLOUR_YIQ LIBCOLOUR_YIQ +#define LIBCOLOUR_YDBDR LIBCOLOUR_YDBDR +#define LIBCOLOUR_YUV LIBCOLOUR_YUV +#define LIBCOLOUR_YPBPR LIBCOLOUR_YPBPR +#define LIBCOLOUR_YCGCO LIBCOLOUR_YCGCO +#define LIBCOLOUR_CIE1960UCS LIBCOLOUR_CIE1960UCS +#define LIBCOLOUR_CIEUVW LIBCOLOUR_CIEUVW + + typedef enum libcolour_model { #define LIBCOLOUR_X(C, T, N) C, LIBCOLOUR_LIST_MODELS(LIBCOLOUR_X,) @@ -190,48 +206,87 @@ typedef enum libcolour_model { typedef enum libcolour_encoding_type { LIBCOLOUR_ENCODING_TYPE_LINEAR, +#define LIBCOLOUR_ENCODING_TYPE_LINEAR LIBCOLOUR_ENCODING_TYPE_LINEAR LIBCOLOUR_ENCODING_TYPE_SIMPLE, +#define LIBCOLOUR_ENCODING_TYPE_SIMPLE LIBCOLOUR_ENCODING_TYPE_SIMPLE LIBCOLOUR_ENCODING_TYPE_REGULAR, +#define LIBCOLOUR_ENCODING_TYPE_REGULAR LIBCOLOUR_ENCODING_TYPE_REGULAR LIBCOLOUR_ENCODING_TYPE_CUSTOM +#define LIBCOLOUR_ENCODING_TYPE_CUSTOM LIBCOLOUR_ENCODING_TYPE_CUSTOM } libcolour_encoding_type_t; typedef enum libcolour_rgb_colour_space { LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_MEASUREMENTS, +#define LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_MEASUREMENTS LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_MEASUREMENTS LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_MATRIX, +#define LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_MATRIX LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_MATRIX LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_INV_MATRIX, +#define LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_INV_MATRIX LIBCOLOUR_RGB_COLOUR_SPACE_CUSTOM_FROM_INV_MATRIX LIBCOLOUR_RGB_COLOUR_SPACE_SRGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_SRGB LIBCOLOUR_RGB_COLOUR_SPACE_SRGB LIBCOLOUR_RGB_COLOUR_SPACE_ADOBE_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ADOBE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_ADOBE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_APPLE_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_APPLE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_APPLE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_BEST_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_BEST_RGB LIBCOLOUR_RGB_COLOUR_SPACE_BEST_RGB LIBCOLOUR_RGB_COLOUR_SPACE_BETA_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_BETA_RGB LIBCOLOUR_RGB_COLOUR_SPACE_BETA_RGB LIBCOLOUR_RGB_COLOUR_SPACE_BRUCE_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_BRUCE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_BRUCE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_CIE_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_CIE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_CIE_RGB LIBCOLOUR_RGB_COLOUR_SPACE_COLORMATCH_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_COLORMATCH_RGB LIBCOLOUR_RGB_COLOUR_SPACE_COLORMATCH_RGB LIBCOLOUR_RGB_COLOUR_SPACE_DCI_P3_D65, +#define LIBCOLOUR_RGB_COLOUR_SPACE_DCI_P3_D65 LIBCOLOUR_RGB_COLOUR_SPACE_DCI_P3_D65 LIBCOLOUR_RGB_COLOUR_SPACE_DCI_P3_THEATER, +#define LIBCOLOUR_RGB_COLOUR_SPACE_DCI_P3_THEATER LIBCOLOUR_RGB_COLOUR_SPACE_DCI_P3_THEATER LIBCOLOUR_RGB_COLOUR_SPACE_DON_RGB_4, +#define LIBCOLOUR_RGB_COLOUR_SPACE_DON_RGB_4 LIBCOLOUR_RGB_COLOUR_SPACE_DON_RGB_4 LIBCOLOUR_RGB_COLOUR_SPACE_ECI_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ECI_RGB LIBCOLOUR_RGB_COLOUR_SPACE_ECI_RGB LIBCOLOUR_RGB_COLOUR_SPACE_ECI_RGB_V2, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ECI_RGB_V2 LIBCOLOUR_RGB_COLOUR_SPACE_ECI_RGB_V2 LIBCOLOUR_RGB_COLOUR_SPACE_EKTA_SPACE_PS5, +#define LIBCOLOUR_RGB_COLOUR_SPACE_EKTA_SPACE_PS5 LIBCOLOUR_RGB_COLOUR_SPACE_EKTA_SPACE_PS5 LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_601_625_LINE, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_601_625_LINE LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_601_625_LINE LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_601_525_LINE, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_601_525_LINE LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_601_525_LINE LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_709, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_709 LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_709 LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2020, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2020 LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2020 LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_EOTF_PQ, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_EOTF_PQ LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_EOTF_PQ LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OOTF_PQ, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OOTF_PQ LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OOTF_PQ LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OETF_PQ, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OETF_PQ LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OETF_PQ LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_EOTF_HLG, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_EOTF_HLG LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_EOTF_HLG LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OOTF_HLG, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OOTF_HLG LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OOTF_HLG LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OETF_HLG, +#define LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OETF_HLG LIBCOLOUR_RGB_COLOUR_SPACE_ITU_R_BT_2100_OETF_HLG LIBCOLOUR_RGB_COLOUR_SPACE_LIGHTROOM_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_LIGHTROOM_RGB LIBCOLOUR_RGB_COLOUR_SPACE_LIGHTROOM_RGB LIBCOLOUR_RGB_COLOUR_SPACE_NTSC_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_NTSC_RGB LIBCOLOUR_RGB_COLOUR_SPACE_NTSC_RGB LIBCOLOUR_RGB_COLOUR_SPACE_PAL_SECAM_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_PAL_SECAM_RGB LIBCOLOUR_RGB_COLOUR_SPACE_PAL_SECAM_RGB LIBCOLOUR_RGB_COLOUR_SPACE_PROPHOTO_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_PROPHOTO_RGB LIBCOLOUR_RGB_COLOUR_SPACE_PROPHOTO_RGB LIBCOLOUR_RGB_COLOUR_SPACE_SGI_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_SGI_RGB LIBCOLOUR_RGB_COLOUR_SPACE_SGI_RGB LIBCOLOUR_RGB_COLOUR_SPACE_SMPTE_240M_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_SMPTE_240M_RGB LIBCOLOUR_RGB_COLOUR_SPACE_SMPTE_240M_RGB LIBCOLOUR_RGB_COLOUR_SPACE_SMPTE_C_RGB, +#define LIBCOLOUR_RGB_COLOUR_SPACE_SMPTE_C_RGB LIBCOLOUR_RGB_COLOUR_SPACE_SMPTE_C_RGB LIBCOLOUR_RGB_COLOUR_SPACE_WIDE_GAMUT_RGB +#define LIBCOLOUR_RGB_COLOUR_SPACE_WIDE_GAMUT_RGB LIBCOLOUR_RGB_COLOUR_SPACE_WIDE_GAMUT_RGB } libcolour_rgb_colour_space_t; -- cgit v1.2.3-70-g09d2