aboutsummaryrefslogtreecommitdiffstats
path: root/libcolour.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-06-09 23:08:39 +0200
committerMattias Andrée <maandree@kth.se>2017-06-09 23:08:39 +0200
commit96a7efc1df64b23697f9d5ae398604bf1471a56f (patch)
tree0a162c2a5aebb2167d91943cfc5cc640a96b5083 /libcolour.h
parentAdd man pages for most colour models (diff)
downloadlibcolour-96a7efc1df64b23697f9d5ae398604bf1471a56f.tar.gz
libcolour-96a7efc1df64b23697f9d5ae398604bf1471a56f.tar.bz2
libcolour-96a7efc1df64b23697f9d5ae398604bf1471a56f.tar.xz
Reduce size of RGB struct, and add LIBCOLOUR_CIELCHUV.7 and LIBCOLOUR_RGB.7
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libcolour.h')
-rw-r--r--libcolour.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/libcolour.h b/libcolour.h
index 63d37a1..e685d8f 100644
--- a/libcolour.h
+++ b/libcolour.h
@@ -396,17 +396,26 @@ typedef struct libcolour_rgb_##RES {\
TYPE B;\
int with_transfer;\
enum libcolour_encoding_type encoding_type;\
- TYPE gamma;\
- TYPE offset;\
- TYPE slope;\
- TYPE transition;\
- TYPE transitioninv;\
- TYPE (*to_encoded_red)(TYPE);\
- TYPE (*to_decoded_red)(TYPE);\
- TYPE (*to_encoded_green)(TYPE);\
- TYPE (*to_decoded_green)(TYPE);\
- TYPE (*to_encoded_blue)(TYPE);\
- TYPE (*to_decoded_blue)(TYPE);\
+ union {\
+ struct {\
+ TYPE gamma;\
+ } simple;\
+ struct {\
+ TYPE gamma;\
+ TYPE offset;\
+ TYPE slope;\
+ TYPE transition;\
+ TYPE transitioninv;\
+ } regular;\
+ struct {\
+ TYPE (*to_encoded_red)(TYPE);\
+ TYPE (*to_decoded_red)(TYPE);\
+ TYPE (*to_encoded_green)(TYPE);\
+ TYPE (*to_decoded_green)(TYPE);\
+ TYPE (*to_encoded_blue)(TYPE);\
+ TYPE (*to_decoded_blue)(TYPE);\
+ } custom;\
+ } transfer;\
struct libcolour_ciexyy_##RES red;\
struct libcolour_ciexyy_##RES green;\
struct libcolour_ciexyy_##RES blue;\