aboutsummaryrefslogtreecommitdiffstats
path: root/vxd_gamma.h
blob: 77827f682cce9d1654a5c0acb0a8a20738050fb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#ifndef __VXD_GAMMA_H__INCLUDED__
#define __VXD_GAMMA_H__INCLUDED__

/*
  formula to compute gamma correction (g):
          1
  g = --------
        ln(c)
       ------
        ln(b)

  c = chroma value (eg. color/255.f)
  b = RGB base color value
*/

/* gamma table computed for chroma(128): */
static const DWORD gamma_table[256] = {
	0x00000000, // 0 = 0.000000
	0x00001FD7, // 1 = 0.124382
	0x00002464, // 2 = 0.142165
	0x000027B7, // 3 = 0.155140
	0x00002A77, // 4 = 0.165882
	0x00002CE0, // 5 = 0.175296
	0x00002F0E, // 6 = 0.183820
	0x00003113, // 7 = 0.191701
	0x000032F7, // 8 = 0.199096
	0x000034C3, // 9 = 0.206108
	0x0000367A, // 10 = 0.212813
	0x00003821, // 11 = 0.219266
	0x000039BA, // 12 = 0.225508
	0x00003B48, // 13 = 0.231573
	0x00003CCB, // 14 = 0.237486
	0x00003E46, // 15 = 0.243269
	0x00003FBA, // 16 = 0.248940
	0x00004127, // 17 = 0.254513
	0x0000428F, // 18 = 0.260001
	0x000043F2, // 19 = 0.265414
	0x00004550, // 20 = 0.270762
	0x000046AB, // 21 = 0.276053
	0x00004802, // 22 = 0.281294
	0x00004957, // 23 = 0.286492
	0x00004AA9, // 24 = 0.291651
	0x00004BF9, // 25 = 0.296778
	0x00004D47, // 26 = 0.301876
	0x00004E94, // 27 = 0.306950
	0x00004FDF, // 28 = 0.312003
	0x00005129, // 29 = 0.317039
	0x00005272, // 30 = 0.322062
	0x000053BB, // 31 = 0.327073
	0x00005502, // 32 = 0.332076
	0x0000564A, // 33 = 0.337074
	0x00005791, // 34 = 0.342068
	0x000058D8, // 35 = 0.347061
	0x00005A20, // 36 = 0.352055
	0x00005B67, // 37 = 0.357052
	0x00005CAF, // 38 = 0.362054
	0x00005DF7, // 39 = 0.367062
	0x00005F40, // 40 = 0.372079
	0x0000608A, // 41 = 0.377106
	0x000061D4, // 42 = 0.382144
	0x0000631F, // 43 = 0.387196
	0x0000646B, // 44 = 0.392262
	0x000065B8, // 45 = 0.397344
	0x00006706, // 46 = 0.402443
	0x00006855, // 47 = 0.407561
	0x000069A6, // 48 = 0.412699
	0x00006AF8, // 49 = 0.417858
	0x00006C4C, // 50 = 0.423040
	0x00006DA1, // 51 = 0.428245
	0x00006EF8, // 52 = 0.433475
	0x00007050, // 53 = 0.438731
	0x000071AA, // 54 = 0.444014
	0x00007306, // 55 = 0.449325
	0x00007464, // 56 = 0.454666
	0x000075C4, // 57 = 0.460037
	0x00007727, // 58 = 0.465440
	0x0000788B, // 59 = 0.470876
	0x000079F1, // 60 = 0.476345
	0x00007B5A, // 61 = 0.481850
	0x00007CC5, // 62 = 0.487391
	0x00007E33, // 63 = 0.492968
	0x00007FA3, // 64 = 0.498584
	0x00008115, // 65 = 0.504240
	0x0000828B, // 66 = 0.509935
	0x00008403, // 67 = 0.515673
	0x0000857D, // 68 = 0.521453
	0x000086FB, // 69 = 0.527277
	0x0000887C, // 70 = 0.533145
	0x000089FF, // 71 = 0.539060
	0x00008B86, // 72 = 0.545022
	0x00008D10, // 73 = 0.551032
	0x00008E9D, // 74 = 0.557092
	0x0000902E, // 75 = 0.563202
	0x000091C1, // 76 = 0.569365
	0x00009359, // 77 = 0.575580
	0x000094F4, // 78 = 0.581850
	0x00009692, // 79 = 0.588176
	0x00009834, // 80 = 0.594558
	0x000099DB, // 81 = 0.600998
	0x00009B84, // 82 = 0.607498
	0x00009D32, // 83 = 0.614058
	0x00009EE4, // 84 = 0.620681
	0x0000A09B, // 85 = 0.627367
	0x0000A255, // 86 = 0.634118
	0x0000A414, // 87 = 0.640935
	0x0000A5D7, // 88 = 0.647820
	0x0000A79F, // 89 = 0.654774
	0x0000A96B, // 90 = 0.661799
	0x0000AB3C, // 91 = 0.668896
	0x0000AD12, // 92 = 0.676067
	0x0000AEED, // 93 = 0.683313
	0x0000B0CD, // 94 = 0.690636
	0x0000B2B2, // 95 = 0.698038
	0x0000B49C, // 96 = 0.705520
	0x0000B68C, // 97 = 0.713084
	0x0000B881, // 98 = 0.720732
	0x0000BA7C, // 99 = 0.728466
	0x0000BC7D, // 100 = 0.736287
	0x0000BE83, // 101 = 0.744197
	0x0000C090, // 102 = 0.752199
	0x0000C2A2, // 103 = 0.760295
	0x0000C4BB, // 104 = 0.768485
	0x0000C6DA, // 105 = 0.776773
	0x0000C900, // 106 = 0.785161
	0x0000CB2C, // 107 = 0.793650
	0x0000CD5F, // 108 = 0.802243
	0x0000CF99, // 109 = 0.810943
	0x0000D1DB, // 110 = 0.819752
	0x0000D423, // 111 = 0.828671
	0x0000D673, // 112 = 0.837704
	0x0000D8CB, // 113 = 0.846853
	0x0000DB2A, // 114 = 0.856121
	0x0000DD92, // 115 = 0.865511
	0x0000E001, // 116 = 0.875024
	0x0000E279, // 117 = 0.884665
	0x0000E4F9, // 118 = 0.894436
	0x0000E782, // 119 = 0.904339
	0x0000EA14, // 120 = 0.914379
	0x0000ECAF, // 121 = 0.924558
	0x0000EF54, // 122 = 0.934880
	0x0000F202, // 123 = 0.945348
	0x0000F4BA, // 124 = 0.955965
	0x0000F77B, // 125 = 0.966735
	0x0000FA48, // 126 = 0.977661
	0x0000FD1E, // 127 = 0.988748
	0x00010000, // 128 = 1.000000
	0x000102EC, // 129 = 1.011420
	0x000105E4, // 130 = 1.023012
	0x000108E7, // 131 = 1.034782
	0x00010BF6, // 132 = 1.046733
	0x00010F12, // 133 = 1.058869
	0x00011239, // 134 = 1.071197
	0x0001156E, // 135 = 1.083719
	0x000118B0, // 136 = 1.096443
	0x00011BFF, // 137 = 1.109372
	0x00011F5C, // 138 = 1.122512
	0x000122C8, // 139 = 1.135869
	0x00012642, // 140 = 1.149448
	0x000129CB, // 141 = 1.163256
	0x00012D63, // 142 = 1.177298
	0x0001310B, // 143 = 1.191582
	0x000134C3, // 144 = 1.206112
	0x0001388C, // 145 = 1.220898
	0x00013C66, // 146 = 1.235945
	0x00014052, // 147 = 1.251261
	0x00014450, // 148 = 1.266854
	0x00014861, // 149 = 1.282731
	0x00014C84, // 150 = 1.298900
	0x000150BC, // 151 = 1.315372
	0x00015507, // 152 = 1.332153
	0x00015968, // 153 = 1.349254
	0x00015DDE, // 154 = 1.366683
	0x0001626B, // 155 = 1.384452
	0x0001670E, // 156 = 1.402570
	0x00016BC9, // 157 = 1.421048
	0x0001709D, // 158 = 1.439897
	0x00017589, // 159 = 1.459129
	0x00017A8F, // 160 = 1.478757
	0x00017FB0, // 161 = 1.498792
	0x000184ED, // 162 = 1.519249
	0x00018A46, // 163 = 1.540140
	0x00018FBD, // 164 = 1.561481
	0x00019552, // 165 = 1.583287
	0x00019B06, // 166 = 1.605572
	0x0001A0DB, // 167 = 1.628355
	0x0001A6D2, // 168 = 1.651651
	0x0001ACEC, // 169 = 1.675479
	0x0001B329, // 170 = 1.699858
	0x0001B98D, // 171 = 1.724808
	0x0001C016, // 172 = 1.750349
	0x0001C6C8, // 173 = 1.776503
	0x0001CDA4, // 174 = 1.803293
	0x0001D4AB, // 175 = 1.830742
	0x0001DBDF, // 176 = 1.858876
	0x0001E341, // 177 = 1.887722
	0x0001EAD4, // 178 = 1.917306
	0x0001F299, // 179 = 1.947659
	0x0001FA93, // 180 = 1.978811
	0x000202C3, // 181 = 2.010795
	0x00020B2C, // 182 = 2.043645
	0x000213D0, // 183 = 2.077397
	0x00021CB1, // 184 = 2.112089
	0x000225D3, // 185 = 2.147762
	0x00022F38, // 186 = 2.184458
	0x000238E3, // 187 = 2.222223
	0x000242D7, // 188 = 2.261104
	0x00024D18, // 189 = 2.301153
	0x000257A9, // 190 = 2.342423
	0x0002628D, // 191 = 2.384972
	0x00026DC9, // 192 = 2.428860
	0x00027962, // 193 = 2.474154
	0x0002855B, // 194 = 2.520921
	0x000291B9, // 195 = 2.569235
	0x00029E82, // 196 = 2.619176
	0x0002ABBB, // 197 = 2.670828
	0x0002B96A, // 198 = 2.724280
	0x0002C795, // 199 = 2.779629
	0x0002D644, // 200 = 2.836979
	0x0002E57D, // 201 = 2.896442
	0x0002F548, // 202 = 2.958135
	0x000305AE, // 203 = 3.022190
	0x000316B7, // 204 = 3.088744
	0x0003286F, // 205 = 3.157947
	0x00033ADE, // 206 = 3.229963
	0x00034E12, // 207 = 3.304966
	0x00036215, // 208 = 3.383147
	0x000376F7, // 209 = 3.464715
	0x00038CC5, // 210 = 3.549894
	0x0003A391, // 211 = 3.638931
	0x0003BB6A, // 212 = 3.732096
	0x0003D466, // 213 = 3.829683
	0x0003EE98, // 214 = 3.932015
	0x00040A19, // 215 = 4.039450
	0x00042702, // 216 = 4.152379
	0x0004456F, // 217 = 4.271237
	0x00046581, // 218 = 4.396504
	0x00048759, // 219 = 4.528715
	0x0004AB20, // 220 = 4.668464
	0x0004D100, // 221 = 4.816417
	0x0004F92B, // 222 = 4.973320
	0x000523D7, // 223 = 5.140012
	0x00055143, // 224 = 5.317440
	0x000581B5, // 225 = 5.506679
	0x0005B57D, // 226 = 5.708950
	0x0005ECF7, // 227 = 5.925650
	0x0006288B, // 228 = 6.158382
	0x000668B3, // 229 = 6.408996
	0x0006ADFC, // 230 = 6.679637
	0x0006F90A, // 231 = 6.972811
	0x00074A9C, // 232 = 7.291454
	0x0007A398, // 233 = 7.639042
	0x0008050B, // 234 = 8.019709
	0x0008703C, // 235 = 8.438417
	0x0008E6B3, // 236 = 8.901173
	0x00096A52, // 237 = 9.415317
	0x0009FD6B, // 238 = 9.989920
	0x000AA2E5, // 239 = 10.636317
	0x000B5E6E, // 240 = 11.368867
	0x000C34BE, // 241 = 12.206032
	0x000D2C05, // 242 = 13.171954
	0x000E4C7F, // 243 = 14.298822
	0x000FA16A, // 244 = 15.630531
	0x00113A81, // 245 = 17.228534
	0x00132E7D, // 246 = 19.181596
	0x00159F73, // 247 = 21.622863
	0x0018C2F6, // 248 = 24.761568
	0x001CF249, // 249 = 28.946430
	0x0022CE1D, // 250 = 34.805143
	0x002B97D5, // 251 = 43.593097
	0x003A3D52, // 252 = 58.239533
	0x0057883C, // 253 = 87.532174
	0x00AF68DE, // 254 = 175.409644
	0x00FFFFFF, // 255 = 255.000000 (INF)
};

#endif /* __VXD_GAMMA_H__INCLUDED__ */