diff options
Diffstat (limited to 'fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp')
-rw-r--r-- | fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
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 <algorithm> + 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<uint8_t>& CBC_BarcodeRow::getRow() { |