summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp')
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
index e6bab5a65e..57c6cc92d2 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
@@ -23,25 +23,25 @@
#include "../barcode.h"
#include "BC_Encoder.h"
#include "BC_DefaultPlacement.h"
-CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows)
+CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows)
{
m_codewords = codewords;
m_numcols = numcols;
m_numrows = numrows;
m_bits.SetSize(numcols * numrows);
- for (FX_INT32 i = 0; i < numcols * numrows; i++) {
- m_bits[i] = (FX_BYTE) 2;
+ for (int32_t i = 0; i < numcols * numrows; i++) {
+ m_bits[i] = (uint8_t) 2;
}
}
CBC_DefaultPlacement::~CBC_DefaultPlacement()
{
m_bits.RemoveAll();
}
-FX_INT32 CBC_DefaultPlacement::getNumrows()
+int32_t CBC_DefaultPlacement::getNumrows()
{
return m_numrows;
}
-FX_INT32 CBC_DefaultPlacement::getNumcols()
+int32_t CBC_DefaultPlacement::getNumcols()
{
return m_numcols;
}
@@ -49,23 +49,23 @@ CFX_ByteArray& CBC_DefaultPlacement::getBits()
{
return m_bits;
}
-FX_BOOL CBC_DefaultPlacement::getBit(FX_INT32 col, FX_INT32 row)
+FX_BOOL CBC_DefaultPlacement::getBit(int32_t col, int32_t row)
{
return m_bits[row * m_numcols + col] == 1;
}
-void CBC_DefaultPlacement::setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit)
+void CBC_DefaultPlacement::setBit(int32_t col, int32_t row, FX_BOOL bit)
{
- m_bits[row * m_numcols + col] = bit ? (FX_BYTE) 1 : (FX_BYTE) 0;
+ m_bits[row * m_numcols + col] = bit ? (uint8_t) 1 : (uint8_t) 0;
}
-FX_BOOL CBC_DefaultPlacement::hasBit(FX_INT32 col, FX_INT32 row)
+FX_BOOL CBC_DefaultPlacement::hasBit(int32_t col, int32_t row)
{
return m_bits[row * m_numcols + col] != 2;
}
void CBC_DefaultPlacement::place()
{
- FX_INT32 pos = 0;
- FX_INT32 row = 4;
- FX_INT32 col = 0;
+ int32_t pos = 0;
+ int32_t row = 4;
+ int32_t col = 0;
do {
if ((row == m_numrows) && (col == 0)) {
corner1(pos++);
@@ -103,7 +103,7 @@ void CBC_DefaultPlacement::place()
setBit(m_numcols - 2, m_numrows - 2, TRUE);
}
}
-void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit)
+void CBC_DefaultPlacement::module(int32_t row, int32_t col, int32_t pos, int32_t bit)
{
if (row < 0) {
row += m_numrows;
@@ -113,11 +113,11 @@ void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_I
col += m_numcols;
row += 4 - ((m_numcols + 4) % 8);
}
- FX_INT32 v = m_codewords.GetAt(pos);
+ int32_t v = m_codewords.GetAt(pos);
v &= 1 << (8 - bit);
setBit(col, row, v != 0);
}
-void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos)
+void CBC_DefaultPlacement::utah(int32_t row, int32_t col, int32_t pos)
{
module(row - 2, col - 2, pos, 1);
module(row - 2, col - 1, pos, 2);
@@ -128,7 +128,7 @@ void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos)
module(row, col - 1, pos, 7);
module(row, col, pos, 8);
}
-void CBC_DefaultPlacement::corner1(FX_INT32 pos)
+void CBC_DefaultPlacement::corner1(int32_t pos)
{
module(m_numrows - 1, 0, pos, 1);
module(m_numrows - 1, 1, pos, 2);
@@ -139,7 +139,7 @@ void CBC_DefaultPlacement::corner1(FX_INT32 pos)
module(2, m_numcols - 1, pos, 7);
module(3, m_numcols - 1, pos, 8);
}
-void CBC_DefaultPlacement::corner2(FX_INT32 pos)
+void CBC_DefaultPlacement::corner2(int32_t pos)
{
module(m_numrows - 3, 0, pos, 1);
module(m_numrows - 2, 0, pos, 2);
@@ -150,7 +150,7 @@ void CBC_DefaultPlacement::corner2(FX_INT32 pos)
module(0, m_numcols - 1, pos, 7);
module(1, m_numcols - 1, pos, 8);
}
-void CBC_DefaultPlacement::corner3(FX_INT32 pos)
+void CBC_DefaultPlacement::corner3(int32_t pos)
{
module(m_numrows - 3, 0, pos, 1);
module(m_numrows - 2, 0, pos, 2);
@@ -161,7 +161,7 @@ void CBC_DefaultPlacement::corner3(FX_INT32 pos)
module(2, m_numcols - 1, pos, 7);
module(3, m_numcols - 1, pos, 8);
}
-void CBC_DefaultPlacement::corner4(FX_INT32 pos)
+void CBC_DefaultPlacement::corner4(int32_t pos)
{
module(m_numrows - 1, 0, pos, 1);
module(m_numrows - 1, m_numcols - 1, pos, 2);