diff options
-rw-r--r-- | fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp | 15 | ||||
-rw-r--r-- | fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h | 2 | ||||
-rw-r--r-- | fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 7 | ||||
-rw-r--r-- | 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<uint8_t>& CBC_BarcodeMatrix::getMatrix() { - return getScaledMatrix(1, 1); -} - -std::vector<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) { - return getScaledMatrix(scale, scale); -} - -std::vector<uint8_t>& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale, - int32_t yScale) { - size_t yMax = m_height * yScale; - std::vector<uint8_t> bytearray = m_matrix[0]->getScaledRow(xScale); + std::vector<uint8_t> 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<uint8_t>& getMatrix(); - std::vector<uint8_t>& getScaledMatrix(int32_t scale); - std::vector<uint8_t>& getScaledMatrix(int32_t xScale, int32_t yScale); private: std::vector<std::unique_ptr<CBC_BarcodeRow>> 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<uint8_t>& CBC_BarcodeRow::getRow() { return m_row; } - -std::vector<uint8_t>& 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<uint8_t>& getRow(); - std::vector<uint8_t>& getScaledRow(int32_t scale); private: std::vector<uint8_t> m_row; - std::vector<uint8_t> m_output; int32_t m_currentLocation; }; |