1 #include "framebuffer-pixfmt-rgb32.hpp"
5 _pixfmt_rgb32::~_pixfmt_rgb32() throw() {}
7 void _pixfmt_rgb32::decode(uint32_t* target
, const uint8_t* src
, size_t width
) throw()
9 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
10 for(size_t i
= 0; i
< width
; i
++)
14 void _pixfmt_rgb32::decode(uint32_t* target
, const uint8_t* src
, size_t width
,
15 const auxpalette
<false>& auxp
) throw()
17 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
18 for(size_t i
= 0; i
< width
; i
++) {
19 target
[i
] = ((_src
[i
] >> 16) & 0xFF) << auxp
.rshift
;
20 target
[i
] |= ((_src
[i
] >> 8) & 0xFF) << auxp
.gshift
;
21 target
[i
] |= (_src
[i
] & 0xFF) << auxp
.bshift
;
25 void _pixfmt_rgb32::decode(uint64_t* target
, const uint8_t* src
, size_t width
,
26 const auxpalette
<true>& auxp
) throw()
28 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
29 for(size_t i
= 0; i
< width
; i
++) {
30 target
[i
] = static_cast<uint64_t>((_src
[i
] >> 16) & 0xFF) << auxp
.rshift
;
31 target
[i
] |= static_cast<uint64_t>((_src
[i
] >> 8) & 0xFF) << auxp
.gshift
;
32 target
[i
] |= static_cast<uint64_t>(_src
[i
] & 0xFF) << auxp
.bshift
;
33 target
[i
] += (target
[i
] << 8);
37 void _pixfmt_rgb32::set_palette(auxpalette
<false>& auxp
, uint8_t rshift
, uint8_t gshift
,
38 uint8_t bshift
) throw(std::bad_alloc
)
46 void _pixfmt_rgb32::set_palette(auxpalette
<true>& auxp
, uint8_t rshift
, uint8_t gshift
,
47 uint8_t bshift
) throw(std::bad_alloc
)
55 uint8_t _pixfmt_rgb32::get_bpp() throw()
60 uint8_t _pixfmt_rgb32::get_ss_bpp() throw()
65 uint32_t _pixfmt_rgb32::get_magic() throw()
70 _pixfmt_rgb32 pixfmt_rgb32
;