diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
commit | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch) | |
tree | 4cfbe682869d89900f33751c37f6a84865beeb0a /xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp | |
parent | b116136da234afcad018bb44a3ccb64b9ad2a554 (diff) | |
download | pdfium-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_PDF417Writer.cpp')
-rw-r--r-- | xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp index 86951c91e9..5154b2e231 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -36,7 +36,7 @@ CBC_PDF417Writer::~CBC_PDF417Writer() {
m_bTruncated = TRUE;
}
-FX_BOOL CBC_PDF417Writer:: SetErrorCorrectionLevel(FX_INT32 level)
+FX_BOOL CBC_PDF417Writer:: SetErrorCorrectionLevel(int32_t level)
{
if (level < 0 || level > 8) {
return FALSE;
@@ -48,7 +48,7 @@ void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) {
m_bTruncated = truncated;
}
-FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
if ( format != BCFORMAT_PDF_417) {
return NULL;
@@ -56,15 +56,15 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT forma CFX_WideString encodeContents = contents.UTF8Decode();
return Encode(encodeContents, outWidth, outHeight, e );
}
-FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e)
{
return NULL;
}
-FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e)
{
CBC_PDF417 encoder;
- FX_INT32 col = (m_Width / m_ModuleWidth - 69) / 17;
- FX_INT32 row = m_Height / (m_ModuleWidth * 20);
+ int32_t col = (m_Width / m_ModuleWidth - 69) / 17;
+ int32_t row = m_Height / (m_ModuleWidth * 20);
if (row >= 3 && row <= 90 && col >= 1 && col <= 30) {
encoder.setDimensions(col, col, row, row);
} else if (col >= 1 && col <= 30) {
@@ -74,26 +74,26 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outW }
encoder.generateBarcodeLogic(contents, m_iCorrectLevel, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- FX_INT32 lineThickness = 2;
- FX_INT32 aspectRatio = 4;
+ int32_t lineThickness = 2;
+ int32_t aspectRatio = 4;
CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix();
CFX_ByteArray originalScale;
originalScale.Copy(barcodeMatrix->getScaledMatrix(lineThickness, aspectRatio * lineThickness));
- FX_INT32 width = outWidth;
- FX_INT32 height = outHeight;
+ int32_t width = outWidth;
+ int32_t height = outHeight;
outWidth = barcodeMatrix->getWidth();
outHeight = barcodeMatrix->getHeight();
FX_BOOL rotated = FALSE;
if ((height > width) ^ (outWidth < outHeight)) {
rotateArray(originalScale, outHeight, outWidth);
rotated = TRUE;
- FX_INT32 temp = outHeight;
+ int32_t temp = outHeight;
outHeight = outWidth;
outWidth = temp;
}
- FX_INT32 scaleX = width / outWidth;
- FX_INT32 scaleY = height / outHeight;
- FX_INT32 scale;
+ int32_t scaleX = width / outWidth;
+ int32_t scaleY = height / outHeight;
+ int32_t scale;
if (scaleX < scaleY) {
scale = scaleX;
} else {
@@ -104,22 +104,22 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outW originalScale.Copy(barcodeMatrix->getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness));
if (rotated) {
rotateArray(originalScale, outHeight, outWidth);
- FX_INT32 temp = outHeight;
+ int32_t temp = outHeight;
outHeight = outWidth;
outWidth = temp;
}
}
- FX_BYTE* result = (FX_BYTE*)FX_Alloc(FX_BYTE, outHeight * outWidth);
+ uint8_t* result = (uint8_t*)FX_Alloc(uint8_t, outHeight * outWidth);
FXSYS_memcpy32(result, originalScale.GetData(), outHeight * outWidth);
return result;
}
-void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, FX_INT32 height, FX_INT32 width)
+void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, int32_t height, int32_t width)
{
CFX_ByteArray temp;
temp.Copy(bitarray);
- for (FX_INT32 ii = 0; ii < height; ii++) {
- FX_INT32 inverseii = height - ii - 1;
- for (FX_INT32 jj = 0; jj < width; jj++) {
+ for (int32_t ii = 0; ii < height; ii++) {
+ int32_t inverseii = height - ii - 1;
+ for (int32_t jj = 0; jj < width; jj++) {
bitarray[jj * height + inverseii] = temp[ii * width + jj];
}
}
|