8 template<
typename Pixel>
class PixelOperations;
26 [[nodiscard]]
inline uint32_t
mul32(uint32_t p)
const
28 return ((((p & 0x00FF00FF) * factor) & 0xFF00FF00) >> 8)
29 | ((((p >> 8) & 0x00FF00FF) * factor) & 0xFF00FF00);
32 [[nodiscard]]
inline uint32_t
conv32(uint32_t p)
const
44 [[nodiscard]]
inline uint32_t rotRight(uint32_t a,
unsigned n)
const
46 return (a >> n) | (a << (32 - n));
52 void setFactor32(
unsigned factor);
54 [[nodiscard]]
inline uint32_t
mul32(uint16_t p)
const
59 [[nodiscard]]
inline uint16_t
conv32(uint32_t p)
const
61 return (rotRight(p, Rshift3) & Rmask1) |
62 (rotRight(p, Gshift3) & Gmask1) |
63 (rotRight(p, Bshift3) & Bmask1);
67 uint32_t tab[0x10000];
69 unsigned Rshift1, Gshift1, Bshift1;
70 unsigned Rshift2, Gshift2, Bshift2;
71 unsigned Rshift3, Gshift3, Bshift3;
72 uint16_t Rmask1, Gmask1, Bmask1;
73 uint16_t Rmask2, Gmask2, Bmask2;
uint16_t conv32(uint32_t p) const
uint32_t mul32(uint16_t p) const
uint32_t mul32(uint32_t p) const
uint32_t conv32(uint32_t p) const
void setFactor32(unsigned f)
Helper class to perform 'pixel x scalar' calculations.
void format(SectorAccessibleDisk &disk, bool dos1)
Format the given disk (= a single partition).
This file implemented 3 utility functions: