1 #include "pixfmt-rgb24.hpp"
5 pixel_format_rgb24
<uvswap
>::~pixel_format_rgb24() throw() {}
8 void pixel_format_rgb24
<uvswap
>::decode(uint8_t* target
, const uint8_t* src
, size_t width
) throw()
11 for(size_t i
= 0; i
< width
; i
++) {
12 target
[3 * i
+ 0] = src
[3 * i
+ 2];
13 target
[3 * i
+ 1] = src
[3 * i
+ 1];
14 target
[3 * i
+ 2] = src
[3 * i
+ 0];
17 memcpy(target
, src
, 3 * width
);
21 void pixel_format_rgb24
<uvswap
>::decode(uint32_t* target
, const uint8_t* src
, size_t width
,
22 const pixel_format_aux_palette
<false>& auxp
) throw()
24 for(size_t i
= 0; i
< width
; i
++) {
25 target
[i
] = static_cast<uint32_t>(src
[3 * i
+ (uvswap
? 2 : 0)]) << auxp
.rshift
;
26 target
[i
] |= static_cast<uint32_t>(src
[3 * i
+ 1]) << auxp
.gshift
;
27 target
[i
] |= static_cast<uint32_t>(src
[3 * i
+ (uvswap
? 0 : 2)]) << auxp
.bshift
;
32 void pixel_format_rgb24
<uvswap
>::decode(uint64_t* target
, const uint8_t* src
, size_t width
,
33 const pixel_format_aux_palette
<true>& auxp
) throw()
35 for(size_t i
= 0; i
< width
; i
++) {
36 target
[i
] = static_cast<uint64_t>(src
[3 * i
+ (uvswap
? 2 : 0)]) << auxp
.rshift
;
37 target
[i
] |= static_cast<uint64_t>(src
[3 * i
+ 1]) << auxp
.gshift
;
38 target
[i
] |= static_cast<uint64_t>(src
[3 * i
+ (uvswap
? 0 : 2)]) << auxp
.bshift
;
39 target
[i
] += (target
[i
] << 8);
44 void pixel_format_rgb24
<uvswap
>::set_palette(pixel_format_aux_palette
<false>& auxp
, uint8_t rshift
, uint8_t gshift
,
45 uint8_t bshift
) throw(std::bad_alloc
)
54 void pixel_format_rgb24
<uvswap
>::set_palette(pixel_format_aux_palette
<true>& auxp
, uint8_t rshift
, uint8_t gshift
,
55 uint8_t bshift
) throw(std::bad_alloc
)
64 uint8_t pixel_format_rgb24
<uvswap
>::get_bpp() throw()
70 uint8_t pixel_format_rgb24
<uvswap
>::get_ss_bpp() throw()
76 uint32_t pixel_format_rgb24
<uvswap
>::get_magic() throw()
84 pixel_format_rgb24
<false> _pixel_format_rgb24
;
85 pixel_format_rgb24
<true> _pixel_format_bgr24
;