1 #include "pixfmt-rgb24.hpp"
5 pixel_format_rgb24
<uvswap
>::~pixel_format_rgb24() throw() {}
8 void pixel_format_rgb24
<uvswap
>::decode(uint32_t* target
, const uint8_t* src
, size_t width
) throw()
11 for(size_t i
= 0; i
< width
; i
++) {
12 target
[i
] = (uint32_t)src
[3 * i
+ 2] << 16;
13 target
[i
] |= (uint32_t)src
[3 * i
+ 1] << 8;
14 target
[i
] |= src
[3 * i
+ 0];
17 for(size_t i
= 0; i
< width
; i
++) {
18 target
[i
] = (uint32_t)src
[3 * i
+ 0] << 16;
19 target
[i
] |= (uint32_t)src
[3 * i
+ 1] << 8;
20 target
[i
] |= src
[3 * i
+ 2];
26 void pixel_format_rgb24
<uvswap
>::decode(uint32_t* target
, const uint8_t* src
, size_t width
,
27 const pixel_format_aux_palette
<false>& auxp
) throw()
29 for(size_t i
= 0; i
< width
; i
++) {
30 target
[i
] = static_cast<uint32_t>(src
[3 * i
+ (uvswap
? 2 : 0)]) << auxp
.rshift
;
31 target
[i
] |= static_cast<uint32_t>(src
[3 * i
+ 1]) << auxp
.gshift
;
32 target
[i
] |= static_cast<uint32_t>(src
[3 * i
+ (uvswap
? 0 : 2)]) << auxp
.bshift
;
37 void pixel_format_rgb24
<uvswap
>::decode(uint64_t* target
, const uint8_t* src
, size_t width
,
38 const pixel_format_aux_palette
<true>& auxp
) throw()
40 for(size_t i
= 0; i
< width
; i
++) {
41 target
[i
] = static_cast<uint64_t>(src
[3 * i
+ (uvswap
? 2 : 0)]) << auxp
.rshift
;
42 target
[i
] |= static_cast<uint64_t>(src
[3 * i
+ 1]) << auxp
.gshift
;
43 target
[i
] |= static_cast<uint64_t>(src
[3 * i
+ (uvswap
? 0 : 2)]) << auxp
.bshift
;
44 target
[i
] += (target
[i
] << 8);
49 void pixel_format_rgb24
<uvswap
>::set_palette(pixel_format_aux_palette
<false>& auxp
, uint8_t rshift
, uint8_t gshift
,
50 uint8_t bshift
) throw(std::bad_alloc
)
59 void pixel_format_rgb24
<uvswap
>::set_palette(pixel_format_aux_palette
<true>& auxp
, uint8_t rshift
, uint8_t gshift
,
60 uint8_t bshift
) throw(std::bad_alloc
)
69 uint8_t pixel_format_rgb24
<uvswap
>::get_bpp() throw()
75 uint8_t pixel_format_rgb24
<uvswap
>::get_ss_bpp() throw()
81 uint32_t pixel_format_rgb24
<uvswap
>::get_magic() throw()
89 pixel_format_rgb24
<false> _pixel_format_rgb24
;
90 pixel_format_rgb24
<true> _pixel_format_bgr24
;