MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / FillCheckeredBitmap

Function FillCheckeredBitmap

Xaml/Controls/colorpickerrendering.hpp:60–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60constexpr void FillCheckeredBitmap(uint8_t *bgraPixelData, int32_t width, int32_t height, double renderScale, Util::Color checkerColor, bool invert) noexcept
61{
62 for (int y = 0; y < height; y++)
63 {
64 const int32_t pixelRowIndex = width * y;
65
66 for (int x = 0; x < width; x++)
67 {
68 const auto rgbColor = GetCheckerPixelColor(x, y, checkerColor, renderScale, invert);
69
70 const int32_t pixelDataIndex = 4 * (x + pixelRowIndex);
71
72 bgraPixelData[pixelDataIndex + 0] = rgbColor.B;
73 bgraPixelData[pixelDataIndex + 1] = rgbColor.G;
74 bgraPixelData[pixelDataIndex + 2] = rgbColor.R;
75 bgraPixelData[pixelDataIndex + 3] = rgbColor.A;
76 }
77 }
78}
79
80void FillChannelBitmap(uint8_t *bgraPixelData, int32_t width, int32_t height, double renderScale, wuxc::Orientation orientation, txmp::ColorRepresentation colorRepresentation, txmp::ColorChannel channel, Util::HsvColor baseHsvColor, Util::Color checkerColor, bool isAlphaMaxForced, bool isSaturationValueMaxForced);
81Util::Color GetChannelPixelColor(double channelValue, txmp::ColorChannel channel, txmp::ColorRepresentation representation, Util::HsvColor baseHsvColor, Util::Color baseRgbColor);

Callers 1

Calls 1

GetCheckerPixelColorFunction · 0.85

Tested by

no test coverage detected