summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-08-22 21:11:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-22 21:11:36 +0000
commitbd6db24c0b78831542656ce8c3268fc55394df01 (patch)
treece6f68fe01d146d5af9decfd19d232a6d0481b8e
parent15f1a88dece664ae7300d9a60fe124cec1f2b9de (diff)
downloadpdfium-bd6db24c0b78831542656ce8c3268fc55394df01.tar.xz
Remove unused barcode matrix scaling code.
Change-Id: Id15088a40fd308ba91317e95a6fa8075e7306608 Reviewed-on: https://pdfium-review.googlesource.com/40992 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
-rw-r--r--fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp15
-rw-r--r--fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h2
-rw-r--r--fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp7
-rw-r--r--fxbarcode/pdf417/BC_PDF417BarcodeRow.h2
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;
};