summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/common
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
commitbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch)
tree4cfbe682869d89900f33751c37f6a84865beeb0a /xfa/src/fxbarcode/common
parentb116136da234afcad018bb44a3ccb64b9ad2a554 (diff)
downloadpdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz
Merge to XFA: Use stdint.h types throughout PDFium.
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
Diffstat (limited to 'xfa/src/fxbarcode/common')
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitArray.cpp44
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitArray.h20
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp68
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitMatrix.h38
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitSource.cpp20
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitSource.h10
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonByteArray.cpp36
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonByteArray.h24
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp24
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonByteMatrix.h22
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp6
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h8
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp4
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonDecoderResult.h4
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonECI.cpp6
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonECI.h8
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp4
-rw-r--r--xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp82
-rw-r--r--xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h8
-rw-r--r--xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp50
-rw-r--r--xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h28
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp20
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h4
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp46
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h8
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp20
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h18
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp70
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h22
29 files changed, 361 insertions, 361 deletions
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp
index 6263affbe8..a73fd37148 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp
@@ -32,7 +32,7 @@ CBC_CommonBitArray::CBC_CommonBitArray()
m_bits.SetSize(1);
m_size = 0;
}
-CBC_CommonBitArray::CBC_CommonBitArray(FX_INT32 size)
+CBC_CommonBitArray::CBC_CommonBitArray(int32_t size)
{
m_bits.SetSize((size + 31) >> 5);
m_size = size;
@@ -41,7 +41,7 @@ CBC_CommonBitArray::~CBC_CommonBitArray()
{
m_size = 0;
}
-FX_INT32 CBC_CommonBitArray::GetSize()
+int32_t CBC_CommonBitArray::GetSize()
{
return m_size;
}
@@ -49,31 +49,31 @@ CFX_Int32Array& CBC_CommonBitArray::GetBits()
{
return m_bits;
}
-FX_INT32 CBC_CommonBitArray::GetSizeInBytes()
+int32_t CBC_CommonBitArray::GetSizeInBytes()
{
return (m_size + 7) >> 3;
}
-FX_BOOL CBC_CommonBitArray::Get(FX_INT32 i)
+FX_BOOL CBC_CommonBitArray::Get(int32_t i)
{
return (m_bits[i >> 5] & (1 << (i & 0x1f))) != 0;
}
-void CBC_CommonBitArray::Set(FX_INT32 i)
+void CBC_CommonBitArray::Set(int32_t i)
{
m_bits[i >> 5] |= 1 << (i & 0x1F);
}
-void CBC_CommonBitArray::Flip(FX_INT32 i)
+void CBC_CommonBitArray::Flip(int32_t i)
{
m_bits[i >> 5] ^= 1 << (i & 0x1F);
}
-void CBC_CommonBitArray::SetBulk(FX_INT32 i, FX_INT32 newBits)
+void CBC_CommonBitArray::SetBulk(int32_t i, int32_t newBits)
{
m_bits[i >> 5] = newBits;
}
void CBC_CommonBitArray::Clear()
{
- FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(FX_INT32));
+ FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(int32_t));
}
-FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e)
+FX_BOOL CBC_CommonBitArray::IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t &e)
{
if (end < start) {
e = BCExceptionEndLessThanStart;
@@ -83,18 +83,18 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value,
return TRUE;
}
end--;
- FX_INT32 firstInt = start >> 5;
- FX_INT32 lastInt = end >> 5;
- FX_INT32 i;
+ int32_t firstInt = start >> 5;
+ int32_t lastInt = end >> 5;
+ int32_t i;
for (i = firstInt; i <= lastInt; i++) {
- FX_INT32 firstBit = i > firstInt ? 0 : start & 0x1F;
- FX_INT32 lastBit = i < lastInt ? 31 : end & 0x1F;
- FX_INT32 mask;
+ int32_t firstBit = i > firstInt ? 0 : start & 0x1F;
+ int32_t lastBit = i < lastInt ? 31 : end & 0x1F;
+ int32_t mask;
if (firstBit == 0 && lastBit == 31) {
mask = -1;
} else {
mask = 0;
- for (FX_INT32 j = firstBit; j <= lastBit; j++) {
+ for (int32_t j = firstBit; j <= lastBit; j++) {
mask |= 1 << j;
}
}
@@ -104,21 +104,21 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value,
}
return TRUE;
}
-FX_INT32* CBC_CommonBitArray::GetBitArray()
+int32_t* CBC_CommonBitArray::GetBitArray()
{
return &m_bits[0];
}
void CBC_CommonBitArray::Reverse()
{
- FX_INT32* newBits = FX_Alloc(FX_INT32, m_bits.GetSize());
- FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(FX_INT32));
- FX_INT32 size = m_size;
- FX_INT32 i;
+ int32_t* newBits = FX_Alloc(int32_t, m_bits.GetSize());
+ FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(int32_t));
+ int32_t size = m_size;
+ int32_t i;
for (i = 0; i < size; i++) {
if (Get(size - i - 1)) {
newBits[i >> 5] |= 1 << (i & 0x1F);
}
}
- FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(FX_INT32));
+ FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(int32_t));
FX_Free(newBits);
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.h b/xfa/src/fxbarcode/common/BC_CommonBitArray.h
index d1c8f6d528..32b94f4912 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitArray.h
+++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.h
@@ -10,22 +10,22 @@ class CBC_CommonBitArray
{
public:
CBC_CommonBitArray(CBC_CommonBitArray* array);
- CBC_CommonBitArray(FX_INT32 size);
+ CBC_CommonBitArray(int32_t size);
CBC_CommonBitArray();
virtual ~CBC_CommonBitArray();
- FX_INT32 GetSize();
+ int32_t GetSize();
CFX_Int32Array& GetBits();
- FX_INT32 GetSizeInBytes();
- FX_BOOL Get(FX_INT32 i);
- void Set(FX_INT32 i);
- void Flip(FX_INT32 i);
- void SetBulk(FX_INT32 i, FX_INT32 newBits);
- FX_BOOL IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e);
- FX_INT32 *GetBitArray();
+ int32_t GetSizeInBytes();
+ FX_BOOL Get(int32_t i);
+ void Set(int32_t i);
+ void Flip(int32_t i);
+ void SetBulk(int32_t i, int32_t newBits);
+ FX_BOOL IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t &e);
+ int32_t *GetBitArray();
void Reverse();
void Clear();
private:
- FX_INT32 m_size;
+ int32_t m_size;
CFX_Int32Array m_bits;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp
index df24d1dabb..135dd2ff28 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp
@@ -30,23 +30,23 @@ CBC_CommonBitMatrix::CBC_CommonBitMatrix()
m_rowSize = 0;
m_bits = NULL;
}
-void CBC_CommonBitMatrix::Init(FX_INT32 dimension)
+void CBC_CommonBitMatrix::Init(int32_t dimension)
{
m_width = dimension;
m_height = dimension;
- FX_INT32 rowSize = (m_height + 31) >> 5;
+ int32_t rowSize = (m_height + 31) >> 5;
m_rowSize = rowSize;
- m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height);
- FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));
+ m_bits = FX_Alloc(int32_t, m_rowSize * m_height);
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t));
}
-void CBC_CommonBitMatrix::Init(FX_INT32 width, FX_INT32 height)
+void CBC_CommonBitMatrix::Init(int32_t width, int32_t height)
{
m_width = width;
m_height = height;
- FX_INT32 rowSize = (width + 31) >> 5;
+ int32_t rowSize = (width + 31) >> 5;
m_rowSize = rowSize;
- m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height);
- FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));
+ m_bits = FX_Alloc(int32_t, m_rowSize * m_height);
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t));
}
CBC_CommonBitMatrix::~CBC_CommonBitMatrix()
{
@@ -56,36 +56,36 @@ CBC_CommonBitMatrix::~CBC_CommonBitMatrix()
m_bits = NULL;
m_height = m_width = m_rowSize = 0;
}
-FX_BOOL CBC_CommonBitMatrix::Get(FX_INT32 x, FX_INT32 y)
+FX_BOOL CBC_CommonBitMatrix::Get(int32_t x, int32_t y)
{
- FX_INT32 offset = y * m_rowSize + (x >> 5);
+ int32_t offset = y * m_rowSize + (x >> 5);
if (offset >= m_rowSize * m_height || offset < 0) {
return false;
}
return ((((FX_DWORD)m_bits[offset]) >> (x & 0x1f)) & 1) != 0;
}
-FX_INT32* CBC_CommonBitMatrix::GetBits()
+int32_t* CBC_CommonBitMatrix::GetBits()
{
return m_bits;
}
-void CBC_CommonBitMatrix::Set(FX_INT32 x, FX_INT32 y)
+void CBC_CommonBitMatrix::Set(int32_t x, int32_t y)
{
- FX_INT32 offset = y * m_rowSize + (x >> 5);
+ int32_t offset = y * m_rowSize + (x >> 5);
if (offset >= m_rowSize * m_height || offset < 0) {
return;
}
m_bits[offset] |= 1 << (x & 0x1f);
}
-void CBC_CommonBitMatrix::Flip(FX_INT32 x, FX_INT32 y)
+void CBC_CommonBitMatrix::Flip(int32_t x, int32_t y)
{
- FX_INT32 offset = y * m_rowSize + (x >> 5);
+ int32_t offset = y * m_rowSize + (x >> 5);
m_bits[offset] ^= 1 << (x & 0x1f);
}
void CBC_CommonBitMatrix::Clear()
{
- FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t));
}
-void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e)
+void CBC_CommonBitMatrix::SetRegion(int32_t left, int32_t top, int32_t width, int32_t height, int32_t &e)
{
if (top < 0 || left < 0) {
e = BCExceptionLeftAndTopMustBeNonnegative;
@@ -95,22 +95,22 @@ void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width,
e = BCExceptionHeightAndWidthMustBeAtLeast1;
return;
}
- FX_INT32 right = left + width;
- FX_INT32 bottom = top + height;
+ int32_t right = left + width;
+ int32_t bottom = top + height;
if (m_height < bottom || m_width < right) {
e = BCExceptionRegionMustFitInsideMatrix;
return;
}
- FX_INT32 y;
+ int32_t y;
for (y = top; y < bottom; y++) {
- FX_INT32 offset = y * m_rowSize;
- FX_INT32 x;
+ int32_t offset = y * m_rowSize;
+ int32_t x;
for (x = left; x < right; x++) {
m_bits[offset + (x >> 5)] |= 1 << (x & 0x1f);
}
}
}
-CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray* row)
+CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(int32_t y, CBC_CommonBitArray* row)
{
CBC_CommonBitArray* rowArray = NULL;
if (row == NULL || row->GetSize() < m_width) {
@@ -118,40 +118,40 @@ CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray*
} else {
rowArray = FX_NEW CBC_CommonBitArray(row);
}
- FX_INT32 offset = y * m_rowSize;
- FX_INT32 x;
+ int32_t offset = y * m_rowSize;
+ int32_t x;
for (x = 0; x < m_rowSize; x++) {
rowArray->SetBulk(x << 5, m_bits[offset + x]);
}
return rowArray;
}
-void CBC_CommonBitMatrix::SetRow(FX_INT32 y, CBC_CommonBitArray* row)
+void CBC_CommonBitMatrix::SetRow(int32_t y, CBC_CommonBitArray* row)
{
- FX_INT32 l = y * m_rowSize;
- for (FX_INT32 i = 0; i < m_rowSize; i++) {
+ int32_t l = y * m_rowSize;
+ for (int32_t i = 0; i < m_rowSize; i++) {
m_bits[l] = row->GetBitArray()[i];
l++;
}
}
-void CBC_CommonBitMatrix::SetCol(FX_INT32 y, CBC_CommonBitArray* col)
+void CBC_CommonBitMatrix::SetCol(int32_t y, CBC_CommonBitArray* col)
{
- for (FX_INT32 i = 0; i < col->GetBits().GetSize(); i++) {
+ for (int32_t i = 0; i < col->GetBits().GetSize(); i++) {
m_bits[i * m_rowSize + y] = col->GetBitArray()[i];
}
}
-FX_INT32 CBC_CommonBitMatrix::GetWidth()
+int32_t CBC_CommonBitMatrix::GetWidth()
{
return m_width;
}
-FX_INT32 CBC_CommonBitMatrix::GetHeight()
+int32_t CBC_CommonBitMatrix::GetHeight()
{
return m_height;
}
-FX_INT32 CBC_CommonBitMatrix::GetRowSize()
+int32_t CBC_CommonBitMatrix::GetRowSize()
{
return m_rowSize;
}
-FX_INT32 CBC_CommonBitMatrix::GetDimension(FX_INT32 &e)
+int32_t CBC_CommonBitMatrix::GetDimension(int32_t &e)
{
if (m_width != m_height) {
e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix;
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h
index 8641ef1f63..4c129fdb82 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h
+++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h
@@ -12,26 +12,26 @@ class CBC_CommonBitMatrix
public:
CBC_CommonBitMatrix();
virtual ~CBC_CommonBitMatrix();
- FX_BOOL Get(FX_INT32 x, FX_INT32 y);
- void Set(FX_INT32 x, FX_INT32 y);
- void Flip(FX_INT32 x, FX_INT32 y);
+ FX_BOOL Get(int32_t x, int32_t y);
+ void Set(int32_t x, int32_t y);
+ void Flip(int32_t x, int32_t y);
void Clear();
- void SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e);
- CBC_CommonBitArray* GetRow(FX_INT32 y, CBC_CommonBitArray* row);
- void SetRow(FX_INT32 y, CBC_CommonBitArray* row);
- CBC_CommonBitArray* GetCol(FX_INT32 y, CBC_CommonBitArray* row);
- void SetCol(FX_INT32 y, CBC_CommonBitArray* col);
- FX_INT32 GetWidth();
- FX_INT32 GetHeight();
- FX_INT32 GetRowSize();
- FX_INT32 GetDimension(FX_INT32 &e);
- virtual void Init(FX_INT32 dimension);
- virtual void Init(FX_INT32 width, FX_INT32 height);
- FX_INT32* GetBits();
+ void SetRegion(int32_t left, int32_t top, int32_t width, int32_t height, int32_t &e);
+ CBC_CommonBitArray* GetRow(int32_t y, CBC_CommonBitArray* row);
+ void SetRow(int32_t y, CBC_CommonBitArray* row);
+ CBC_CommonBitArray* GetCol(int32_t y, CBC_CommonBitArray* row);
+ void SetCol(int32_t y, CBC_CommonBitArray* col);
+ int32_t GetWidth();
+ int32_t GetHeight();
+ int32_t GetRowSize();
+ int32_t GetDimension(int32_t &e);
+ virtual void Init(int32_t dimension);
+ virtual void Init(int32_t width, int32_t height);
+ int32_t* GetBits();
private:
- FX_INT32 m_width;
- FX_INT32 m_height;
- FX_INT32 m_rowSize;
- FX_INT32* m_bits;
+ int32_t m_width;
+ int32_t m_height;
+ int32_t m_rowSize;
+ int32_t* m_bits;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
index b71848a60c..f32d634a5a 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
@@ -31,18 +31,18 @@ CBC_CommonBitSource::CBC_CommonBitSource(CFX_ByteArray* bytes)
CBC_CommonBitSource::~CBC_CommonBitSource()
{
}
-FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e)
+int32_t CBC_CommonBitSource::ReadBits(int32_t numBits, int32_t &e)
{
if (numBits < 1 || numBits > 32) {
e = BCExceptionIllegalArgument;
return 0;
}
- FX_INT32 result = 0;
+ int32_t result = 0;
if (m_bitOffset > 0) {
- FX_INT32 bitsLeft = 8 - m_bitOffset;
- FX_INT32 toRead = numBits < bitsLeft ? numBits : bitsLeft;
- FX_INT32 bitsToNotRead = bitsLeft - toRead;
- FX_INT32 mask = (0xff >> (8 - toRead)) << bitsToNotRead;
+ int32_t bitsLeft = 8 - m_bitOffset;
+ int32_t toRead = numBits < bitsLeft ? numBits : bitsLeft;
+ int32_t bitsToNotRead = bitsLeft - toRead;
+ int32_t mask = (0xff >> (8 - toRead)) << bitsToNotRead;
result = (m_bytes[m_byteOffset] & mask) >> bitsToNotRead;
numBits -= toRead;
m_bitOffset += toRead;
@@ -58,19 +58,19 @@ FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e)
numBits -= 8;
}
if (numBits > 0) {
- FX_INT32 bitsToNotRead = 8 - numBits;
- FX_INT32 mask = (0xff >> bitsToNotRead) << bitsToNotRead;
+ int32_t bitsToNotRead = 8 - numBits;
+ int32_t mask = (0xff >> bitsToNotRead) << bitsToNotRead;
result = (result << numBits) | ((m_bytes[m_byteOffset] & mask) >> bitsToNotRead);
m_bitOffset += numBits;
}
}
return result;
}
-FX_INT32 CBC_CommonBitSource::Available()
+int32_t CBC_CommonBitSource::Available()
{
return 8 * (m_bytes.GetSize() - m_byteOffset) - m_bitOffset;
}
-FX_INT32 CBC_CommonBitSource::getByteOffset()
+int32_t CBC_CommonBitSource::getByteOffset()
{
return m_byteOffset;
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.h b/xfa/src/fxbarcode/common/BC_CommonBitSource.h
index f6a5985ae2..278b4b6a1c 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitSource.h
+++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.h
@@ -11,12 +11,12 @@ class CBC_CommonBitSource
public:
CBC_CommonBitSource(CFX_ByteArray *bytes);
virtual ~CBC_CommonBitSource();
- FX_INT32 ReadBits(FX_INT32 numBits, FX_INT32 &e);
- FX_INT32 Available();
- FX_INT32 getByteOffset();
+ int32_t ReadBits(int32_t numBits, int32_t &e);
+ int32_t Available();
+ int32_t getByteOffset();
private:
CFX_ByteArray m_bytes;
- FX_INT32 m_byteOffset;
- FX_INT32 m_bitOffset;
+ int32_t m_byteOffset;
+ int32_t m_bitOffset;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp b/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp
index 99e97d38d8..4b9667e406 100644
--- a/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp
@@ -28,17 +28,17 @@ CBC_CommonByteArray::CBC_CommonByteArray()
m_size = 0;
m_index = 0;
}
-CBC_CommonByteArray::CBC_CommonByteArray(FX_INT32 size)
+CBC_CommonByteArray::CBC_CommonByteArray(int32_t size)
{
m_size = size;
- m_bytes = FX_Alloc(FX_BYTE, size);
+ m_bytes = FX_Alloc(uint8_t, size);
FXSYS_memset32(m_bytes, 0, size);
m_index = 0;
}
-CBC_CommonByteArray::CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size)
+CBC_CommonByteArray::CBC_CommonByteArray(uint8_t* byteArray, int32_t size)
{
m_size = size;
- m_bytes = FX_Alloc(FX_BYTE, size);
+ m_bytes = FX_Alloc(uint8_t, size);
FXSYS_memcpy32(m_bytes, byteArray, size);
m_index = size;
}
@@ -51,15 +51,15 @@ CBC_CommonByteArray::~CBC_CommonByteArray()
m_index = 0;
m_size = 0;
}
-FX_INT32 CBC_CommonByteArray::At(FX_INT32 index)
+int32_t CBC_CommonByteArray::At(int32_t index)
{
return m_bytes[index] & 0xff;
}
-void CBC_CommonByteArray::Set(FX_INT32 index, FX_INT32 value)
+void CBC_CommonByteArray::Set(int32_t index, int32_t value)
{
- m_bytes[index] = (FX_BYTE) value;
+ m_bytes[index] = (uint8_t) value;
}
-FX_INT32 CBC_CommonByteArray::Size()
+int32_t CBC_CommonByteArray::Size()
{
return m_size;
}
@@ -67,19 +67,19 @@ FX_BOOL CBC_CommonByteArray::IsEmpty()
{
return m_size == 0;
}
-void CBC_CommonByteArray::AppendByte(FX_INT32 value)
+void CBC_CommonByteArray::AppendByte(int32_t value)
{
if (m_size == 0 || m_index >= m_size) {
- FX_INT32 newSize = FX_MAX(32, m_size << 1);
+ int32_t newSize = FX_MAX(32, m_size << 1);
Reserve(newSize);
}
- m_bytes[m_index] = (FX_BYTE)value;
+ m_bytes[m_index] = (uint8_t)value;
m_index++;
}
-void CBC_CommonByteArray::Reserve(FX_INT32 capacity)
+void CBC_CommonByteArray::Reserve(int32_t capacity)
{
if (m_bytes == NULL || m_size < capacity) {
- FX_BYTE *newArray = FX_Alloc(FX_BYTE, capacity);
+ uint8_t *newArray = FX_Alloc(uint8_t, capacity);
FXSYS_memset32(newArray, 0, capacity);
if (m_bytes != NULL) {
FXSYS_memcpy32(newArray, m_bytes, m_size);
@@ -89,24 +89,24 @@ void CBC_CommonByteArray::Reserve(FX_INT32 capacity)
m_size = capacity;
}
}
-void CBC_CommonByteArray::Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count)
+void CBC_CommonByteArray::Set(uint8_t* source, int32_t offset, int32_t count)
{
if (m_bytes != NULL) {
FX_Free( m_bytes );
}
- m_bytes = FX_Alloc(FX_BYTE, count);
+ m_bytes = FX_Alloc(uint8_t, count);
m_size = count;
FXSYS_memcpy32(m_bytes, source + offset, count);
m_index = count;
}
-void CBC_CommonByteArray::Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count)
+void CBC_CommonByteArray::Set(CFX_ByteArray* source, int32_t offset, int32_t count)
{
if (m_bytes != NULL) {
FX_Free( m_bytes );
}
- m_bytes = FX_Alloc(FX_BYTE, count);
+ m_bytes = FX_Alloc(uint8_t, count);
m_size = count;
- FX_INT32 i;
+ int32_t i;
for(i = 0; i < count; i++) {
m_bytes[i] = source->operator [](i + offset);
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteArray.h b/xfa/src/fxbarcode/common/BC_CommonByteArray.h
index b9baf8a964..234b25db69 100644
--- a/xfa/src/fxbarcode/common/BC_CommonByteArray.h
+++ b/xfa/src/fxbarcode/common/BC_CommonByteArray.h
@@ -9,21 +9,21 @@
class CBC_CommonByteArray
{
private:
- FX_INT32 m_size;
- FX_INT32 m_index;
- FX_BYTE* m_bytes;
+ int32_t m_size;
+ int32_t m_index;
+ uint8_t* m_bytes;
public:
CBC_CommonByteArray();
- CBC_CommonByteArray(FX_INT32 size);
- CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size);
+ CBC_CommonByteArray(int32_t size);
+ CBC_CommonByteArray(uint8_t* byteArray, int32_t size);
virtual ~CBC_CommonByteArray();
- FX_INT32 At(FX_INT32 index);
- void Set(FX_INT32 index, FX_INT32 value);
- FX_INT32 Size();
+ int32_t At(int32_t index);
+ void Set(int32_t index, int32_t value);
+ int32_t Size();
FX_BOOL IsEmpty();
- void AppendByte(FX_INT32 value);
- void Reserve(FX_INT32 capacity);
- void Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count);
- void Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count);
+ void AppendByte(int32_t value);
+ void Reserve(int32_t capacity);
+ void Set(uint8_t* source, int32_t offset, int32_t count);
+ void Set(CFX_ByteArray* source, int32_t offset, int32_t count);
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp
index 27c8615bf9..da4741d11a 100644
--- a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp
@@ -22,7 +22,7 @@
#include "../barcode.h"
#include "BC_CommonByteMatrix.h"
-CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height)
+CBC_CommonByteMatrix::CBC_CommonByteMatrix(int32_t width, int32_t height)
{
m_height = height;
m_width = width;
@@ -30,7 +30,7 @@ CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height)
}
void CBC_CommonByteMatrix::Init()
{
- m_bytes = FX_Alloc(FX_BYTE, m_height * m_width);
+ m_bytes = FX_Alloc(uint8_t, m_height * m_width);
FXSYS_memset8(m_bytes, 0xff, m_height * m_width);
}
CBC_CommonByteMatrix::~CBC_CommonByteMatrix()
@@ -40,37 +40,37 @@ CBC_CommonByteMatrix::~CBC_CommonByteMatrix()
m_bytes = NULL;
}
}
-FX_INT32 CBC_CommonByteMatrix::GetHeight()
+int32_t CBC_CommonByteMatrix::GetHeight()
{
return m_height;
}
-FX_INT32 CBC_CommonByteMatrix::GetWidth()
+int32_t CBC_CommonByteMatrix::GetWidth()
{
return m_width;
}
-FX_BYTE CBC_CommonByteMatrix::Get(FX_INT32 x, FX_INT32 y)
+uint8_t CBC_CommonByteMatrix::Get(int32_t x, int32_t y)
{
return m_bytes[y * m_width + x];
}
-void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_INT32 value)
+void CBC_CommonByteMatrix::Set(int32_t x, int32_t y, int32_t value)
{
- m_bytes[y * m_width + x] = (FX_BYTE)value;
+ m_bytes[y * m_width + x] = (uint8_t)value;
}
-void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_BYTE value)
+void CBC_CommonByteMatrix::Set(int32_t x, int32_t y, uint8_t value)
{
m_bytes[y * m_width + x] = value;
}
-void CBC_CommonByteMatrix::clear(FX_BYTE value)
+void CBC_CommonByteMatrix::clear(uint8_t value)
{
- FX_INT32 y;
+ int32_t y;
for(y = 0; y < m_height; y++) {
- FX_INT32 x;
+ int32_t x;
for(x = 0; x < m_width; x++) {
m_bytes[y * m_width + x] = value;
}
}
}
-FX_BYTE* CBC_CommonByteMatrix::GetArray()
+uint8_t* CBC_CommonByteMatrix::GetArray()
{
return m_bytes;
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h
index 55277660f3..f19e0038b6 100644
--- a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h
+++ b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h
@@ -9,20 +9,20 @@
class CBC_CommonByteMatrix
{
public:
- CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height);
+ CBC_CommonByteMatrix(int32_t width, int32_t height);
virtual ~CBC_CommonByteMatrix();
- FX_INT32 GetHeight();
- FX_INT32 GetWidth();
- FX_BYTE Get(FX_INT32 x, FX_INT32 y);
- FX_BYTE* GetArray();
+ int32_t GetHeight();
+ int32_t GetWidth();
+ uint8_t Get(int32_t x, int32_t y);
+ uint8_t* GetArray();
- void Set(FX_INT32 x, FX_INT32 y, FX_INT32 value);
- void Set(FX_INT32 x, FX_INT32 y, FX_BYTE value);
- void clear(FX_BYTE value);
+ void Set(int32_t x, int32_t y, int32_t value);
+ void Set(int32_t x, int32_t y, uint8_t value);
+ void clear(uint8_t value);
virtual void Init();
private:
- FX_BYTE *m_bytes;
- FX_INT32 m_width;
- FX_INT32 m_height;
+ uint8_t *m_bytes;
+ int32_t m_width;
+ int32_t m_height;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp
index 2909704796..36f8e10af1 100644
--- a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp
@@ -26,7 +26,7 @@
void CBC_CommonCharacterSetECI::initialize()
{
}
-CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName):
+CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName):
CBC_CommonECI(value), m_encodingName(encodingName)
{
}
@@ -37,10 +37,10 @@ CFX_ByteString CBC_CommonCharacterSetECI::GetEncodingName()
{
return m_encodingName;
}
-void CBC_CommonCharacterSetECI::AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName)
+void CBC_CommonCharacterSetECI::AddCharacterSet(int32_t value, CFX_ByteString encodingName)
{
}
-CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(FX_INT32 value)
+CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(int32_t value)
{
return NULL;
}
diff --git a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h
index 1e9f9a433f..1c324796c8 100644
--- a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h
+++ b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h
@@ -11,12 +11,12 @@ class CBC_CommonCharacterSetECI;
class CBC_CommonCharacterSetECI : public CBC_CommonECI
{
public:
- CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName);
+ CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName);
virtual ~CBC_CommonCharacterSetECI();
CFX_ByteString GetEncodingName();
- static void AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName);
- FX_INT32 GetValue();
- static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(FX_INT32 value);
+ static void AddCharacterSet(int32_t value, CFX_ByteString encodingName);
+ int32_t GetValue();
+ static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(int32_t value);
static CBC_CommonCharacterSetECI* GetCharacterSetECIByName(const CFX_ByteString& name);
private:
CFX_ByteString m_encodingName;
diff --git a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp
index d0c55734db..e17a58db43 100644
--- a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp
@@ -27,7 +27,7 @@
CBC_CommonDecoderResult::CBC_CommonDecoderResult()
{
}
-void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e)
+void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e)
{
if(text.IsEmpty()) {
e = BCExceptionIllegalArgument;
@@ -39,7 +39,7 @@ void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_Byte
m_ecLevel = ecLevel;
m_other = NULL;
}
-void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e)
+void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, int32_t &e)
{
if(text.IsEmpty()) {
e = BCExceptionIllegalArgument;
diff --git a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h
index 5f41afc774..e85317934a 100644
--- a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h
+++ b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h
@@ -17,8 +17,8 @@ public:
const CFX_ByteString& GetText();
const CFX_Int32Array& GetByteSegments();
CBC_QRCoderErrorCorrectionLevel* GetECLevel();
- virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e);
- virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e);
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e);
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, int32_t &e);
void setOther(CBC_PDF417ResultMetadata* other);
private:
CFX_ByteArray m_rawBytes;
diff --git a/xfa/src/fxbarcode/common/BC_CommonECI.cpp b/xfa/src/fxbarcode/common/BC_CommonECI.cpp
index 5aa64095f7..98e88b5dab 100644
--- a/xfa/src/fxbarcode/common/BC_CommonECI.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonECI.cpp
@@ -23,18 +23,18 @@
#include "../barcode.h"
#include "BC_CommonECI.h"
#include "BC_CommonCharacterSetECI.h"
-CBC_CommonECI::CBC_CommonECI(FX_INT32 value)
+CBC_CommonECI::CBC_CommonECI(int32_t value)
{
m_value = value;
}
CBC_CommonECI::~CBC_CommonECI()
{
}
-FX_INT32 CBC_CommonECI::GetValue()
+int32_t CBC_CommonECI::GetValue()
{
return m_value;
}
-CBC_CommonECI* CBC_CommonECI::GetEICByValue(FX_INT32 value, FX_INT32 &e)
+CBC_CommonECI* CBC_CommonECI::GetEICByValue(int32_t value, int32_t &e)
{
if(value < 0 || value > 999999) {
e = BCExceptionBadECI;
diff --git a/xfa/src/fxbarcode/common/BC_CommonECI.h b/xfa/src/fxbarcode/common/BC_CommonECI.h
index 7a4ae6b8a6..503f15fef7 100644
--- a/xfa/src/fxbarcode/common/BC_CommonECI.h
+++ b/xfa/src/fxbarcode/common/BC_CommonECI.h
@@ -9,12 +9,12 @@
class CBC_CommonECI
{
public:
- CBC_CommonECI(FX_INT32 value);
+ CBC_CommonECI(int32_t value);
virtual ~CBC_CommonECI();
- FX_INT32 GetValue();
- static CBC_CommonECI* GetEICByValue(FX_INT32 value, FX_INT32 &e);
+ int32_t GetValue();
+ static CBC_CommonECI* GetEICByValue(int32_t value, int32_t &e);
private:
- FX_INT32 m_value;
+ int32_t m_value;
};
#endif
diff --git a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
index cb59d99cdf..7fbcac5bb2 100644
--- a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
@@ -48,7 +48,7 @@ CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::QuadrilateralToQ
}
void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points)
{
- FX_INT32 max = points->GetSize();
+ int32_t max = points->GetSize();
FX_FLOAT a11 = m_a11;
FX_FLOAT a12 = m_a12;
FX_FLOAT a13 = m_a13;
@@ -58,7 +58,7 @@ void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points)
FX_FLOAT a31 = m_a31;
FX_FLOAT a32 = m_a32;
FX_FLOAT a33 = m_a33;
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < max; i += 2) {
FX_FLOAT x = (*points)[i];
FX_FLOAT y = (*points)[i + 1];
diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp
index 7ef1671d98..5976d450d9 100644
--- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp
+++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp
@@ -26,19 +26,19 @@
#include "BC_CommonBitMatrix.h"
#include "BC_CommonBitArray.h"
#include "BC_GlobalHistogramBinarizer.h"
-const FX_INT32 LUMINANCE_BITS = 5;
-const FX_INT32 LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
-const FX_INT32 LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
+const int32_t LUMINANCE_BITS = 5;
+const int32_t LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
+const int32_t LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
CBC_GlobalHistogramBinarizer::CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source): CBC_Binarizer(source)
{
}
CBC_GlobalHistogramBinarizer::~CBC_GlobalHistogramBinarizer()
{
}
-CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e)
+CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e)
{
CBC_LuminanceSource *source = GetLuminanceSource();
- FX_INT32 width = source->GetWidth();
+ int32_t width = source->GetWidth();
CBC_AutoPtr<CBC_CommonBitArray> result(FX_NEW CBC_CommonBitArray(width));
InitArrays(width);
CFX_ByteArray *localLuminances = source->GetRow(y, m_luminance, e);
@@ -47,20 +47,20 @@ CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_Co
}
CFX_Int32Array localBuckets;
localBuckets.Copy(m_buckets);
- FX_INT32 x;
+ int32_t x;
for (x = 0; x < width; x++) {
- FX_INT32 pixel = (*localLuminances)[x] & 0xff;
+ int32_t pixel = (*localLuminances)[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
- FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e);
+ int32_t blackPoint = EstimateBlackPoint(localBuckets, e);
if (e != BCExceptionNO) {
return result.release();
}
- FX_INT32 left = (*localLuminances)[0] & 0xff;
- FX_INT32 center = (*localLuminances)[1] & 0xff;
+ int32_t left = (*localLuminances)[0] & 0xff;
+ int32_t center = (*localLuminances)[1] & 0xff;
for (x = 1; x < width - 1; x++) {
- FX_INT32 right = (*localLuminances)[x + 1] & 0xff;
- FX_INT32 luminance = ((center << 2) - left - right) >> 1;
+ int32_t right = (*localLuminances)[x + 1] & 0xff;
+ int32_t luminance = ((center << 2) - left - right) >> 1;
if (luminance < blackPoint) {
result->Set(x);
}
@@ -69,36 +69,36 @@ CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_Co
}
return result.release();
}
-CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e)
+CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(int32_t &e)
{
CBC_LuminanceSource *source = GetLuminanceSource();
- FX_INT32 width = source->GetWidth();
- FX_INT32 height = source->GetHeight();
+ int32_t width = source->GetWidth();
+ int32_t height = source->GetHeight();
CBC_CommonBitMatrix *BitMatrixTemp = FX_NEW CBC_CommonBitMatrix();
BitMatrixTemp->Init(width, height);
CBC_AutoPtr<CBC_CommonBitMatrix> matrix(BitMatrixTemp);
InitArrays(width);
CFX_Int32Array localBuckets;
localBuckets.Copy(m_buckets);
- FX_INT32 y;
+ int32_t y;
for (y = 1; y < 5; y++) {
- FX_INT32 row = height * y / 5;
+ int32_t row = height * y / 5;
CFX_ByteArray *localLuminances = source->GetRow(row, m_luminance, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 right = (width << 2) / 5;
- FX_INT32 x;
+ int32_t right = (width << 2) / 5;
+ int32_t x;
for (x = width / 5; x < right; x++) {
- FX_INT32 pixel = (*localLuminances)[x] & 0xff;
+ int32_t pixel = (*localLuminances)[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
}
- FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e);
+ int32_t blackPoint = EstimateBlackPoint(localBuckets, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CFX_ByteArray> localLuminances(source->GetMatrix());
for (y = 0; y < height; y++) {
- FX_INT32 offset = y * width;
- for (FX_INT32 x = 0; x < width; x++) {
- FX_INT32 pixel = (*localLuminances)[offset + x] & 0xff;
+ int32_t offset = y * width;
+ for (int32_t x = 0; x < width; x++) {
+ int32_t pixel = (*localLuminances)[offset + x] & 0xff;
if (pixel < blackPoint) {
matrix->Set(x, y);
}
@@ -106,7 +106,7 @@ CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e)
}
return matrix.release();
}
-void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize)
+void CBC_GlobalHistogramBinarizer::InitArrays(int32_t luminanceSize)
{
if(m_luminance.GetSize() < luminanceSize) {
m_luminance.SetSize(luminanceSize);
@@ -114,19 +114,19 @@ void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize)
if(m_buckets.GetSize() <= 0) {
m_buckets.SetSize(LUMINANCE_BUCKETS);
} else {
- FX_INT32 x;
+ int32_t x;
for(x = 0; x < LUMINANCE_BUCKETS; x++) {
m_buckets[x] = 0;
}
}
}
-FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e)
+int32_t CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, int32_t &e)
{
- FX_INT32 numBuckets = buckets.GetSize();
- FX_INT32 maxBucketCount = 0;
- FX_INT32 firstPeak = 0;
- FX_INT32 firstPeakSize = 0;
- FX_INT32 x;
+ int32_t numBuckets = buckets.GetSize();
+ int32_t maxBucketCount = 0;
+ int32_t firstPeak = 0;
+ int32_t firstPeakSize = 0;
+ int32_t x;
for (x = 0; x < numBuckets; x++) {
if (buckets[x] > firstPeakSize) {
firstPeak = x;
@@ -136,18 +136,18 @@ FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &bucket
maxBucketCount = buckets[x];
}
}
- FX_INT32 secondPeak = 0;
- FX_INT32 secondPeakScore = 0;
+ int32_t secondPeak = 0;
+ int32_t secondPeakScore = 0;
for (x = 0; x < numBuckets; x++) {
- FX_INT32 distanceToBiggest = x - firstPeak;
- FX_INT32 score = buckets[x] * distanceToBiggest * distanceToBiggest;
+ int32_t distanceToBiggest = x - firstPeak;
+ int32_t score = buckets[x] * distanceToBiggest * distanceToBiggest;
if (score > secondPeakScore) {
secondPeak = x;
secondPeakScore = score;
}
}
if (firstPeak > secondPeak) {
- FX_INT32 temp = firstPeak;
+ int32_t temp = firstPeak;
firstPeak = secondPeak;
secondPeak = temp;
}
@@ -155,11 +155,11 @@ FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &bucket
e = BCExceptionRead;
return 0;
}
- FX_INT32 bestValley = secondPeak - 1;
- FX_INT32 bestValleyScore = -1;
+ int32_t bestValley = secondPeak - 1;
+ int32_t bestValleyScore = -1;
for (x = secondPeak - 1; x > firstPeak; x--) {
- FX_INT32 fromFirst = x - firstPeak;
- FX_INT32 score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]);
+ int32_t fromFirst = x - firstPeak;
+ int32_t score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]);
if (score > bestValleyScore) {
bestValley = x;
bestValleyScore = score;
diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h
index ef084c075e..6c6d8ba188 100644
--- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h
+++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h
@@ -17,10 +17,10 @@ public:
CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source);
virtual ~CBC_GlobalHistogramBinarizer();
- void InitArrays(FX_INT32 luminanceSize);
- CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e);
- CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);
- static FX_INT32 EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e);
+ void InitArrays(int32_t luminanceSize);
+ CBC_CommonBitMatrix *GetBlackMatrix(int32_t &e);
+ CBC_CommonBitArray *GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e);
+ static int32_t EstimateBlackPoint(CFX_Int32Array &buckets, int32_t &e);
private:
CFX_ByteArray m_luminance;
CFX_Int32Array m_buckets;
diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp
index 8bc93136ca..3d350996dd 100644
--- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp
+++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp
@@ -24,8 +24,8 @@
#include "BC_WhiteRectangleDetector.h"
#include "BC_CommonBitMatrix.h"
#include "../BC_ResultPoint.h"
-const FX_INT32 CBC_WhiteRectangleDetector::INIT_SIZE = 30;
-const FX_INT32 CBC_WhiteRectangleDetector::CORR = 1;
+const int32_t CBC_WhiteRectangleDetector::INIT_SIZE = 30;
+const int32_t CBC_WhiteRectangleDetector::CORR = 1;
CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image)
{
m_image = image;
@@ -36,19 +36,19 @@ CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *imag
m_upInit = (m_height - INIT_SIZE) >> 1;
m_downInit = (m_height + INIT_SIZE) >> 1;
}
-void CBC_WhiteRectangleDetector::Init(FX_INT32 &e)
+void CBC_WhiteRectangleDetector::Init(int32_t &e)
{
if (m_upInit < 0 || m_leftInit < 0 || m_downInit >= m_height || m_rightInit >= m_width) {
e = BCExceptionNotFound;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y)
+CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, int32_t initSize, int32_t x, int32_t y)
{
m_image = image;
m_height = image->GetHeight();
m_width = image->GetWidth();
- FX_INT32 halfsize = initSize >> 1;
+ int32_t halfsize = initSize >> 1;
m_leftInit = x - halfsize;
m_rightInit = x + halfsize;
m_upInit = y - halfsize;
@@ -57,12 +57,12 @@ CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *imag
CBC_WhiteRectangleDetector::~CBC_WhiteRectangleDetector()
{
}
-CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
+CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(int32_t &e)
{
- FX_INT32 left = m_leftInit;
- FX_INT32 right = m_rightInit;
- FX_INT32 up = m_upInit;
- FX_INT32 down = m_downInit;
+ int32_t left = m_leftInit;
+ int32_t right = m_rightInit;
+ int32_t up = m_upInit;
+ int32_t down = m_downInit;
FX_BOOL sizeExceeded = FALSE;
FX_BOOL aBlackPointFoundOnBorder = TRUE;
FX_BOOL atLeastOneBlackPointFoundOnBorder = FALSE;
@@ -121,9 +121,9 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
}
}
if (!sizeExceeded && atLeastOneBlackPointFoundOnBorder) {
- FX_INT32 maxSize = right - left;
+ int32_t maxSize = right - left;
CBC_AutoPtr<CBC_ResultPoint> z(NULL);
- for (FX_INT32 i = 1; i < maxSize; i++) {
+ for (int32_t i = 1; i < maxSize; i++) {
z = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(down - i), (FX_FLOAT)(left + i), (FX_FLOAT)(down)) );
if (z.get() != NULL) {
break;
@@ -134,7 +134,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_AutoPtr<CBC_ResultPoint> t(NULL);
- for (FX_INT32 j = 1; j < maxSize; j++) {
+ for (int32_t j = 1; j < maxSize; j++) {
t = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(up + j), (FX_FLOAT)(left + j), (FX_FLOAT)up));
if (t.get() != NULL) {
break;
@@ -145,7 +145,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_AutoPtr<CBC_ResultPoint> x(NULL);
- for (FX_INT32 k = 1; k < maxSize; k++) {
+ for (int32_t k = 1; k < maxSize; k++) {
x = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(up + k), (FX_FLOAT)(right - k), (FX_FLOAT)up));
if (x.get() != NULL) {
break;
@@ -156,7 +156,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
CBC_AutoPtr<CBC_ResultPoint> y(NULL);
- for (FX_INT32 m = 1; m < maxSize; m++) {
+ for (int32_t m = 1; m < maxSize; m++) {
y = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(down - m), (FX_FLOAT)(right - m), (FX_FLOAT) down));
if (y.get() != NULL) {
break;
@@ -173,25 +173,25 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)
}
return NULL;
}
-FX_INT32 CBC_WhiteRectangleDetector::Round(FX_FLOAT d)
+int32_t CBC_WhiteRectangleDetector::Round(FX_FLOAT d)
{
- return (FX_INT32) (d + 0.5f);
+ return (int32_t) (d + 0.5f);
}
CBC_ResultPoint *CBC_WhiteRectangleDetector::GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)
{
- FX_INT32 dist = DistanceL2(aX, aY, bX, bY);
+ int32_t dist = DistanceL2(aX, aY, bX, bY);
float xStep = (bX - aX) / dist;
float yStep = (bY - aY) / dist;
- for (FX_INT32 i = 0; i < dist; i++) {
- FX_INT32 x = Round(aX + i * xStep);
- FX_INT32 y = Round(aY + i * yStep);
+ for (int32_t i = 0; i < dist; i++) {
+ int32_t x = Round(aX + i * xStep);
+ int32_t y = Round(aY + i * yStep);
if (m_image->Get(x, y)) {
return FX_NEW CBC_ResultPoint((FX_FLOAT)x, (FX_FLOAT) y);
}
}
return NULL;
}
-FX_INT32 CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)
+int32_t CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)
{
float xDiff = aX - bX;
float yDiff = aY - bY;
@@ -225,16 +225,16 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::CenterEdges(CBC_ResultPoint *y, CBC_Re
return result;
}
}
-FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal)
+FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(int32_t a, int32_t b, int32_t fixed, FX_BOOL horizontal)
{
if (horizontal) {
- for (FX_INT32 x = a; x <= b; x++) {
+ for (int32_t x = a; x <= b; x++) {
if (m_image->Get(x, fixed)) {
return TRUE;
}
}
} else {
- for (FX_INT32 y = a; y <= b; y++) {
+ for (int32_t y = a; y <= b; y++) {
if (m_image->Get(fixed, y)) {
return TRUE;
}
diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h
index 40146d39de..c7607f9e56 100644
--- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h
+++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h
@@ -12,26 +12,26 @@ class CBC_WhiteRectangleDetector
{
public:
CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image);
- CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y);
+ CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, int32_t initSize, int32_t x, int32_t y);
virtual ~CBC_WhiteRectangleDetector();
- CFX_PtrArray *Detect(FX_INT32 &e);
- virtual void Init(FX_INT32 &e);
+ CFX_PtrArray *Detect(int32_t &e);
+ virtual void Init(int32_t &e);
private:
- FX_INT32 Round(float d);
+ int32_t Round(float d);
CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
- FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
+ int32_t DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z,
CBC_ResultPoint *x, CBC_ResultPoint *t);
- FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal);
- const static FX_INT32 INIT_SIZE;
- const static FX_INT32 CORR;
+ FX_BOOL ContainsBlackPoint(int32_t a, int32_t b, int32_t fixed, FX_BOOL horizontal);
+ const static int32_t INIT_SIZE;
+ const static int32_t CORR;
CBC_CommonBitMatrix *m_image;
- FX_INT32 m_height;
- FX_INT32 m_width;
- FX_INT32 m_leftInit;
- FX_INT32 m_rightInit;
- FX_INT32 m_downInit;
- FX_INT32 m_upInit;
+ int32_t m_height;
+ int32_t m_width;
+ int32_t m_leftInit;
+ int32_t m_rightInit;
+ int32_t m_downInit;
+ int32_t m_upInit;
};
#endif
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
index 1fc8b6685a..1ece2add2c 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
@@ -32,11 +32,11 @@ void CBC_ReedSolomonEncoder::Init()
{
m_cachedGenerators.Add(FX_NEW CBC_ReedSolomonGF256Poly(m_field, 1));
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(int32_t degree, int32_t &e)
{
if(degree >= m_cachedGenerators.GetSize()) {
CBC_ReedSolomonGF256Poly* lastGenerator = (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[m_cachedGenerators.GetSize() - 1]);
- for(FX_INT32 d = m_cachedGenerators.GetSize(); d <= degree; d++) {
+ for(int32_t d = m_cachedGenerators.GetSize(); d <= degree; d++) {
CFX_Int32Array temp;
temp.Add(1);
temp.Add(m_field->Exp(d - 1));
@@ -51,13 +51,13 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree
}
return (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[degree]);
}
-void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e)
+void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, int32_t ecBytes, int32_t &e)
{
if(ecBytes == 0) {
e = BCExceptionNoCorrectionBytes;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
- FX_INT32 dataBytes = toEncode->GetSize() - ecBytes;
+ int32_t dataBytes = toEncode->GetSize() - ecBytes;
if(dataBytes <= 0) {
e = BCExceptionNoDataBytesProvided;
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -66,7 +66,7 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes,
BC_EXCEPTION_CHECK_ReturnVoid(e);
CFX_Int32Array infoCoefficients;
infoCoefficients.SetSize(dataBytes);
- for(FX_INT32 x = 0; x < dataBytes; x++) {
+ for(int32_t x = 0; x < dataBytes; x++) {
infoCoefficients[x] = toEncode->operator [](x);
}
CBC_ReedSolomonGF256Poly info;
@@ -80,21 +80,21 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes,
CBC_AutoPtr<CFX_PtrArray > temp(pa);
CBC_ReedSolomonGF256Poly* remainder = (CBC_ReedSolomonGF256Poly*)(temp->operator [](1));
CFX_Int32Array* coefficients = remainder->GetCoefficients();
- FX_INT32 numZeroCoefficients = ecBytes - coefficients->GetSize();
- for(FX_INT32 i = 0; i < numZeroCoefficients; i++) {
+ int32_t numZeroCoefficients = ecBytes - coefficients->GetSize();
+ for(int32_t i = 0; i < numZeroCoefficients; i++) {
(*toEncode)[dataBytes + i] = 0;
}
- for(FX_INT32 y = 0; y < coefficients->GetSize(); y++) {
+ for(int32_t y = 0; y < coefficients->GetSize(); y++) {
(*toEncode)[dataBytes + numZeroCoefficients + y] =
coefficients->operator [](y);
}
- for (FX_INT32 k = 0; k < temp->GetSize(); k++) {
+ for (int32_t k = 0; k < temp->GetSize(); k++) {
delete (CBC_ReedSolomonGF256Poly*)(*temp)[k];
}
}
CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder()
{
- for (FX_INT32 i = 0; i < m_cachedGenerators.GetSize(); i++) {
+ for (int32_t i = 0; i < m_cachedGenerators.GetSize(); i++) {
delete (CBC_ReedSolomonGF256Poly*)m_cachedGenerators[i];
}
}
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
index 713f343d98..bc35ebed1f 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h
@@ -13,12 +13,12 @@ class CBC_ReedSolomonEncoder
private:
CBC_ReedSolomonGF256* m_field;
CFX_PtrArray m_cachedGenerators;
- CBC_ReedSolomonGF256Poly* BuildGenerator(FX_INT32 degree, FX_INT32 &e);
+ CBC_ReedSolomonGF256Poly* BuildGenerator(int32_t degree, int32_t &e);
public:
CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256 * field);
virtual ~CBC_ReedSolomonEncoder();
- void Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e);
+ void Encode(CFX_Int32Array *toEncode, int32_t ecBytes, int32_t &e);
virtual void Init();
};
#endif
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp
index 3cb5e7762f..f0e87b8e40 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp
@@ -31,7 +31,7 @@ CBC_ReedSolomonDecoder::CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256* field)
CBC_ReedSolomonDecoder::~CBC_ReedSolomonDecoder()
{
}
-void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e)
+void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, int32_t twoS, int32_t &e)
{
CBC_ReedSolomonGF256Poly poly;
poly.Init(m_field, received, e);
@@ -40,8 +40,8 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_
syndromeCoefficients.SetSize(twoS);
FX_BOOL dataMatrix = FALSE;
FX_BOOL noError = TRUE;
- for (FX_INT32 i = 0; i < twoS; i++) {
- FX_INT32 eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i));
+ for (int32_t i = 0; i < twoS; i++) {
+ int32_t eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i));
syndromeCoefficients[twoS - 1 - i] = eval;
if (eval != 0) {
noError = FALSE;
@@ -67,8 +67,8 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_
CFX_Int32Array* ia2 = FindErrorMagnitudes(omega.get(), errorLocations.get(), dataMatrix, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
CBC_AutoPtr<CFX_Int32Array > errorMagnitudes(ia2);
- for (FX_INT32 k = 0; k < errorLocations->GetSize(); k++) {
- FX_INT32 position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e);
+ for (int32_t k = 0; k < errorLocations->GetSize(); k++) {
+ int32_t position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if(position < 0) {
e = BCExceptionBadErrorLocation;
@@ -77,7 +77,7 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_
(*received)[position] = CBC_ReedSolomonGF256::AddOrSubtract((*received)[position], (*errorMagnitudes)[k]);
}
}
-CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e)
+CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, int32_t R, int32_t &e)
{
if (a->GetDegree() < b->GetDegree()) {
CBC_ReedSolomonGF256Poly* temp = a;
@@ -120,12 +120,12 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256
CBC_ReedSolomonGF256Poly* rsg8 = m_field->GetZero()->Clone(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> q(rsg8);
- FX_INT32 denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree());
- FX_INT32 dltInverse = m_field->Inverse(denominatorLeadingTerm, e);
+ int32_t denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree());
+ int32_t dltInverse = m_field->Inverse(denominatorLeadingTerm, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
while (r->GetDegree() >= rLast->GetDegree() && !(r->IsZero())) {
- FX_INT32 degreeDiff = r->GetDegree() - rLast->GetDegree();
- FX_INT32 scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse);
+ int32_t degreeDiff = r->GetDegree() - rLast->GetDegree();
+ int32_t scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse);
CBC_ReedSolomonGF256Poly* rsgp1 = m_field->BuildMonomial(degreeDiff, scale, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> build(rsgp1);
@@ -156,12 +156,12 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp6(rsg12);
t = temp6;
}
- FX_INT32 sigmaTildeAtZero = t->GetCoefficients(0);
+ int32_t sigmaTildeAtZero = t->GetCoefficients(0);
if (sigmaTildeAtZero == 0) {
e = BCExceptionIsZero;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 inverse = m_field->Inverse(sigmaTildeAtZero, e);
+ int32_t inverse = m_field->Inverse(sigmaTildeAtZero, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_ReedSolomonGF256Poly* rsg13 = t->Multiply(inverse, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -174,9 +174,9 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256
temp->Add(omega.release());
return temp;
}
-CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e)
+CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, int32_t &e)
{
- FX_INT32 numErrors = errorLocator->GetDegree();
+ int32_t numErrors = errorLocator->GetDegree();
if (numErrors == 1) {
CBC_AutoPtr<CFX_Int32Array > temp(FX_NEW CFX_Int32Array);
temp->Add(errorLocator->GetCoefficients(1));
@@ -185,8 +185,8 @@ CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256P
CFX_Int32Array *tempT = FX_NEW CFX_Int32Array;
tempT->SetSize(numErrors);
CBC_AutoPtr<CFX_Int32Array > result(tempT);
- FX_INT32 ie = 0;
- for (FX_INT32 i = 1; i < 256 && ie < numErrors; i++) {
+ int32_t ie = 0;
+ for (int32_t i = 1; i < 256 && ie < numErrors; i++) {
if(errorLocator->EvaluateAt(i) == 0) {
(*result)[ie] = m_field->Inverse(i, ie);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -199,23 +199,23 @@ CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256P
}
return result.release();
}
-CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e)
+CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, int32_t &e)
{
- FX_INT32 s = errorLocations->GetSize();
+ int32_t s = errorLocations->GetSize();
CFX_Int32Array * temp = FX_NEW CFX_Int32Array;
temp->SetSize(s);
CBC_AutoPtr<CFX_Int32Array > result(temp);
- for (FX_INT32 i = 0; i < s; i++) {
- FX_INT32 xiInverse = m_field->Inverse(errorLocations->operator [](i), e);
+ for (int32_t i = 0; i < s; i++) {
+ int32_t xiInverse = m_field->Inverse(errorLocations->operator [](i), e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 denominator = 1;
- for(FX_INT32 j = 0; j < s; j++) {
+ int32_t denominator = 1;
+ for(int32_t j = 0; j < s; j++) {
if(i != j) {
denominator = m_field->Multiply(denominator,
CBC_ReedSolomonGF256::AddOrSubtract(1, m_field->Multiply(errorLocations->operator [](j), xiInverse)));
}
}
- FX_INT32 temp = m_field->Inverse(denominator, temp);
+ int32_t temp = m_field->Inverse(denominator, temp);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
(*result)[i] = m_field->Multiply(errorEvaluator->EvaluateAt(xiInverse),
temp);
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h
index db026edd01..edefd4a29a 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h
@@ -15,9 +15,9 @@ private:
public:
CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256 * field);
virtual ~CBC_ReedSolomonDecoder();
- void Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e);
- CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e);
- CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e);
- CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e);
+ void Decode(CFX_Int32Array* received, int32_t twoS, int32_t &e);
+ CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, int32_t R, int32_t &e);
+ CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, int32_t &e);
+ CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, int32_t &e);
};
#endif
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
index bb045ac24c..426ac2fbd8 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
@@ -43,17 +43,17 @@ void CBC_ReedSolomonGF256::Finalize()
}
DataMatrixField = NULL;
}
-CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(FX_INT32 primitive)
+CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(int32_t primitive)
{
- FX_INT32 x = 1;
- for(FX_INT32 j = 0; j < 256; j++) {
+ int32_t x = 1;
+ for(int32_t j = 0; j < 256; j++) {
m_expTable[j] = x;
x <<= 1;
if(x >= 0x100) {
x ^= primitive;
}
}
- for(FX_INT32 i = 0; i < 255; i++) {
+ for(int32_t i = 0; i < 255; i++) {
m_logTable[m_expTable[i]] = i;
}
m_logTable[0] = 0;
@@ -82,7 +82,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::GetOne()
{
return m_one;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(int32_t degree, int32_t coefficient, int32_t &e)
{
if(degree < 0) {
e = BCExceptionDegreeIsNegative;
@@ -101,15 +101,15 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(FX_INT32 degree, F
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-FX_INT32 CBC_ReedSolomonGF256::AddOrSubtract(FX_INT32 a, FX_INT32 b)
+int32_t CBC_ReedSolomonGF256::AddOrSubtract(int32_t a, int32_t b)
{
return a ^ b;
}
-FX_INT32 CBC_ReedSolomonGF256::Exp(FX_INT32 a)
+int32_t CBC_ReedSolomonGF256::Exp(int32_t a)
{
return m_expTable[a];
}
-FX_INT32 CBC_ReedSolomonGF256::Log(FX_INT32 a, FX_INT32 &e)
+int32_t CBC_ReedSolomonGF256::Log(int32_t a, int32_t &e)
{
if(a == 0) {
e = BCExceptionAIsZero;
@@ -117,7 +117,7 @@ FX_INT32 CBC_ReedSolomonGF256::Log(FX_INT32 a, FX_INT32 &e)
}
return m_logTable[a];
}
-FX_INT32 CBC_ReedSolomonGF256::Inverse(FX_INT32 a, FX_INT32 &e)
+int32_t CBC_ReedSolomonGF256::Inverse(int32_t a, int32_t &e)
{
if(a == 0) {
e = BCExceptionAIsZero;
@@ -125,7 +125,7 @@ FX_INT32 CBC_ReedSolomonGF256::Inverse(FX_INT32 a, FX_INT32 &e)
}
return m_expTable[255 - m_logTable[a]];
}
-FX_INT32 CBC_ReedSolomonGF256::Multiply(FX_INT32 a, FX_INT32 b)
+int32_t CBC_ReedSolomonGF256::Multiply(int32_t a, int32_t b)
{
if(a == 0 || b == 0) {
return 0;
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
index 40e7ffef28..141c3dab36 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h
@@ -14,20 +14,20 @@ public:
static void Finalize();
static CBC_ReedSolomonGF256 *QRCodeFild;
static CBC_ReedSolomonGF256 *DataMatrixField;
- CBC_ReedSolomonGF256(FX_INT32 primitive);
+ CBC_ReedSolomonGF256(int32_t primitive);
virtual ~CBC_ReedSolomonGF256();
CBC_ReedSolomonGF256Poly* GetZero();
CBC_ReedSolomonGF256Poly* GetOne();
- CBC_ReedSolomonGF256Poly* BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
- static FX_INT32 AddOrSubtract(FX_INT32 a, FX_INT32 b);
- FX_INT32 Exp(FX_INT32 a);
- FX_INT32 Log(FX_INT32 a, FX_INT32 &e);
- FX_INT32 Inverse(FX_INT32 a, FX_INT32 &e);
- FX_INT32 Multiply(FX_INT32 a, FX_INT32 b);
+ CBC_ReedSolomonGF256Poly* BuildMonomial(int32_t degree, int32_t coefficient, int32_t &e);
+ static int32_t AddOrSubtract(int32_t a, int32_t b);
+ int32_t Exp(int32_t a);
+ int32_t Log(int32_t a, int32_t &e);
+ int32_t Inverse(int32_t a, int32_t &e);
+ int32_t Multiply(int32_t a, int32_t b);
virtual void Init();
private:
- FX_INT32 m_expTable[256];
- FX_INT32 m_logTable[256];
+ int32_t m_expTable[256];
+ int32_t m_logTable[256];
CBC_ReedSolomonGF256Poly *m_zero;
CBC_ReedSolomonGF256Poly *m_one;
};
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
index 6476e4cf80..d59f619e25 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
@@ -23,7 +23,7 @@
#include "../../barcode.h"
#include "BC_ReedSolomonGF256.h"
#include "BC_ReedSolomonGF256Poly.h"
-CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients)
+CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, int32_t coefficients)
{
if(field == NULL) {
return;
@@ -35,16 +35,16 @@ CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly()
{
m_field = NULL;
}
-void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e)
+void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, int32_t &e)
{
if(coefficients == NULL || coefficients->GetSize() == 0) {
e = BCExceptionCoefficientsSizeIsNull;
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
m_field = field;
- FX_INT32 coefficientsLength = coefficients->GetSize();
+ int32_t coefficientsLength = coefficients->GetSize();
if((coefficientsLength > 1 && (*coefficients)[0] == 0)) {
- FX_INT32 firstNonZero = 1;
+ int32_t firstNonZero = 1;
while((firstNonZero < coefficientsLength) && ((*coefficients)[firstNonZero] == 0)) {
firstNonZero++;
}
@@ -52,7 +52,7 @@ void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array*
m_coefficients.Copy( *(m_field->GetZero()->GetCoefficients()));
} else {
m_coefficients.SetSize(coefficientsLength - firstNonZero);
- for(FX_INT32 i = firstNonZero, j = 0; i < coefficientsLength; i++, j++) {
+ for(int32_t i = firstNonZero, j = 0; i < coefficientsLength; i++, j++) {
m_coefficients[j] = coefficients->operator [](i);
}
}
@@ -64,7 +64,7 @@ CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients()
{
return &m_coefficients;
}
-FX_INT32 CBC_ReedSolomonGF256Poly::GetDegree()
+int32_t CBC_ReedSolomonGF256Poly::GetDegree()
{
return m_coefficients.GetSize() - 1;
}
@@ -72,39 +72,39 @@ FX_BOOL CBC_ReedSolomonGF256Poly::IsZero()
{
return m_coefficients[0] == 0;
}
-FX_INT32 CBC_ReedSolomonGF256Poly::GetCoefficients(FX_INT32 degree)
+int32_t CBC_ReedSolomonGF256Poly::GetCoefficients(int32_t degree)
{
return m_coefficients[m_coefficients.GetSize() - 1 - degree];
}
-FX_INT32 CBC_ReedSolomonGF256Poly::EvaluateAt(FX_INT32 a)
+int32_t CBC_ReedSolomonGF256Poly::EvaluateAt(int32_t a)
{
if(a == 0) {
return GetCoefficients(0);
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
if(a == 1) {
- FX_INT32 result = 0;
- for(FX_INT32 i = 0; i < size; i++) {
+ int32_t result = 0;
+ for(int32_t i = 0; i < size; i++) {
result = CBC_ReedSolomonGF256::AddOrSubtract(result, m_coefficients[i]);
}
return result;
}
- FX_INT32 result = m_coefficients[0];
- for(FX_INT32 j = 1; j < size; j++) {
+ int32_t result = m_coefficients[0];
+ for(int32_t j = 1; j < size; j++) {
result = CBC_ReedSolomonGF256::AddOrSubtract(
m_field->Multiply(a, result),
m_coefficients[j]);
}
return result;
}
-CBC_ReedSolomonGF256Poly *CBC_ReedSolomonGF256Poly::Clone(FX_INT32 &e)
+CBC_ReedSolomonGF256Poly *CBC_ReedSolomonGF256Poly::Clone(int32_t &e)
{
CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &m_coefficients, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomonGF256Poly* other, int32_t &e)
{
if(IsZero()) {
return other->Clone(e);
@@ -126,11 +126,11 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomo
}
CFX_Int32Array sumDiff;
sumDiff.SetSize(largerCoefficients.GetSize() );
- FX_INT32 lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize();
- for(FX_INT32 i = 0; i < lengthDiff; i++) {
+ int32_t lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize();
+ for(int32_t i = 0; i < lengthDiff; i++) {
sumDiff[i] = largerCoefficients[i];
}
- for(FX_INT32 j = lengthDiff; j < largerCoefficients.GetSize(); j++) {
+ for(int32_t j = lengthDiff; j < largerCoefficients.GetSize(); j++) {
sumDiff[j] = (CBC_ReedSolomonGF256::AddOrSubtract(smallerCoefficients[j - lengthDiff],
largerCoefficients[j]));
}
@@ -139,7 +139,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomo
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF256Poly* other, int32_t &e)
{
if(IsZero() || other->IsZero()) {
CBC_ReedSolomonGF256Poly *temp = m_field->GetZero()->Clone(e);
@@ -148,15 +148,15 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF25
}
CFX_Int32Array aCoefficients ;
aCoefficients.Copy(m_coefficients);
- FX_INT32 aLength = m_coefficients.GetSize();
+ int32_t aLength = m_coefficients.GetSize();
CFX_Int32Array bCoefficients;
bCoefficients.Copy(*(other->GetCoefficients()));
- FX_INT32 bLength = other->GetCoefficients()->GetSize();
+ int32_t bLength = other->GetCoefficients()->GetSize();
CFX_Int32Array product;
product.SetSize(aLength + bLength - 1);
- for(FX_INT32 i = 0; i < aLength; i++) {
- FX_INT32 aCoeff = m_coefficients[i];
- for(FX_INT32 j = 0; j < bLength; j++) {
+ for(int32_t i = 0; i < aLength; i++) {
+ int32_t aCoeff = m_coefficients[i];
+ for(int32_t j = 0; j < bLength; j++) {
product[i + j] = CBC_ReedSolomonGF256::AddOrSubtract(
product[i + j],
m_field->Multiply(aCoeff, other->GetCoefficients()->operator [](j)));
@@ -167,7 +167,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF25
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar, int32_t &e)
{
if(scalar == 0) {
CBC_ReedSolomonGF256Poly *temp = m_field->GetZero()->Clone(e);
@@ -178,10 +178,10 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX
return this->Clone(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array product;
product.SetSize(size);
- for(FX_INT32 i = 0; i < size; i++) {
+ for(int32_t i = 0; i < size; i++) {
product[i] = m_field->Multiply(m_coefficients[i], scalar);
}
CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly();
@@ -189,7 +189,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e)
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e)
{
if(degree < 0) {
e = BCExceptionDegreeIsNegative;
@@ -200,10 +200,10 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
- FX_INT32 size = m_coefficients.GetSize();
+ int32_t size = m_coefficients.GetSize();
CFX_Int32Array product;
product.SetSize(size + degree);
- for(FX_INT32 i = 0; i < size; i++) {
+ for(int32_t i = 0; i < size; i++) {
product[i] = (m_field->Multiply(m_coefficients[i], coefficient));
}
CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly();
@@ -211,7 +211,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
}
-CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e)
+CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, int32_t &e)
{
if(other->IsZero()) {
e = BCExceptionDivideByZero;
@@ -223,13 +223,13 @@ CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other,
CBC_ReedSolomonGF256Poly* rsg2 = this->Clone(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> remainder(rsg2);
- FX_INT32 denominatorLeadingTerm = other->GetCoefficients(other->GetDegree());
- FX_INT32 inverseDenominatorLeadingTeam = m_field->Inverse(denominatorLeadingTerm, e);
+ int32_t denominatorLeadingTerm = other->GetCoefficients(other->GetDegree());
+ int32_t inverseDenominatorLeadingTeam = m_field->Inverse(denominatorLeadingTerm, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
FX_BOOL bFirst = TRUE;
while(remainder->GetDegree() >= other->GetDegree() && !remainder->IsZero()) {
- FX_INT32 degreeDifference = remainder->GetDegree() - other->GetDegree();
- FX_INT32 scale = m_field->Multiply(remainder->GetCoefficients((remainder->GetDegree())),
+ int32_t degreeDifference = remainder->GetDegree() - other->GetDegree();
+ int32_t scale = m_field->Multiply(remainder->GetCoefficients((remainder->GetDegree())),
inverseDenominatorLeadingTeam);
CBC_ReedSolomonGF256Poly* rsg3 = other->MultiplyByMonomial(degreeDifference, scale, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
index 5c9ae6cce6..d7f1508b40 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
@@ -10,21 +10,21 @@ class CBC_ReedSolomonGF256;
class CBC_ReedSolomonGF256Poly
{
public:
- CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients);
+ CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, int32_t coefficients);
CBC_ReedSolomonGF256Poly();
virtual ~CBC_ReedSolomonGF256Poly();
- FX_INT32 GetCoefficients(FX_INT32 degree);
+ int32_t GetCoefficients(int32_t degree);
CFX_Int32Array* GetCoefficients();
- FX_INT32 GetDegree();
+ int32_t GetDegree();
FX_BOOL IsZero();
- FX_INT32 EvaluateAt(FX_INT32 a);
- CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* Multiply(FX_INT32 scalar, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
- CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e);
- CBC_ReedSolomonGF256Poly* Clone(FX_INT32 &e);
- virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e);
+ int32_t EvaluateAt(int32_t a);
+ CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, int32_t &e);
+ CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, int32_t &e);
+ CBC_ReedSolomonGF256Poly* Multiply(int32_t scalar, int32_t &e);
+ CBC_ReedSolomonGF256Poly* MultiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e);
+ CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, int32_t &e);
+ CBC_ReedSolomonGF256Poly* Clone(int32_t &e);
+ virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, int32_t &e);
private:
CBC_ReedSolomonGF256* m_field;
CFX_Int32Array m_coefficients;