22 #ifndef GRAPHICS_COLORMASKS_H 23 #define GRAPHICS_COLORMASKS_H 25 #include "common/scummsys.h" 29 template<
int bitFormat>
69 kHighBitsMask = 0xF7DEF7DE,
70 kLowBitsMask = 0x08210821,
71 qhighBits = 0xE79CE79C,
72 qlowBits = 0x18631863,
83 kRedShift = kGreenBits+kBlueBits,
84 kGreenShift = kBlueBits,
87 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
88 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
89 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
90 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
92 kRedBlueMask = kRedMask | kBlueMask,
94 kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift),
95 kLow2Bits = (3 << kRedShift) | (3 << kGreenShift) | (3 << kBlueShift),
96 kLow3Bits = (7 << kRedShift) | (7 << kGreenShift) | (7 << kBlueShift)
99 typedef uint16 PixelType;
105 kHighBitsMask = 0x7BDE7BDE,
106 kLowBitsMask = 0x04210421,
107 qhighBits = 0x739C739C,
108 qlowBits = 0x0C630C63,
119 kRedShift = kGreenBits+kBlueBits,
120 kGreenShift = kBlueBits,
123 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
124 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
125 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
126 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
128 kRedBlueMask = kRedMask | kBlueMask,
130 kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift),
131 kLow2Bits = (3 << kRedShift) | (3 << kGreenShift) | (3 << kBlueShift),
132 kLow3Bits = (7 << kRedShift) | (7 << kGreenShift) | (7 << kBlueShift)
135 typedef uint16 PixelType;
148 kAlphaShift = kRedBits+kGreenBits+kBlueBits,
150 kGreenShift = kBlueBits,
151 kBlueShift = kGreenBits+kBlueBits,
153 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
154 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
155 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
156 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
158 kRedBlueMask = kRedMask | kBlueMask
161 typedef uint16 PixelType;
175 kRedShift = kGreenBits+kBlueBits+kAlphaBits,
176 kGreenShift = kBlueBits+kAlphaBits,
177 kBlueShift = kAlphaBits,
179 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
180 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
181 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
182 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
184 kRedBlueMask = kRedMask | kBlueMask
187 typedef uint16 PixelType;
200 kAlphaShift = kRedBits+kGreenBits+kBlueBits,
201 kRedShift = kGreenBits+kBlueBits,
202 kGreenShift = kBlueBits,
205 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
206 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
207 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
208 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
210 kRedBlueMask = kRedMask | kBlueMask
213 typedef uint16 PixelType;
227 kRedShift = kGreenBits+kBlueBits,
228 kGreenShift = kBlueBits,
231 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
232 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
233 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
234 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
236 kRedBlueMask = kRedMask | kBlueMask,
238 kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift),
239 kLow2Bits = (3 << kRedShift) | (3 << kGreenShift) | (3 << kBlueShift),
240 kLow3Bits = (7 << kRedShift) | (7 << kGreenShift) | (7 << kBlueShift),
241 kLow4Bits = (15 << kRedShift) | (15 << kGreenShift) | (15 << kBlueShift),
243 kLowBitsMask = kLowBits,
245 kHighBitsMask = (~kLowBits) & (kRedMask | kBlueMask | kGreenMask),
246 qlowBits = kLow2Bits,
247 qhighBits = (~kLowBits) & (kRedMask | kBlueMask | kGreenMask)
250 typedef uint32 PixelType;
263 kAlphaShift = kRedBits+kGreenBits+kBlueBits,
264 kRedShift = kGreenBits+kBlueBits,
265 kGreenShift = kBlueBits,
268 kAlphaMask = ((1 << kAlphaBits) - 1) << kAlphaShift,
269 kRedMask = ((1 << kRedBits) - 1) << kRedShift,
270 kGreenMask = ((1 << kGreenBits) - 1) << kGreenShift,
271 kBlueMask = ((1 << kBlueBits) - 1) << kBlueShift,
273 kRedBlueMask = kRedMask | kBlueMask,
275 kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift) | (1 << kAlphaShift),
276 kLow2Bits = (3 << kRedShift) | (3 << kGreenShift) | (3 << kBlueShift) | (3 << kAlphaShift),
277 kLow3Bits = (7 << kRedShift) | (7 << kGreenShift) | (7 << kBlueShift) | (7 << kAlphaShift),
278 kLow4Bits = (15 << kRedShift) | (15 << kGreenShift) | (15 << kBlueShift) | (15 << kAlphaShift),
280 kLowBitsMask = kLowBits,
281 kHighBitsMask = ~kLowBits,
282 qlowBits = kLow2Bits,
283 qhighBits = ~kLow2Bits
286 typedef uint32 PixelType;
300 kRedShift = kAlphaBits,
301 kGreenShift = kRedBits+kAlphaBits,
302 kBlueShift = kGreenBits+kRedBits+kAlphaBits,
304 kAlphaMask = ((1u << kAlphaBits) - 1) << kAlphaShift,
305 kRedMask = ((1u << kRedBits) - 1) << kRedShift,
306 kGreenMask = ((1u << kGreenBits) - 1) << kGreenShift,
307 kBlueMask = ((1u << kBlueBits) - 1) << kBlueShift,
309 kRedBlueMask = kRedMask | kBlueMask,
311 kLowBits = (1 << kRedShift) | (1 << kGreenShift) | (1 << kBlueShift) | (1 << kAlphaShift),
312 kLow2Bits = (3 << kRedShift) | (3 << kGreenShift) | (3 << kBlueShift) | (3 << kAlphaShift),
313 kLow3Bits = (7 << kRedShift) | (7 << kGreenShift) | (7 << kBlueShift) | (7 << kAlphaShift),
314 kLow4Bits = (15 << kRedShift) | (15 << kGreenShift) | (15 << kBlueShift) | (15 << kAlphaShift),
316 kLowBitsMask = kLowBits,
317 kHighBitsMask = (uint) ~kLowBits,
318 qlowBits = kLow2Bits,
319 qhighBits = (uint) ~kLow2Bits
322 typedef uint32 PixelType;
Definition: formatinfo.h:28
Definition: colormasks.h:30