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

Function readCrc

sources/lut-calibrator/BoardUtils.cpp:135–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 int readCrc(const Image<ColorRgb>& yuvImage, int line, CapturedColor& white)
136 {
137 int boardIndex = 0;
138 int x = 0;
139
140 for (int i = 0; i < SCREEN_CRC_COUNT; i++, x += 2)
141 {
142 auto test = readBlock(yuvImage, int2(x, line));
143 if (test.Y() + SCREEN_MAX_CRC_BRIGHTNESS_ERROR < white.Y())
144 throw std::runtime_error("Invalid CRC header");
145 }
146
147 while (true && x < SCREEN_BLOCKS_X)
148 {
149 auto test = readBlock(yuvImage, int2(x, line));
150 if (test.Y() + SCREEN_MAX_CRC_BRIGHTNESS_ERROR < white.Y())
151 break;
152 boardIndex++;
153 x += 2;
154 }
155
156 return boardIndex;
157 }
158
159 bool parseBoard(Logger* _log, const Image<ColorRgb>& yuvImage, int& boardIndex, CapturedColors& allColors, bool multiFrame)
160 {

Callers 1

parseBoardFunction · 0.85

Calls 2

readBlockFunction · 0.85
int2Class · 0.85

Tested by

no test coverage detected