Lines Matching refs:matrix
98 CBC_CommonByteMatrix* matrix) { in EmbedDataBits() argument
101 int32_t x = matrix->GetWidth() - 1; in EmbedDataBits()
102 int32_t y = matrix->GetHeight() - 1; in EmbedDataBits()
107 while (y >= 0 && y < matrix->GetHeight()) { in EmbedDataBits()
114 if (!IsEmpty(matrix->Get(xx, y))) { in EmbedDataBits()
127 matrix->Set(xx, y, bit); in EmbedDataBits()
175 CBC_CommonByteMatrix* matrix) { in EmbedTypeInfo() argument
184 matrix->Set(x1, y1, bit); in EmbedTypeInfo()
186 int32_t x2 = matrix->GetWidth() - i - 1; in EmbedTypeInfo()
188 matrix->Set(x2, y2, bit); in EmbedTypeInfo()
191 int32_t y2 = matrix->GetHeight() - 7 + (i - 8); in EmbedTypeInfo()
192 matrix->Set(x2, y2, bit); in EmbedTypeInfo()
198 void MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix) { in MaybeEmbedVersionInfo() argument
209 matrix->Set(i, matrix->GetHeight() - 11 + j, bit); in MaybeEmbedVersionInfo()
210 matrix->Set(matrix->GetHeight() - 11 + j, i, bit); in MaybeEmbedVersionInfo()
215 bool EmbedTimingPatterns(CBC_CommonByteMatrix* matrix) { in EmbedTimingPatterns() argument
216 for (int32_t i = 8; i < matrix->GetWidth() - 8; i++) { in EmbedTimingPatterns()
218 if (!IsValidValue(matrix->Get(i, 6))) in EmbedTimingPatterns()
221 if (IsEmpty(matrix->Get(i, 6))) in EmbedTimingPatterns()
222 matrix->Set(i, 6, bit); in EmbedTimingPatterns()
224 if (!IsValidValue(matrix->Get(6, i))) in EmbedTimingPatterns()
227 if (IsEmpty(matrix->Get(6, i))) in EmbedTimingPatterns()
228 matrix->Set(6, i, bit); in EmbedTimingPatterns()
233 bool EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix) { in EmbedDarkDotAtLeftBottomCorner() argument
234 if (matrix->Get(8, matrix->GetHeight() - 8) == 0) in EmbedDarkDotAtLeftBottomCorner()
237 matrix->Set(8, matrix->GetHeight() - 8, 1); in EmbedDarkDotAtLeftBottomCorner()
243 CBC_CommonByteMatrix* matrix) { in EmbedHorizontalSeparationPattern() argument
245 if (!IsEmpty(matrix->Get(xStart + x, yStart))) in EmbedHorizontalSeparationPattern()
248 matrix->Set(xStart + x, yStart, 0); in EmbedHorizontalSeparationPattern()
255 CBC_CommonByteMatrix* matrix) { in EmbedVerticalSeparationPattern() argument
257 if (!IsEmpty(matrix->Get(xStart, yStart + y))) in EmbedVerticalSeparationPattern()
260 matrix->Set(xStart, yStart + y, 0); in EmbedVerticalSeparationPattern()
267 CBC_CommonByteMatrix* matrix) { in EmbedPositionAdjustmentPattern() argument
270 if (!IsEmpty(matrix->Get(xStart + x, y + yStart))) in EmbedPositionAdjustmentPattern()
273 matrix->Set(xStart + x, yStart + y, POSITION_ADJUSTMENT_PATTERN[y][x]); in EmbedPositionAdjustmentPattern()
281 CBC_CommonByteMatrix* matrix) { in EmbedPositionDetectionPattern() argument
284 if (!IsEmpty(matrix->Get(xStart + x, yStart + y))) in EmbedPositionDetectionPattern()
287 matrix->Set(xStart + x, yStart + y, POSITION_DETECTION_PATTERN[y][x]); in EmbedPositionDetectionPattern()
293 bool EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix) { in EmbedPositionDetectionPatternsAndSeparators() argument
295 if (!EmbedPositionDetectionPattern(0, 0, matrix)) in EmbedPositionDetectionPatternsAndSeparators()
297 if (!EmbedPositionDetectionPattern(matrix->GetWidth() - pdpWidth, 0, matrix)) in EmbedPositionDetectionPatternsAndSeparators()
299 if (!EmbedPositionDetectionPattern(0, matrix->GetWidth() - pdpWidth, matrix)) in EmbedPositionDetectionPatternsAndSeparators()
303 if (!EmbedHorizontalSeparationPattern(0, hspWidth - 1, matrix)) in EmbedPositionDetectionPatternsAndSeparators()
305 if (!EmbedHorizontalSeparationPattern(matrix->GetWidth() - hspWidth, in EmbedPositionDetectionPatternsAndSeparators()
306 hspWidth - 1, matrix)) { in EmbedPositionDetectionPatternsAndSeparators()
309 if (!EmbedHorizontalSeparationPattern(0, matrix->GetWidth() - hspWidth, in EmbedPositionDetectionPatternsAndSeparators()
310 matrix)) { in EmbedPositionDetectionPatternsAndSeparators()
315 if (!EmbedVerticalSeparationPattern(vspSize, 0, matrix)) in EmbedPositionDetectionPatternsAndSeparators()
317 if (!EmbedVerticalSeparationPattern(matrix->GetHeight() - vspSize - 1, 0, in EmbedPositionDetectionPatternsAndSeparators()
318 matrix)) { in EmbedPositionDetectionPatternsAndSeparators()
321 if (!EmbedVerticalSeparationPattern(vspSize, matrix->GetHeight() - vspSize, in EmbedPositionDetectionPatternsAndSeparators()
322 matrix)) { in EmbedPositionDetectionPatternsAndSeparators()
329 CBC_CommonByteMatrix* matrix) { in MaybeEmbedPositionAdjustmentPatterns() argument
347 if (IsEmpty(matrix->Get(x, y))) { in MaybeEmbedPositionAdjustmentPatterns()
348 if (!EmbedPositionAdjustmentPattern(x - 2, y - 2, matrix)) in MaybeEmbedPositionAdjustmentPatterns()
356 bool EmbedBasicPatterns(int32_t version, CBC_CommonByteMatrix* matrix) { in EmbedBasicPatterns() argument
357 if (!EmbedPositionDetectionPatternsAndSeparators(matrix)) in EmbedBasicPatterns()
359 if (!EmbedDarkDotAtLeftBottomCorner(matrix)) in EmbedBasicPatterns()
361 if (!MaybeEmbedPositionAdjustmentPatterns(version, matrix)) in EmbedBasicPatterns()
363 if (!EmbedTimingPatterns(matrix)) in EmbedBasicPatterns()
375 CBC_CommonByteMatrix* matrix) { in BuildMatrix() argument
376 if (!dataBits || !matrix) in BuildMatrix()
379 matrix->clear(0xff); in BuildMatrix()
381 if (!EmbedBasicPatterns(version, matrix)) in BuildMatrix()
383 if (!EmbedTypeInfo(ecLevel, maskPattern, matrix)) in BuildMatrix()
386 MaybeEmbedVersionInfo(version, matrix); in BuildMatrix()
387 return EmbedDataBits(dataBits, maskPattern, matrix); in BuildMatrix()