Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
index 89e46a74cd31217d9eca75e4828759e5e572afc5..12622c3dffbb942e9d766fb64cea39b3c563f50b 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;
« no previous file with comments | « xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h ('k') | xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698