summaryrefslogtreecommitdiff
path: root/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp')
-rw-r--r--fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp b/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
index cdf1e4caf9..582da85078 100644
--- a/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
@@ -37,7 +37,7 @@ int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(
CBC_CommonByteMatrix* matrix) {
int32_t penalty = 0;
- uint8_t* array = matrix->GetArray();
+ pdfium::span<const uint8_t> array = matrix->GetArray();
int32_t width = matrix->GetWidth();
int32_t height = matrix->GetHeight();
for (int32_t y = 0; y < height - 1; y++) {
@@ -56,7 +56,7 @@ int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(
CBC_CommonByteMatrix* matrix) {
int32_t penalty = 0;
- uint8_t* array = matrix->GetArray();
+ pdfium::span<const uint8_t> array = matrix->GetArray();
int32_t width = matrix->GetWidth();
int32_t height = matrix->GetHeight();
for (int32_t y = 0; y < height; ++y) {
@@ -108,14 +108,13 @@ int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule4(
CBC_CommonByteMatrix* matrix) {
int32_t numDarkCells = 0;
- uint8_t* array = matrix->GetArray();
+ pdfium::span<const uint8_t> array = matrix->GetArray();
int32_t width = matrix->GetWidth();
int32_t height = matrix->GetHeight();
for (int32_t y = 0; y < height; ++y) {
for (int32_t x = 0; x < width; ++x) {
- if (array[y * width + x] == 1) {
+ if (array[y * width + x] == 1)
numDarkCells += 1;
- }
}
}
int32_t numTotalCells = matrix->GetHeight() * matrix->GetWidth();
@@ -176,7 +175,7 @@ int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1Internal(
int32_t height = matrix->GetHeight();
int32_t iLimit = isHorizontal ? height : width;
int32_t jLimit = isHorizontal ? width : height;
- uint8_t* array = matrix->GetArray();
+ pdfium::span<const uint8_t> array = matrix->GetArray();
for (int32_t i = 0; i < iLimit; ++i) {
for (int32_t j = 0; j < jLimit; ++j) {
int32_t bit = isHorizontal ? array[i * width + j] : array[j * width + i];