summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
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/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
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/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp')
-rw-r--r--xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
index 89e46a74cd..12622c3dff 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
@@ -39,14 +39,14 @@ CBC_DetectionResultRowIndicatorColumn::~CBC_DetectionResultRowIndicatorColumn()
}
void CBC_DetectionResultRowIndicatorColumn::setRowNumbers()
{
- for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) {
+ for (int32_t i = 0; i < m_codewords->GetSize(); i++) {
CBC_Codeword * codeword = (CBC_Codeword*)m_codewords->GetAt(i);
if (codeword != NULL) {
codeword->setRowNumberAsRowIndicatorColumn();
}
}
}
-FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
+int32_t CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
{
CFX_PtrArray* codewords = getCodewords();
setRowNumbers();
@@ -54,18 +54,18 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow
CBC_BoundingBox* boundingBox = getBoundingBox();
CBC_ResultPoint* top = m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight();
CBC_ResultPoint* bottom = m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight();
- FX_INT32 firstRow = imageRowToCodewordIndex((FX_INT32) top->GetY());
- FX_INT32 lastRow = imageRowToCodewordIndex((FX_INT32) bottom->GetY());
+ int32_t firstRow = imageRowToCodewordIndex((int32_t) top->GetY());
+ int32_t lastRow = imageRowToCodewordIndex((int32_t) bottom->GetY());
FX_FLOAT averageRowHeight = (lastRow - firstRow) / (FX_FLOAT) barcodeMetadata.getRowCount();
- FX_INT32 barcodeRow = -1;
- FX_INT32 maxRowHeight = 1;
- FX_INT32 currentRowHeight = 0;
- for (FX_INT32 codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
+ int32_t barcodeRow = -1;
+ int32_t maxRowHeight = 1;
+ int32_t currentRowHeight = 0;
+ for (int32_t codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
- FX_INT32 rowDifference = codeword->getRowNumber() - barcodeRow;
+ int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
} else if (rowDifference == 1) {
@@ -79,14 +79,14 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow
} else if (rowDifference > codewordsRow) {
codewords->SetAt(codewordsRow, NULL);
} else {
- FX_INT32 checkedRows;
+ int32_t checkedRows;
if (maxRowHeight > 2) {
checkedRows = (maxRowHeight - 2) * rowDifference;
} else {
checkedRows = rowDifference;
}
FX_BOOL closePreviousCodewordFound = checkedRows >= codewordsRow;
- for (FX_INT32 i = 1; i <= checkedRows && !closePreviousCodewordFound; i++) {
+ for (int32_t i = 1; i <= checkedRows && !closePreviousCodewordFound; i++) {
closePreviousCodewordFound = codewords->GetAt(codewordsRow - i) != NULL;
}
if (closePreviousCodewordFound) {
@@ -97,9 +97,9 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow
}
}
}
- return (FX_INT32) (averageRowHeight + 0.5);
+ return (int32_t) (averageRowHeight + 0.5);
}
-CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e)
+CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(int32_t &e)
{
CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata();
if (barcodeMetadata == NULL) {
@@ -109,7 +109,7 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e
adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata);
CFX_Int32Array* result = FX_NEW CFX_Int32Array;
result->SetSize(barcodeMetadata->getRowCount());
- for (FX_INT32 i = 0; i < getCodewords()->GetSize(); i++) {
+ for (int32_t i = 0; i < getCodewords()->GetSize(); i++) {
CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i);
if (codeword != NULL) {
result->SetAt(codeword->getRowNumber(), result->GetAt(codeword->getRowNumber()) + 1);
@@ -117,25 +117,25 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e
}
return result;
}
-FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
+int32_t CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata)
{
CBC_BoundingBox* boundingBox = getBoundingBox();
CBC_ResultPoint* top = m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight();
CBC_ResultPoint* bottom = m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight();
- FX_INT32 firstRow = imageRowToCodewordIndex((FX_INT32) top->GetY());
- FX_INT32 lastRow = imageRowToCodewordIndex((FX_INT32) bottom->GetY());
+ int32_t firstRow = imageRowToCodewordIndex((int32_t) top->GetY());
+ int32_t lastRow = imageRowToCodewordIndex((int32_t) bottom->GetY());
FX_FLOAT averageRowHeight = (lastRow - firstRow) / (FX_FLOAT) barcodeMetadata.getRowCount();
CFX_PtrArray* codewords = getCodewords();
- FX_INT32 barcodeRow = -1;
- FX_INT32 maxRowHeight = 1;
- FX_INT32 currentRowHeight = 0;
- for (FX_INT32 codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
+ int32_t barcodeRow = -1;
+ int32_t maxRowHeight = 1;
+ int32_t currentRowHeight = 0;
+ for (int32_t codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) {
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
codeword->setRowNumberAsRowIndicatorColumn();
- FX_INT32 rowDifference = codeword->getRowNumber() - barcodeRow;
+ int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
} else if (rowDifference == 1) {
@@ -149,7 +149,7 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnR
currentRowHeight = 1;
}
}
- return (FX_INT32) (averageRowHeight + 0.5);
+ return (int32_t) (averageRowHeight + 0.5);
}
CBC_BarcodeMetadata* CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata()
{
@@ -158,14 +158,14 @@ CBC_BarcodeMetadata* CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata()
CBC_BarcodeValue barcodeRowCountUpperPart;
CBC_BarcodeValue barcodeRowCountLowerPart;
CBC_BarcodeValue barcodeECLevel;
- for (FX_INT32 i = 0; i < codewords->GetSize(); i++) {
+ for (int32_t i = 0; i < codewords->GetSize(); i++) {
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(i);
if (codeword == NULL) {
continue;
}
codeword->setRowNumberAsRowIndicatorColumn();
- FX_INT32 rowIndicatorValue = codeword->getValue() % 30;
- FX_INT32 codewordRowNumber = codeword->getRowNumber();
+ int32_t rowIndicatorValue = codeword->getValue() % 30;
+ int32_t codewordRowNumber = codeword->getRowNumber();
if (!m_isLeft) {
codewordRowNumber += 2;
}
@@ -205,13 +205,13 @@ CFX_ByteString CBC_DetectionResultRowIndicatorColumn::toString()
}
void CBC_DetectionResultRowIndicatorColumn::removeIncorrectCodewords(CFX_PtrArray* codewords, CBC_BarcodeMetadata barcodeMetadata)
{
- for (FX_INT32 codewordRow = 0; codewordRow < codewords->GetSize(); codewordRow++) {
+ for (int32_t codewordRow = 0; codewordRow < codewords->GetSize(); codewordRow++) {
CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordRow);
if (codeword == NULL) {
continue;
}
- FX_INT32 rowIndicatorValue = codeword->getValue() % 30;
- FX_INT32 codewordRowNumber = codeword->getRowNumber();
+ int32_t rowIndicatorValue = codeword->getValue() % 30;
+ int32_t codewordRowNumber = codeword->getRowNumber();
if (codewordRowNumber > barcodeMetadata.getRowCount()) {
codewords->SetAt(codewordRow, NULL);
continue;