summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp')
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
index 243af70d94..427da9d588 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
@@ -22,32 +22,31 @@
#include "xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h"
-CBC_BarcodeRow::CBC_BarcodeRow(int32_t width) {
- m_row.SetSize(width);
- m_currentLocation = 0;
-}
-CBC_BarcodeRow::~CBC_BarcodeRow() {
- m_output.RemoveAll();
- m_row.RemoveAll();
-}
+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.SetAt(x, value);
+ m_row[x] = value;
}
+
void CBC_BarcodeRow::set(int32_t x, bool black) {
- m_row.SetAt(x, (uint8_t)(black ? 1 : 0));
+ m_row[x] = black ? 1 : 0;
}
+
void CBC_BarcodeRow::addBar(bool black, int32_t width) {
- for (int32_t ii = 0; ii < width; ii++) {
+ for (int32_t ii = 0; ii < width; ii++)
set(m_currentLocation++, black);
- }
}
-CFX_ArrayTemplate<uint8_t>& CBC_BarcodeRow::getRow() {
+
+std::vector<uint8_t>& CBC_BarcodeRow::getRow() {
return m_row;
}
-CFX_ArrayTemplate<uint8_t>& CBC_BarcodeRow::getScaledRow(int32_t scale) {
- m_output.SetSize(m_row.GetSize() * scale);
- for (int32_t i = 0; i < m_output.GetSize(); i++) {
- m_output[i] = (m_row[i / scale]);
- }
+
+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;
}