GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_gamma_correction.gen.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.1-or-later
2
/*
3
* gp_gamma_correction.gen.h
4
*
5
* GENERATED on 2025 11 30 21:24:31 from gp_gamma_correction.gen.h.t
6
*
7
* DO NOT MODIFY THIS FILE DIRECTLY!
8
*/
9
#ifndef GP_GAMMA_CORRECTION_GEN_H
10
#define GP_GAMMA_CORRECTION_GEN_H
11
16
/*
17
* Copyright (C) 2012-2024 Cyril Hrubis <metan@ucw.cz>
18
*/
19
35
#define GP_PIXEL_CREATE_RGB101010_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
36
(0\
37
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 20) \
38
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 10) \
39
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
40
)
41
50
#define GP_PIXEL_GET_R_RGB101010_LIN(p, gamma_lin) ( \
51
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB101010(p)] : \
52
GP_PIXEL_GET_R_RGB101010(p) \
53
)
54
61
#define GP_CHAN_TO_LIN_TBL_RGB101010_R(pixmap) \
62
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
63
72
#define GP_CHAN_LIN_MAX_VAL_RGB101010_R(pixmap) \
73
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 4095 : 1023)
74
81
#define GP_CHAN_TO_ENC_TBL_RGB101010_R(pixmap) \
82
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u16 : NULL)
83
93
#define GP_PIXEL_GET_G_RGB101010_LIN(p, gamma_lin) ( \
94
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB101010(p)] : \
95
GP_PIXEL_GET_G_RGB101010(p) \
96
)
97
104
#define GP_CHAN_TO_LIN_TBL_RGB101010_G(pixmap) \
105
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u16 : NULL)
106
115
#define GP_CHAN_LIN_MAX_VAL_RGB101010_G(pixmap) \
116
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 4095 : 1023)
117
124
#define GP_CHAN_TO_ENC_TBL_RGB101010_G(pixmap) \
125
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u16 : NULL)
126
136
#define GP_PIXEL_GET_B_RGB101010_LIN(p, gamma_lin) ( \
137
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB101010(p)] : \
138
GP_PIXEL_GET_B_RGB101010(p) \
139
)
140
147
#define GP_CHAN_TO_LIN_TBL_RGB101010_B(pixmap) \
148
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u16 : NULL)
149
158
#define GP_CHAN_LIN_MAX_VAL_RGB101010_B(pixmap) \
159
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 4095 : 1023)
160
167
#define GP_CHAN_TO_ENC_TBL_RGB101010_B(pixmap) \
168
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u16 : NULL)
169
185
#define GP_PIXEL_CREATE_xRGB8888_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
186
(0\
187
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 16) \
188
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 8) \
189
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
190
)
191
200
#define GP_PIXEL_GET_R_xRGB8888_LIN(p, gamma_lin) ( \
201
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_xRGB8888(p)] : \
202
GP_PIXEL_GET_R_xRGB8888(p) \
203
)
204
211
#define GP_CHAN_TO_LIN_TBL_xRGB8888_R(pixmap) \
212
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
213
222
#define GP_CHAN_LIN_MAX_VAL_xRGB8888_R(pixmap) \
223
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1023 : 255)
224
231
#define GP_CHAN_TO_ENC_TBL_xRGB8888_R(pixmap) \
232
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
233
243
#define GP_PIXEL_GET_G_xRGB8888_LIN(p, gamma_lin) ( \
244
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_xRGB8888(p)] : \
245
GP_PIXEL_GET_G_xRGB8888(p) \
246
)
247
254
#define GP_CHAN_TO_LIN_TBL_xRGB8888_G(pixmap) \
255
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u16 : NULL)
256
265
#define GP_CHAN_LIN_MAX_VAL_xRGB8888_G(pixmap) \
266
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 1023 : 255)
267
274
#define GP_CHAN_TO_ENC_TBL_xRGB8888_G(pixmap) \
275
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
276
286
#define GP_PIXEL_GET_B_xRGB8888_LIN(p, gamma_lin) ( \
287
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_xRGB8888(p)] : \
288
GP_PIXEL_GET_B_xRGB8888(p) \
289
)
290
297
#define GP_CHAN_TO_LIN_TBL_xRGB8888_B(pixmap) \
298
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u16 : NULL)
299
308
#define GP_CHAN_LIN_MAX_VAL_xRGB8888_B(pixmap) \
309
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 1023 : 255)
310
317
#define GP_CHAN_TO_ENC_TBL_xRGB8888_B(pixmap) \
318
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
319
338
#define GP_PIXEL_CREATE_RGBA8888_ENC(R, G, B, A, R_gamma_enc, G_gamma_enc, B_gamma_enc, A_gamma_enc) \
339
(0\
340
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 24) \
341
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 16) \
342
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 8) \
343
+ ((A_gamma_enc ? A_gamma_enc[(A)] : A) << 0) \
344
)
345
354
#define GP_PIXEL_GET_R_RGBA8888_LIN(p, gamma_lin) ( \
355
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGBA8888(p)] : \
356
GP_PIXEL_GET_R_RGBA8888(p) \
357
)
358
365
#define GP_CHAN_TO_LIN_TBL_RGBA8888_R(pixmap) \
366
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
367
376
#define GP_CHAN_LIN_MAX_VAL_RGBA8888_R(pixmap) \
377
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1023 : 255)
378
385
#define GP_CHAN_TO_ENC_TBL_RGBA8888_R(pixmap) \
386
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
387
397
#define GP_PIXEL_GET_G_RGBA8888_LIN(p, gamma_lin) ( \
398
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGBA8888(p)] : \
399
GP_PIXEL_GET_G_RGBA8888(p) \
400
)
401
408
#define GP_CHAN_TO_LIN_TBL_RGBA8888_G(pixmap) \
409
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u16 : NULL)
410
419
#define GP_CHAN_LIN_MAX_VAL_RGBA8888_G(pixmap) \
420
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 1023 : 255)
421
428
#define GP_CHAN_TO_ENC_TBL_RGBA8888_G(pixmap) \
429
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
430
440
#define GP_PIXEL_GET_B_RGBA8888_LIN(p, gamma_lin) ( \
441
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGBA8888(p)] : \
442
GP_PIXEL_GET_B_RGBA8888(p) \
443
)
444
451
#define GP_CHAN_TO_LIN_TBL_RGBA8888_B(pixmap) \
452
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u16 : NULL)
453
462
#define GP_CHAN_LIN_MAX_VAL_RGBA8888_B(pixmap) \
463
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 1023 : 255)
464
471
#define GP_CHAN_TO_ENC_TBL_RGBA8888_B(pixmap) \
472
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
473
483
#define GP_PIXEL_GET_A_RGBA8888_LIN(p, gamma_lin) ( \
484
gamma_lin ? gamma_lin[GP_PIXEL_GET_A_RGBA8888(p)] : \
485
GP_PIXEL_GET_A_RGBA8888(p) \
486
)
487
494
#define GP_CHAN_TO_LIN_TBL_RGBA8888_A(pixmap) \
495
(((pixmap)->gamma && (pixmap)->gamma->lin[3]) ? (pixmap)->gamma->lin[3]->u8 : NULL)
496
505
#define GP_CHAN_LIN_MAX_VAL_RGBA8888_A(pixmap) \
506
(((pixmap)->gamma && (pixmap)->gamma->lin[3]) ? 255 : 255)
507
514
#define GP_CHAN_TO_ENC_TBL_RGBA8888_A(pixmap) \
515
(((pixmap)->gamma && (pixmap)->gamma->enc[3]) ? (pixmap)->gamma->enc[3]->u8 : NULL)
516
532
#define GP_PIXEL_CREATE_RGB888_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
533
(0\
534
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 16) \
535
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 8) \
536
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
537
)
538
547
#define GP_PIXEL_GET_R_RGB888_LIN(p, gamma_lin) ( \
548
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB888(p)] : \
549
GP_PIXEL_GET_R_RGB888(p) \
550
)
551
558
#define GP_CHAN_TO_LIN_TBL_RGB888_R(pixmap) \
559
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
560
569
#define GP_CHAN_LIN_MAX_VAL_RGB888_R(pixmap) \
570
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1023 : 255)
571
578
#define GP_CHAN_TO_ENC_TBL_RGB888_R(pixmap) \
579
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
580
590
#define GP_PIXEL_GET_G_RGB888_LIN(p, gamma_lin) ( \
591
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB888(p)] : \
592
GP_PIXEL_GET_G_RGB888(p) \
593
)
594
601
#define GP_CHAN_TO_LIN_TBL_RGB888_G(pixmap) \
602
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u16 : NULL)
603
612
#define GP_CHAN_LIN_MAX_VAL_RGB888_G(pixmap) \
613
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 1023 : 255)
614
621
#define GP_CHAN_TO_ENC_TBL_RGB888_G(pixmap) \
622
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
623
633
#define GP_PIXEL_GET_B_RGB888_LIN(p, gamma_lin) ( \
634
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB888(p)] : \
635
GP_PIXEL_GET_B_RGB888(p) \
636
)
637
644
#define GP_CHAN_TO_LIN_TBL_RGB888_B(pixmap) \
645
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u16 : NULL)
646
655
#define GP_CHAN_LIN_MAX_VAL_RGB888_B(pixmap) \
656
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 1023 : 255)
657
664
#define GP_CHAN_TO_ENC_TBL_RGB888_B(pixmap) \
665
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
666
682
#define GP_PIXEL_CREATE_BGR888_ENC(B, G, R, B_gamma_enc, G_gamma_enc, R_gamma_enc) \
683
(0\
684
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 16) \
685
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 8) \
686
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 0) \
687
)
688
697
#define GP_PIXEL_GET_B_BGR888_LIN(p, gamma_lin) ( \
698
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_BGR888(p)] : \
699
GP_PIXEL_GET_B_BGR888(p) \
700
)
701
708
#define GP_CHAN_TO_LIN_TBL_BGR888_B(pixmap) \
709
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
710
719
#define GP_CHAN_LIN_MAX_VAL_BGR888_B(pixmap) \
720
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1023 : 255)
721
728
#define GP_CHAN_TO_ENC_TBL_BGR888_B(pixmap) \
729
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
730
740
#define GP_PIXEL_GET_G_BGR888_LIN(p, gamma_lin) ( \
741
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_BGR888(p)] : \
742
GP_PIXEL_GET_G_BGR888(p) \
743
)
744
751
#define GP_CHAN_TO_LIN_TBL_BGR888_G(pixmap) \
752
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u16 : NULL)
753
762
#define GP_CHAN_LIN_MAX_VAL_BGR888_G(pixmap) \
763
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 1023 : 255)
764
771
#define GP_CHAN_TO_ENC_TBL_BGR888_G(pixmap) \
772
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
773
783
#define GP_PIXEL_GET_R_BGR888_LIN(p, gamma_lin) ( \
784
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_BGR888(p)] : \
785
GP_PIXEL_GET_R_BGR888(p) \
786
)
787
794
#define GP_CHAN_TO_LIN_TBL_BGR888_R(pixmap) \
795
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u16 : NULL)
796
805
#define GP_CHAN_LIN_MAX_VAL_BGR888_R(pixmap) \
806
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 1023 : 255)
807
814
#define GP_CHAN_TO_ENC_TBL_BGR888_R(pixmap) \
815
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
816
832
#define GP_PIXEL_CREATE_RGB555_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
833
(0\
834
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 10) \
835
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 5) \
836
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
837
)
838
847
#define GP_PIXEL_GET_R_RGB555_LIN(p, gamma_lin) ( \
848
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB555(p)] : \
849
GP_PIXEL_GET_R_RGB555(p) \
850
)
851
858
#define GP_CHAN_TO_LIN_TBL_RGB555_R(pixmap) \
859
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
860
869
#define GP_CHAN_LIN_MAX_VAL_RGB555_R(pixmap) \
870
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 127 : 31)
871
878
#define GP_CHAN_TO_ENC_TBL_RGB555_R(pixmap) \
879
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
880
890
#define GP_PIXEL_GET_G_RGB555_LIN(p, gamma_lin) ( \
891
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB555(p)] : \
892
GP_PIXEL_GET_G_RGB555(p) \
893
)
894
901
#define GP_CHAN_TO_LIN_TBL_RGB555_G(pixmap) \
902
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
903
912
#define GP_CHAN_LIN_MAX_VAL_RGB555_G(pixmap) \
913
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 127 : 31)
914
921
#define GP_CHAN_TO_ENC_TBL_RGB555_G(pixmap) \
922
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
923
933
#define GP_PIXEL_GET_B_RGB555_LIN(p, gamma_lin) ( \
934
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB555(p)] : \
935
GP_PIXEL_GET_B_RGB555(p) \
936
)
937
944
#define GP_CHAN_TO_LIN_TBL_RGB555_B(pixmap) \
945
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u8 : NULL)
946
955
#define GP_CHAN_LIN_MAX_VAL_RGB555_B(pixmap) \
956
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 127 : 31)
957
964
#define GP_CHAN_TO_ENC_TBL_RGB555_B(pixmap) \
965
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
966
982
#define GP_PIXEL_CREATE_RGB565_BE_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
983
(0\
984
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 11) \
985
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 5) \
986
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
987
)
988
997
#define GP_PIXEL_GET_R_RGB565_BE_LIN(p, gamma_lin) ( \
998
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB565_BE(p)] : \
999
GP_PIXEL_GET_R_RGB565_BE(p) \
1000
)
1001
1008
#define GP_CHAN_TO_LIN_TBL_RGB565_BE_R(pixmap) \
1009
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1010
1019
#define GP_CHAN_LIN_MAX_VAL_RGB565_BE_R(pixmap) \
1020
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 127 : 31)
1021
1028
#define GP_CHAN_TO_ENC_TBL_RGB565_BE_R(pixmap) \
1029
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1030
1040
#define GP_PIXEL_GET_G_RGB565_BE_LIN(p, gamma_lin) ( \
1041
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB565_BE(p)] : \
1042
GP_PIXEL_GET_G_RGB565_BE(p) \
1043
)
1044
1051
#define GP_CHAN_TO_LIN_TBL_RGB565_BE_G(pixmap) \
1052
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
1053
1062
#define GP_CHAN_LIN_MAX_VAL_RGB565_BE_G(pixmap) \
1063
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 255 : 63)
1064
1071
#define GP_CHAN_TO_ENC_TBL_RGB565_BE_G(pixmap) \
1072
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
1073
1083
#define GP_PIXEL_GET_B_RGB565_BE_LIN(p, gamma_lin) ( \
1084
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB565_BE(p)] : \
1085
GP_PIXEL_GET_B_RGB565_BE(p) \
1086
)
1087
1094
#define GP_CHAN_TO_LIN_TBL_RGB565_BE_B(pixmap) \
1095
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u8 : NULL)
1096
1105
#define GP_CHAN_LIN_MAX_VAL_RGB565_BE_B(pixmap) \
1106
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 127 : 31)
1107
1114
#define GP_CHAN_TO_ENC_TBL_RGB565_BE_B(pixmap) \
1115
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
1116
1132
#define GP_PIXEL_CREATE_RGB565_LE_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
1133
(0\
1134
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 11) \
1135
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 5) \
1136
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
1137
)
1138
1147
#define GP_PIXEL_GET_R_RGB565_LE_LIN(p, gamma_lin) ( \
1148
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB565_LE(p)] : \
1149
GP_PIXEL_GET_R_RGB565_LE(p) \
1150
)
1151
1158
#define GP_CHAN_TO_LIN_TBL_RGB565_LE_R(pixmap) \
1159
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1160
1169
#define GP_CHAN_LIN_MAX_VAL_RGB565_LE_R(pixmap) \
1170
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 127 : 31)
1171
1178
#define GP_CHAN_TO_ENC_TBL_RGB565_LE_R(pixmap) \
1179
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1180
1190
#define GP_PIXEL_GET_G_RGB565_LE_LIN(p, gamma_lin) ( \
1191
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB565_LE(p)] : \
1192
GP_PIXEL_GET_G_RGB565_LE(p) \
1193
)
1194
1201
#define GP_CHAN_TO_LIN_TBL_RGB565_LE_G(pixmap) \
1202
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
1203
1212
#define GP_CHAN_LIN_MAX_VAL_RGB565_LE_G(pixmap) \
1213
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 255 : 63)
1214
1221
#define GP_CHAN_TO_ENC_TBL_RGB565_LE_G(pixmap) \
1222
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
1223
1233
#define GP_PIXEL_GET_B_RGB565_LE_LIN(p, gamma_lin) ( \
1234
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB565_LE(p)] : \
1235
GP_PIXEL_GET_B_RGB565_LE(p) \
1236
)
1237
1244
#define GP_CHAN_TO_LIN_TBL_RGB565_LE_B(pixmap) \
1245
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u8 : NULL)
1246
1255
#define GP_CHAN_LIN_MAX_VAL_RGB565_LE_B(pixmap) \
1256
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 127 : 31)
1257
1264
#define GP_CHAN_TO_ENC_TBL_RGB565_LE_B(pixmap) \
1265
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
1266
1282
#define GP_PIXEL_CREATE_RGB666_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
1283
(0\
1284
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 12) \
1285
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 6) \
1286
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
1287
)
1288
1297
#define GP_PIXEL_GET_R_RGB666_LIN(p, gamma_lin) ( \
1298
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB666(p)] : \
1299
GP_PIXEL_GET_R_RGB666(p) \
1300
)
1301
1308
#define GP_CHAN_TO_LIN_TBL_RGB666_R(pixmap) \
1309
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1310
1319
#define GP_CHAN_LIN_MAX_VAL_RGB666_R(pixmap) \
1320
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 255 : 63)
1321
1328
#define GP_CHAN_TO_ENC_TBL_RGB666_R(pixmap) \
1329
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1330
1340
#define GP_PIXEL_GET_G_RGB666_LIN(p, gamma_lin) ( \
1341
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB666(p)] : \
1342
GP_PIXEL_GET_G_RGB666(p) \
1343
)
1344
1351
#define GP_CHAN_TO_LIN_TBL_RGB666_G(pixmap) \
1352
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
1353
1362
#define GP_CHAN_LIN_MAX_VAL_RGB666_G(pixmap) \
1363
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 255 : 63)
1364
1371
#define GP_CHAN_TO_ENC_TBL_RGB666_G(pixmap) \
1372
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
1373
1383
#define GP_PIXEL_GET_B_RGB666_LIN(p, gamma_lin) ( \
1384
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB666(p)] : \
1385
GP_PIXEL_GET_B_RGB666(p) \
1386
)
1387
1394
#define GP_CHAN_TO_LIN_TBL_RGB666_B(pixmap) \
1395
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u8 : NULL)
1396
1405
#define GP_CHAN_LIN_MAX_VAL_RGB666_B(pixmap) \
1406
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 255 : 63)
1407
1414
#define GP_CHAN_TO_ENC_TBL_RGB666_B(pixmap) \
1415
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
1416
1432
#define GP_PIXEL_CREATE_RGB332_ENC(R, G, B, R_gamma_enc, G_gamma_enc, B_gamma_enc) \
1433
(0\
1434
+ ((R_gamma_enc ? R_gamma_enc[(R)] : R) << 5) \
1435
+ ((G_gamma_enc ? G_gamma_enc[(G)] : G) << 2) \
1436
+ ((B_gamma_enc ? B_gamma_enc[(B)] : B) << 0) \
1437
)
1438
1447
#define GP_PIXEL_GET_R_RGB332_LIN(p, gamma_lin) ( \
1448
gamma_lin ? gamma_lin[GP_PIXEL_GET_R_RGB332(p)] : \
1449
GP_PIXEL_GET_R_RGB332(p) \
1450
)
1451
1458
#define GP_CHAN_TO_LIN_TBL_RGB332_R(pixmap) \
1459
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1460
1469
#define GP_CHAN_LIN_MAX_VAL_RGB332_R(pixmap) \
1470
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 31 : 7)
1471
1478
#define GP_CHAN_TO_ENC_TBL_RGB332_R(pixmap) \
1479
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1480
1490
#define GP_PIXEL_GET_G_RGB332_LIN(p, gamma_lin) ( \
1491
gamma_lin ? gamma_lin[GP_PIXEL_GET_G_RGB332(p)] : \
1492
GP_PIXEL_GET_G_RGB332(p) \
1493
)
1494
1501
#define GP_CHAN_TO_LIN_TBL_RGB332_G(pixmap) \
1502
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
1503
1512
#define GP_CHAN_LIN_MAX_VAL_RGB332_G(pixmap) \
1513
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 31 : 7)
1514
1521
#define GP_CHAN_TO_ENC_TBL_RGB332_G(pixmap) \
1522
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
1523
1533
#define GP_PIXEL_GET_B_RGB332_LIN(p, gamma_lin) ( \
1534
gamma_lin ? gamma_lin[GP_PIXEL_GET_B_RGB332(p)] : \
1535
GP_PIXEL_GET_B_RGB332(p) \
1536
)
1537
1544
#define GP_CHAN_TO_LIN_TBL_RGB332_B(pixmap) \
1545
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u8 : NULL)
1546
1555
#define GP_CHAN_LIN_MAX_VAL_RGB332_B(pixmap) \
1556
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 15 : 3)
1557
1564
#define GP_CHAN_TO_ENC_TBL_RGB332_B(pixmap) \
1565
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
1566
1585
#define GP_PIXEL_CREATE_CMYK8888_ENC(K, Y, M, C, K_gamma_enc, Y_gamma_enc, M_gamma_enc, C_gamma_enc) \
1586
(0\
1587
+ ((K_gamma_enc ? K_gamma_enc[(K)] : K) << 24) \
1588
+ ((Y_gamma_enc ? Y_gamma_enc[(Y)] : Y) << 16) \
1589
+ ((M_gamma_enc ? M_gamma_enc[(M)] : M) << 8) \
1590
+ ((C_gamma_enc ? C_gamma_enc[(C)] : C) << 0) \
1591
)
1592
1601
#define GP_PIXEL_GET_K_CMYK8888_LIN(p, gamma_lin) ( \
1602
gamma_lin ? gamma_lin[GP_PIXEL_GET_K_CMYK8888(p)] : \
1603
GP_PIXEL_GET_K_CMYK8888(p) \
1604
)
1605
1612
#define GP_CHAN_TO_LIN_TBL_CMYK8888_K(pixmap) \
1613
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1614
1623
#define GP_CHAN_LIN_MAX_VAL_CMYK8888_K(pixmap) \
1624
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 255 : 255)
1625
1632
#define GP_CHAN_TO_ENC_TBL_CMYK8888_K(pixmap) \
1633
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1634
1644
#define GP_PIXEL_GET_Y_CMYK8888_LIN(p, gamma_lin) ( \
1645
gamma_lin ? gamma_lin[GP_PIXEL_GET_Y_CMYK8888(p)] : \
1646
GP_PIXEL_GET_Y_CMYK8888(p) \
1647
)
1648
1655
#define GP_CHAN_TO_LIN_TBL_CMYK8888_Y(pixmap) \
1656
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
1657
1666
#define GP_CHAN_LIN_MAX_VAL_CMYK8888_Y(pixmap) \
1667
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 255 : 255)
1668
1675
#define GP_CHAN_TO_ENC_TBL_CMYK8888_Y(pixmap) \
1676
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
1677
1687
#define GP_PIXEL_GET_M_CMYK8888_LIN(p, gamma_lin) ( \
1688
gamma_lin ? gamma_lin[GP_PIXEL_GET_M_CMYK8888(p)] : \
1689
GP_PIXEL_GET_M_CMYK8888(p) \
1690
)
1691
1698
#define GP_CHAN_TO_LIN_TBL_CMYK8888_M(pixmap) \
1699
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? (pixmap)->gamma->lin[2]->u8 : NULL)
1700
1709
#define GP_CHAN_LIN_MAX_VAL_CMYK8888_M(pixmap) \
1710
(((pixmap)->gamma && (pixmap)->gamma->lin[2]) ? 255 : 255)
1711
1718
#define GP_CHAN_TO_ENC_TBL_CMYK8888_M(pixmap) \
1719
(((pixmap)->gamma && (pixmap)->gamma->enc[2]) ? (pixmap)->gamma->enc[2]->u8 : NULL)
1720
1730
#define GP_PIXEL_GET_C_CMYK8888_LIN(p, gamma_lin) ( \
1731
gamma_lin ? gamma_lin[GP_PIXEL_GET_C_CMYK8888(p)] : \
1732
GP_PIXEL_GET_C_CMYK8888(p) \
1733
)
1734
1741
#define GP_CHAN_TO_LIN_TBL_CMYK8888_C(pixmap) \
1742
(((pixmap)->gamma && (pixmap)->gamma->lin[3]) ? (pixmap)->gamma->lin[3]->u8 : NULL)
1743
1752
#define GP_CHAN_LIN_MAX_VAL_CMYK8888_C(pixmap) \
1753
(((pixmap)->gamma && (pixmap)->gamma->lin[3]) ? 255 : 255)
1754
1761
#define GP_CHAN_TO_ENC_TBL_CMYK8888_C(pixmap) \
1762
(((pixmap)->gamma && (pixmap)->gamma->enc[3]) ? (pixmap)->gamma->enc[3]->u8 : NULL)
1763
1773
#define GP_PIXEL_CREATE_G1_DB_ENC(V, V_gamma_enc) \
1774
(0\
1775
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
1776
)
1777
1786
#define GP_PIXEL_GET_V_G1_DB_LIN(p, gamma_lin) ( \
1787
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G1_DB(p)] : \
1788
GP_PIXEL_GET_V_G1_DB(p) \
1789
)
1790
1797
#define GP_CHAN_TO_LIN_TBL_G1_DB_V(pixmap) \
1798
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1799
1808
#define GP_CHAN_LIN_MAX_VAL_G1_DB_V(pixmap) \
1809
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1 : 1)
1810
1817
#define GP_CHAN_TO_ENC_TBL_G1_DB_V(pixmap) \
1818
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1819
1829
#define GP_PIXEL_CREATE_G2_DB_ENC(V, V_gamma_enc) \
1830
(0\
1831
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
1832
)
1833
1842
#define GP_PIXEL_GET_V_G2_DB_LIN(p, gamma_lin) ( \
1843
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G2_DB(p)] : \
1844
GP_PIXEL_GET_V_G2_DB(p) \
1845
)
1846
1853
#define GP_CHAN_TO_LIN_TBL_G2_DB_V(pixmap) \
1854
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1855
1864
#define GP_CHAN_LIN_MAX_VAL_G2_DB_V(pixmap) \
1865
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 15 : 3)
1866
1873
#define GP_CHAN_TO_ENC_TBL_G2_DB_V(pixmap) \
1874
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1875
1885
#define GP_PIXEL_CREATE_G4_DB_ENC(V, V_gamma_enc) \
1886
(0\
1887
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
1888
)
1889
1898
#define GP_PIXEL_GET_V_G4_DB_LIN(p, gamma_lin) ( \
1899
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G4_DB(p)] : \
1900
GP_PIXEL_GET_V_G4_DB(p) \
1901
)
1902
1909
#define GP_CHAN_TO_LIN_TBL_G4_DB_V(pixmap) \
1910
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1911
1920
#define GP_CHAN_LIN_MAX_VAL_G4_DB_V(pixmap) \
1921
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 63 : 15)
1922
1929
#define GP_CHAN_TO_ENC_TBL_G4_DB_V(pixmap) \
1930
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1931
1941
#define GP_PIXEL_CREATE_G1_UB_ENC(V, V_gamma_enc) \
1942
(0\
1943
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
1944
)
1945
1954
#define GP_PIXEL_GET_V_G1_UB_LIN(p, gamma_lin) ( \
1955
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G1_UB(p)] : \
1956
GP_PIXEL_GET_V_G1_UB(p) \
1957
)
1958
1965
#define GP_CHAN_TO_LIN_TBL_G1_UB_V(pixmap) \
1966
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
1967
1976
#define GP_CHAN_LIN_MAX_VAL_G1_UB_V(pixmap) \
1977
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1 : 1)
1978
1985
#define GP_CHAN_TO_ENC_TBL_G1_UB_V(pixmap) \
1986
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
1987
1997
#define GP_PIXEL_CREATE_G2_UB_ENC(V, V_gamma_enc) \
1998
(0\
1999
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
2000
)
2001
2010
#define GP_PIXEL_GET_V_G2_UB_LIN(p, gamma_lin) ( \
2011
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G2_UB(p)] : \
2012
GP_PIXEL_GET_V_G2_UB(p) \
2013
)
2014
2021
#define GP_CHAN_TO_LIN_TBL_G2_UB_V(pixmap) \
2022
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
2023
2032
#define GP_CHAN_LIN_MAX_VAL_G2_UB_V(pixmap) \
2033
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 15 : 3)
2034
2041
#define GP_CHAN_TO_ENC_TBL_G2_UB_V(pixmap) \
2042
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
2043
2053
#define GP_PIXEL_CREATE_G4_UB_ENC(V, V_gamma_enc) \
2054
(0\
2055
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
2056
)
2057
2066
#define GP_PIXEL_GET_V_G4_UB_LIN(p, gamma_lin) ( \
2067
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G4_UB(p)] : \
2068
GP_PIXEL_GET_V_G4_UB(p) \
2069
)
2070
2077
#define GP_CHAN_TO_LIN_TBL_G4_UB_V(pixmap) \
2078
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u8 : NULL)
2079
2088
#define GP_CHAN_LIN_MAX_VAL_G4_UB_V(pixmap) \
2089
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 63 : 15)
2090
2097
#define GP_CHAN_TO_ENC_TBL_G4_UB_V(pixmap) \
2098
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
2099
2109
#define GP_PIXEL_CREATE_G8_ENC(V, V_gamma_enc) \
2110
(0\
2111
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
2112
)
2113
2122
#define GP_PIXEL_GET_V_G8_LIN(p, gamma_lin) ( \
2123
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G8(p)] : \
2124
GP_PIXEL_GET_V_G8(p) \
2125
)
2126
2133
#define GP_CHAN_TO_LIN_TBL_G8_V(pixmap) \
2134
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
2135
2144
#define GP_CHAN_LIN_MAX_VAL_G8_V(pixmap) \
2145
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1023 : 255)
2146
2153
#define GP_CHAN_TO_ENC_TBL_G8_V(pixmap) \
2154
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
2155
2168
#define GP_PIXEL_CREATE_GA88_ENC(V, A, V_gamma_enc, A_gamma_enc) \
2169
(0\
2170
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
2171
+ ((A_gamma_enc ? A_gamma_enc[(A)] : A) << 8) \
2172
)
2173
2182
#define GP_PIXEL_GET_V_GA88_LIN(p, gamma_lin) ( \
2183
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_GA88(p)] : \
2184
GP_PIXEL_GET_V_GA88(p) \
2185
)
2186
2193
#define GP_CHAN_TO_LIN_TBL_GA88_V(pixmap) \
2194
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
2195
2204
#define GP_CHAN_LIN_MAX_VAL_GA88_V(pixmap) \
2205
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 1023 : 255)
2206
2213
#define GP_CHAN_TO_ENC_TBL_GA88_V(pixmap) \
2214
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u8 : NULL)
2215
2225
#define GP_PIXEL_GET_A_GA88_LIN(p, gamma_lin) ( \
2226
gamma_lin ? gamma_lin[GP_PIXEL_GET_A_GA88(p)] : \
2227
GP_PIXEL_GET_A_GA88(p) \
2228
)
2229
2236
#define GP_CHAN_TO_LIN_TBL_GA88_A(pixmap) \
2237
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? (pixmap)->gamma->lin[1]->u8 : NULL)
2238
2247
#define GP_CHAN_LIN_MAX_VAL_GA88_A(pixmap) \
2248
(((pixmap)->gamma && (pixmap)->gamma->lin[1]) ? 255 : 255)
2249
2256
#define GP_CHAN_TO_ENC_TBL_GA88_A(pixmap) \
2257
(((pixmap)->gamma && (pixmap)->gamma->enc[1]) ? (pixmap)->gamma->enc[1]->u8 : NULL)
2258
2268
#define GP_PIXEL_CREATE_G16_ENC(V, V_gamma_enc) \
2269
(0\
2270
+ ((V_gamma_enc ? V_gamma_enc[(V)] : V) << 0) \
2271
)
2272
2281
#define GP_PIXEL_GET_V_G16_LIN(p, gamma_lin) ( \
2282
gamma_lin ? gamma_lin[GP_PIXEL_GET_V_G16(p)] : \
2283
GP_PIXEL_GET_V_G16(p) \
2284
)
2285
2292
#define GP_CHAN_TO_LIN_TBL_G16_V(pixmap) \
2293
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? (pixmap)->gamma->lin[0]->u16 : NULL)
2294
2303
#define GP_CHAN_LIN_MAX_VAL_G16_V(pixmap) \
2304
(((pixmap)->gamma && (pixmap)->gamma->lin[0]) ? 262143 : 65535)
2305
2312
#define GP_CHAN_TO_ENC_TBL_G16_V(pixmap) \
2313
(((pixmap)->gamma && (pixmap)->gamma->enc[0]) ? (pixmap)->gamma->enc[0]->u16 : NULL)
2314
2315
#endif
/* GP_GAMMA_CORRECTION_GEN_H */
include
core
gp_gamma_correction.gen.h
Generated by
1.13.2