1 #include "framebuffer-pixfmt-rgb32.hpp"
2 #include "framebuffer.hpp"
6 _pixfmt_rgb32::~_pixfmt_rgb32() throw() {}
8 void _pixfmt_rgb32::decode(uint32_t* target
, const uint8_t* src
, size_t width
) throw()
10 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
11 for(size_t i
= 0; i
< width
; i
++)
15 void _pixfmt_rgb32::decode(uint32_t* target
, const uint8_t* src
, size_t width
,
16 const auxpalette
<false>& auxp
) throw()
18 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
19 for(size_t i
= 0; i
< width
; i
++) {
20 target
[i
] = ((_src
[i
] >> 16) & 0xFF) << auxp
.rshift
;
21 target
[i
] |= ((_src
[i
] >> 8) & 0xFF) << auxp
.gshift
;
22 target
[i
] |= (_src
[i
] & 0xFF) << auxp
.bshift
;
26 void _pixfmt_rgb32::decode(uint64_t* target
, const uint8_t* src
, size_t width
,
27 const auxpalette
<true>& auxp
) throw()
29 const uint32_t* _src
= reinterpret_cast<const uint32_t*>(src
);
30 for(size_t i
= 0; i
< width
; i
++) {
31 target
[i
] = static_cast<uint64_t>((_src
[i
] >> 16) & 0xFF) << auxp
.rshift
;
32 target
[i
] |= static_cast<uint64_t>((_src
[i
] >> 8) & 0xFF) << auxp
.gshift
;
33 target
[i
] |= static_cast<uint64_t>(_src
[i
] & 0xFF) << auxp
.bshift
;
34 target
[i
] += (target
[i
] << 8);
38 void _pixfmt_rgb32::set_palette(auxpalette
<false>& auxp
, uint8_t rshift
, uint8_t gshift
,
39 uint8_t bshift
) throw(std::bad_alloc
)
47 void _pixfmt_rgb32::set_palette(auxpalette
<true>& auxp
, uint8_t rshift
, uint8_t gshift
,
48 uint8_t bshift
) throw(std::bad_alloc
)
56 uint8_t _pixfmt_rgb32::get_bpp() throw()
61 uint8_t _pixfmt_rgb32::get_ss_bpp() throw()
66 uint32_t _pixfmt_rgb32::get_magic() throw()
71 _pixfmt_rgb32 pixfmt_rgb32
;