MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / pleaseWaitForLut

Method pleaseWaitForLut

sources/base/Grabber.cpp:92–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void Grabber::pleaseWaitForLut(bool videoGrabber)
93{
94 Image<ColorRgb> image(_actualWidth, _actualHeight);
95 double sizeX = _actualWidth / 64.0;
96 double sizeY = _actualHeight / 32.0;
97
98 auto timer = InternalClock::now() / 1200;
99
100 ColorRgb fgColor, bgColor;
101
102 if (timer % 8 < 2)
103 {
104 bgColor = ColorRgb::WHITE;
105 fgColor = ColorRgb::BLACK;
106 }
107 else if (timer % 8 < 4)
108 {
109 bgColor = ColorRgb::RED;
110 fgColor = ColorRgb::BLACK;
111 }
112 else if (timer % 8 < 6)
113 {
114 bgColor = ColorRgb::GREEN;
115 fgColor = ColorRgb::BLACK;
116 }
117 else
118 {
119 bgColor = ColorRgb::BLUE;
120 fgColor = ColorRgb::WHITE;
121 }
122
123 image.fastBox(0, 0, image.width(), image.height(), bgColor.red, bgColor.green, bgColor.blue);
124
125 for (int y = 0; y < 32; y++)
126 for (int x = 0; x < 64; x++)
127 {
128 int index = (31 - y) * 8 + (x / 8);
129 uint8_t bit = 1 << (7 - (x % 8));
130 if (index < static_cast<int>(sizeof(pleasewait)) && !(pleasewait[index] & bit))
131 {
132 int fromX = sizeX * x;
133 int fromY = sizeY * y;
134 image.fastBox(fromX, fromY, fromX + sizeX, fromY + sizeY, fgColor.red, fgColor.green, fgColor.blue);
135 }
136 }
137
138 if (videoGrabber)
139 {
140 emit GlobalSignals::getInstance()->SignalNewVideoImage(_deviceName, image);
141 }
142 else
143 {
144 emit GlobalSignals::getInstance()->SignalNewSystemImage(_deviceName, image);
145 }
146
147 emit GlobalSignals::getInstance()->SignalLutRequest();
148}
149

Callers

nothing calls this directly

Calls 3

fastBoxMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected