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

Side by Side Diff: xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp

Issue 1500313002: Clean compiling warnings on Linux (part2) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase Created 5 years 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 unified diff | Download patch
« no previous file with comments | « xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h ('k') | xfa/src/fxfa/src/app/xfa_ffsignature.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 // Original code is licensed as follows: 6 // Original code is licensed as follows:
7 /* 7 /*
8 * Copyright 2012 ZXing authors 8 * Copyright 2012 ZXing authors
9 * 9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * Licensed under the Apache License, Version 2.0 (the "License");
(...skipping 26 matching lines...) Expand all
37 FX_BOOL CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) { 37 FX_BOOL CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) {
38 if (level < 0 || level > 8) { 38 if (level < 0 || level > 8) {
39 return FALSE; 39 return FALSE;
40 } 40 }
41 m_iCorrectLevel = level; 41 m_iCorrectLevel = level;
42 return TRUE; 42 return TRUE;
43 } 43 }
44 void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) { 44 void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) {
45 m_bTruncated = truncated; 45 m_bTruncated = truncated;
46 } 46 }
47 uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString& contents,
48 BCFORMAT format,
49 int32_t& outWidth,
50 int32_t& outHeight,
51 int32_t& e) {
52 if (format != BCFORMAT_PDF_417) {
53 return NULL;
54 }
55 CFX_WideString encodeContents = contents.UTF8Decode();
56 return Encode(encodeContents, outWidth, outHeight, e);
57 }
58 uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString& contents,
59 BCFORMAT format,
60 int32_t& outWidth,
61 int32_t& outHeight,
62 int32_t hints,
63 int32_t& e) {
64 return NULL;
65 }
66 uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents, 47 uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents,
67 int32_t& outWidth, 48 int32_t& outWidth,
68 int32_t& outHeight, 49 int32_t& outHeight,
69 int32_t& e) { 50 int32_t& e) {
70 CBC_PDF417 encoder; 51 CBC_PDF417 encoder;
71 int32_t col = (m_Width / m_ModuleWidth - 69) / 17; 52 int32_t col = (m_Width / m_ModuleWidth - 69) / 17;
72 int32_t row = m_Height / (m_ModuleWidth * 20); 53 int32_t row = m_Height / (m_ModuleWidth * 20);
73 if (row >= 3 && row <= 90 && col >= 1 && col <= 30) { 54 if (row >= 3 && row <= 90 && col >= 1 && col <= 30) {
74 encoder.setDimensions(col, col, row, row); 55 encoder.setDimensions(col, col, row, row);
75 } else if (col >= 1 && col <= 30) { 56 } else if (col >= 1 && col <= 30) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 int32_t width) { 106 int32_t width) {
126 CFX_ByteArray temp; 107 CFX_ByteArray temp;
127 temp.Copy(bitarray); 108 temp.Copy(bitarray);
128 for (int32_t ii = 0; ii < height; ii++) { 109 for (int32_t ii = 0; ii < height; ii++) {
129 int32_t inverseii = height - ii - 1; 110 int32_t inverseii = height - ii - 1;
130 for (int32_t jj = 0; jj < width; jj++) { 111 for (int32_t jj = 0; jj < width; jj++) {
131 bitarray[jj * height + inverseii] = temp[ii * width + jj]; 112 bitarray[jj * height + inverseii] = temp[ii * width + jj];
132 } 113 }
133 } 114 }
134 } 115 }
OLDNEW
« no previous file with comments | « xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h ('k') | xfa/src/fxfa/src/app/xfa_ffsignature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698