1 #include "pixfmt-rgb32.hpp"
3 pixel_format_rgb32::~pixel_format_rgb32() throw() {}
5 void pixel_format_rgb32::decode(uint32_t* target
, const uint8_t* src
, size_t width
) throw()
7 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
8 for(size_t i
= 0; i
< width
; i
++)
12 void pixel_format_rgb32::decode(uint32_t* target
, const uint8_t* src
, size_t width
,
13 const pixel_format_aux_palette
<false>& auxp
) throw()
15 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
16 for(size_t i
= 0; i
< width
; i
++) {
17 target
[i
] = ((_src
[i
] >> 16) & 0xFF) << auxp
.rshift
;
18 target
[i
] |= ((_src
[i
] >> 8) & 0xFF) << auxp
.gshift
;
19 target
[i
] |= (_src
[i
] & 0xFF) << auxp
.bshift
;
23 void pixel_format_rgb32::decode(uint64_t* target
, const uint8_t* src
, size_t width
,
24 const pixel_format_aux_palette
<true>& auxp
) throw()
26 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
27 for(size_t i
= 0; i
< width
; i
++) {
28 target
[i
] = static_cast<uint64_t>((_src
[i
] >> 16) & 0xFF) << auxp
.rshift
;
29 target
[i
] |= static_cast<uint64_t>((_src
[i
] >> 8) & 0xFF) << auxp
.gshift
;
30 target
[i
] |= static_cast<uint64_t>(_src
[i
] & 0xFF) << auxp
.bshift
;
31 target
[i
] += (target
[i
] << 8);
35 void pixel_format_rgb32::set_palette(pixel_format_aux_palette
<false>& auxp
, uint8_t rshift
, uint8_t gshift
,
36 uint8_t bshift
) throw(std::bad_alloc
)
44 void pixel_format_rgb32::set_palette(pixel_format_aux_palette
<true>& auxp
, uint8_t rshift
, uint8_t gshift
,
45 uint8_t bshift
) throw(std::bad_alloc
)
53 uint8_t pixel_format_rgb32::get_bpp() throw()
58 uint8_t pixel_format_rgb32::get_ss_bpp() throw()
63 uint32_t pixel_format_rgb32::get_magic() throw()
68 pixel_format_rgb32 _pixel_format_rgb32
;