32 #ifndef AGG_COLOR_CONV_RGB8_INCLUDED 33 #define AGG_COLOR_CONV_RGB8_INCLUDED 35 #include "agg_basics.h" 36 #include "agg_color_conv.h" 45 void operator () (int8u* dst,
75 void operator () (int8u* dst,
121 void operator () (int8u* dst,
123 unsigned width)
const 154 void operator () (int8u* dst,
156 unsigned width)
const 186 void operator () (int8u* dst,
188 unsigned width)
const 192 unsigned rgb = *(int16u*)src;
193 dst[R] = (int8u)((rgb >> 7) & 0xF8);
194 dst[1] = (int8u)((rgb >> 2) & 0xF8);
195 dst[B] = (int8u)((rgb << 3) & 0xF8);
213 void operator () (int8u* dst,
215 unsigned width)
const 219 *(int16u*)dst = (int16u)(((unsigned(src[R]) << 7) & 0x7C00) |
220 ((unsigned(src[1]) << 2) & 0x3E0) |
221 ((unsigned(src[B]) >> 3)));
239 void operator () (int8u* dst,
241 unsigned width)
const 245 unsigned rgb = *(int16u*)src;
246 dst[R] = (rgb >> 8) & 0xF8;
247 dst[1] = (rgb >> 3) & 0xFC;
248 dst[B] = (rgb << 3) & 0xF8;
266 void operator () (int8u* dst,
268 unsigned width)
const 272 *(int16u*)dst = (int16u)(((unsigned(src[R]) << 8) & 0xF800) |
273 ((unsigned(src[1]) << 3) & 0x7E0) |
274 ((unsigned(src[B]) >> 3)));
293 void operator () (int8u* dst,
295 unsigned width)
const 299 int rgb = *(int16*)src;
300 dst[R] = (int8u)((rgb >> 7) & 0xF8);
301 dst[G] = (int8u)((rgb >> 2) & 0xF8);
302 dst[B] = (int8u)((rgb << 3) & 0xF8);
303 dst[A] = (int8u)(rgb >> 15);
323 void operator () (int8u* dst,
325 unsigned width)
const 329 *(int16u*)dst = (int16u)(((unsigned(src[R]) << 7) & 0x7C00) |
330 ((unsigned(src[G]) << 2) & 0x3E0) |
331 ((unsigned(src[B]) >> 3)) |
332 ((unsigned(src[A]) << 8) & 0x8000));
353 void operator () (int8u* dst,
355 unsigned width)
const 359 int rgb = *(int16*)src;
360 dst[R] = (rgb >> 8) & 0xF8;
361 dst[G] = (rgb >> 3) & 0xFC;
362 dst[B] = (rgb << 3) & 0xF8;
383 void operator () (int8u* dst,
385 unsigned width)
const 389 *(int16u*)dst = (int16u)(((unsigned(src[R]) << 8) & 0xF800) |
390 ((unsigned(src[G]) << 3) & 0x7E0) |
391 ((unsigned(src[B]) >> 3)));
411 void operator () (int8u* dst,
413 unsigned width)
const 417 unsigned rgb = *(int16u*)src;
418 *(int16u*)dst = (int16u)(((rgb << 1) & 0xFFC0) | (rgb & 0x1F));
431 void operator () (int8u* dst,
433 unsigned width)
const 437 unsigned rgb = *(int16u*)src;
438 *(int16u*)dst = (int16u)(((rgb >> 1) & 0x7FE0) | (rgb & 0x1F));
455 void operator () (int8u* dst,
457 unsigned width)
const 461 *dst++ = (src[R]*77 + src[1]*150 + src[B]*29) >> 8;