From c47ba8ece5d73651dd966fd420ba00da2f9c6ad8 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 22 Aug 2018 17:22:17 +0000 Subject: Remove unused setters in CBC_BarcodeMatrix and CBC_BarcodeRow. Change-Id: I01c83d96f07eac776e8269b7d1e06b2b07ca75ea Reviewed-on: https://pdfium-review.googlesource.com/40932 Reviewed-by: Lei Zhang Commit-Queue: Henrique Nakashima --- fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp | 9 +++------ fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h | 2 -- fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 14 ++++---------- fxbarcode/pdf417/BC_PDF417BarcodeRow.h | 2 -- 4 files changed, 7 insertions(+), 20 deletions(-) (limited to 'fxbarcode') diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp index ebedbf6197..58357b22de 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -38,21 +38,18 @@ CBC_BarcodeMatrix::CBC_BarcodeMatrix(int32_t height, int32_t width) { CBC_BarcodeMatrix::~CBC_BarcodeMatrix() {} -void CBC_BarcodeMatrix::set(int32_t x, int32_t y, uint8_t value) { - m_matrix[y]->set(x, value); -} -void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, bool black) { - set(x, y, (uint8_t)(black ? 1 : 0)); -} void CBC_BarcodeMatrix::nextRow() { ++m_currentRow; } + 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; diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index 4f6591ed55..38744471ba 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -21,8 +21,6 @@ class CBC_BarcodeMatrix { CBC_BarcodeRow* getCurrentRow() const { return m_matrix[m_currentRow].get(); } int32_t getWidth() const { return m_outWidth; } int32_t getHeight() const { return m_outHeight; } - void set(int32_t x, int32_t y, uint8_t value); - void setMatrix(int32_t x, int32_t y, bool black); void nextRow(); std::vector& getMatrix(); std::vector& getScaledMatrix(int32_t scale); diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp index c0c251f708..ee54a273dd 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -22,22 +22,16 @@ #include "fxbarcode/pdf417/BC_PDF417BarcodeRow.h" +#include + CBC_BarcodeRow::CBC_BarcodeRow(size_t width) : m_row(width), m_currentLocation(0) {} CBC_BarcodeRow::~CBC_BarcodeRow() {} -void CBC_BarcodeRow::set(int32_t x, uint8_t value) { - m_row[x] = value; -} - -void CBC_BarcodeRow::set(int32_t x, bool black) { - m_row[x] = black ? 1 : 0; -} - void CBC_BarcodeRow::addBar(bool black, int32_t width) { - for (int32_t ii = 0; ii < width; ii++) - set(m_currentLocation++, black); + std::fill_n(m_row.begin() + m_currentLocation, width, black ? 1 : 0); + m_currentLocation += width; } std::vector& CBC_BarcodeRow::getRow() { diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index d49d0eb9c2..a07d5770b3 100644 --- a/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -16,8 +16,6 @@ class CBC_BarcodeRow { explicit CBC_BarcodeRow(size_t width); virtual ~CBC_BarcodeRow(); - void set(int32_t x, uint8_t value); - void set(int32_t x, bool black); void addBar(bool black, int32_t width); std::vector& getRow(); std::vector& getScaledRow(int32_t scale); -- cgit v1.2.3