47 {
48 uint16_t dstWidth = dstXY.
getWidth();
50
52 "Source width must be double the destination width");
54 "Source height must be double the destination height");
55
56 for (uint16_t
y = 0;
y < dstHeight; ++
y) {
57 for (uint16_t
x = 0;
x < dstWidth; ++
x) {
58
59 uint16_t srcX =
x * 2;
60 uint16_t srcY =
y * 2;
61
62
67
68
69 uint16_t r =
70 (p00.r + p10.r + p01.r + p11.r + 2) / 4;
71 uint16_t g = (p00.g + p10.g + p01.g + p11.g + 2) / 4;
72 uint16_t b = (p00.b + p10.b + p01.b + p11.b + 2) / 4;
73
74
76 CRGB((uint8_t)r, (uint8_t)g, (uint8_t)b);
77 }
78 }
79}
uint16_t getWidth() const
uint16_t mapToIndex(const uint16_t &x, const uint16_t &y) const
uint16_t getHeight() const
Representation of an RGB pixel (Red, Green, Blue)