13 uint32_t Rmask_, uint8_t Rshift_, uint8_t Rloss_,
14 uint32_t Gmask_, uint8_t Gshift_, uint8_t Gloss_,
15 uint32_t Bmask_, uint8_t Bshift_, uint8_t Bloss_,
16 uint32_t Amask_, uint8_t Ashift_, uint8_t Aloss_)
17 : Rmask (Rmask_), Gmask (Gmask_), Bmask (Bmask_), Amask (Amask_)
18 , Rshift(Rshift_), Gshift(Gshift_), Bshift(Bshift_), Ashift(Ashift_)
19 , Rloss (Rloss_), Gloss (Gloss_), Bloss (Bloss_), Aloss (Aloss_)
20 , bpp(bpp_), bytesPerPixel((bpp + 7) / 8) {}
22 [[nodiscard]]
unsigned getBpp()
const {
return bpp; }
25 [[nodiscard]]
unsigned getRmask()
const {
return Rmask; }
26 [[nodiscard]]
unsigned getGmask()
const {
return Gmask; }
27 [[nodiscard]]
unsigned getBmask()
const {
return Bmask; }
28 [[nodiscard]]
unsigned getAmask()
const {
return Amask; }
30 [[nodiscard]]
unsigned getRshift()
const {
return Rshift; }
31 [[nodiscard]]
unsigned getGshift()
const {
return Gshift; }
32 [[nodiscard]]
unsigned getBshift()
const {
return Bshift; }
33 [[nodiscard]]
unsigned getAshift()
const {
return Ashift; }
35 [[nodiscard]]
unsigned getRloss()
const {
return Rloss; }
36 [[nodiscard]]
unsigned getGloss()
const {
return Gloss; }
37 [[nodiscard]]
unsigned getBloss()
const {
return Bloss; }
38 [[nodiscard]]
unsigned getAloss()
const {
return Aloss; }
40 [[nodiscard]]
unsigned map(
unsigned r,
unsigned g,
unsigned b)
const
42 return ((r >> Rloss) << Rshift) |
43 ((
g >> Gloss) << Gshift) |
44 ((b >> Bloss) << Bshift) |
49 uint32_t Rmask, Gmask, Bmask, Amask;
50 uint8_t Rshift, Gshift, Bshift, Ashift;
51 uint8_t Rloss, Gloss, Bloss, Aloss;
52 uint8_t bpp, bytesPerPixel;