From bd6db24c0b78831542656ce8c3268fc55394df01 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 22 Aug 2018 21:11:36 +0000 Subject: Remove unused barcode matrix scaling code. Change-Id: Id15088a40fd308ba91317e95a6fa8075e7306608 Reviewed-on: https://pdfium-review.googlesource.com/40992 Reviewed-by: Ryan Harrison Commit-Queue: Henrique Nakashima --- fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp | 15 +++------------ fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h | 2 -- fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 7 ------- fxbarcode/pdf417/BC_PDF417BarcodeRow.h | 2 -- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp index 58357b22de..4fc55a2d10 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -43,25 +43,16 @@ void CBC_BarcodeMatrix::nextRow() { } std::vector& CBC_BarcodeMatrix::getMatrix() { - return getScaledMatrix(1, 1); -} - -std::vector& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) { - return getScaledMatrix(scale, scale); -} - -std::vector& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale, - int32_t yScale) { - size_t yMax = m_height * yScale; - std::vector bytearray = m_matrix[0]->getScaledRow(xScale); + std::vector bytearray = m_matrix[0]->getRow(); size_t xMax = bytearray.size(); + size_t yMax = m_height; m_matrixOut.resize(xMax * yMax); m_outWidth = xMax; m_outHeight = yMax; int32_t k = 0; for (size_t i = 0; i < yMax; i++) { if (i != 0) - bytearray = m_matrix[i / yScale]->getScaledRow(xScale); + bytearray = m_matrix[i]->getRow(); k = i * xMax; for (size_t l = 0; l < xMax; l++) m_matrixOut[k + l] = bytearray[l]; diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index 38744471ba..43906d8821 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -23,8 +23,6 @@ class CBC_BarcodeMatrix { int32_t getHeight() const { return m_outHeight; } void nextRow(); std::vector& getMatrix(); - std::vector& getScaledMatrix(int32_t scale); - std::vector& getScaledMatrix(int32_t xScale, int32_t yScale); private: std::vector> m_matrix; diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp index ee54a273dd..65c27de7e7 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -37,10 +37,3 @@ void CBC_BarcodeRow::addBar(bool black, int32_t width) { std::vector& CBC_BarcodeRow::getRow() { return m_row; } - -std::vector& CBC_BarcodeRow::getScaledRow(int32_t scale) { - m_output.resize(m_row.size() * scale); - for (size_t i = 0; i < m_output.size(); i++) - m_output[i] = m_row[i / scale]; - return m_output; -} diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index a07d5770b3..4709420111 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -18,11 +18,9 @@ class CBC_BarcodeRow { void addBar(bool black, int32_t width); std::vector& getRow(); - std::vector& getScaledRow(int32_t scale); private: std::vector m_row; - std::vector m_output; int32_t m_currentLocation; }; -- cgit v1.2.3