OLD | NEW |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int32_t col = (m_Width / m_ModuleWidth - 69) / 17; | 52 int32_t col = (m_Width / m_ModuleWidth - 69) / 17; |
53 int32_t row = m_Height / (m_ModuleWidth * 20); | 53 int32_t row = m_Height / (m_ModuleWidth * 20); |
54 if (row >= 3 && row <= 90 && col >= 1 && col <= 30) { | 54 if (row >= 3 && row <= 90 && col >= 1 && col <= 30) { |
55 encoder.setDimensions(col, col, row, row); | 55 encoder.setDimensions(col, col, row, row); |
56 } else if (col >= 1 && col <= 30) { | 56 } else if (col >= 1 && col <= 30) { |
57 encoder.setDimensions(col, col, 90, 3); | 57 encoder.setDimensions(col, col, 90, 3); |
58 } else if (row >= 3 && row <= 90) { | 58 } else if (row >= 3 && row <= 90) { |
59 encoder.setDimensions(30, 1, row, row); | 59 encoder.setDimensions(30, 1, row, row); |
60 } | 60 } |
61 encoder.generateBarcodeLogic(contents, m_iCorrectLevel, e); | 61 encoder.generateBarcodeLogic(contents, m_iCorrectLevel, e); |
62 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 62 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); |
63 int32_t lineThickness = 2; | 63 int32_t lineThickness = 2; |
64 int32_t aspectRatio = 4; | 64 int32_t aspectRatio = 4; |
65 CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix(); | 65 CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix(); |
66 CFX_ByteArray originalScale; | 66 CFX_ByteArray originalScale; |
67 originalScale.Copy(barcodeMatrix->getScaledMatrix( | 67 originalScale.Copy(barcodeMatrix->getScaledMatrix( |
68 lineThickness, aspectRatio * lineThickness)); | 68 lineThickness, aspectRatio * lineThickness)); |
69 int32_t width = outWidth; | 69 int32_t width = outWidth; |
70 int32_t height = outHeight; | 70 int32_t height = outHeight; |
71 outWidth = barcodeMatrix->getWidth(); | 71 outWidth = barcodeMatrix->getWidth(); |
72 outHeight = barcodeMatrix->getHeight(); | 72 outHeight = barcodeMatrix->getHeight(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 int32_t width) { | 106 int32_t width) { |
107 CFX_ByteArray temp; | 107 CFX_ByteArray temp; |
108 temp.Copy(bitarray); | 108 temp.Copy(bitarray); |
109 for (int32_t ii = 0; ii < height; ii++) { | 109 for (int32_t ii = 0; ii < height; ii++) { |
110 int32_t inverseii = height - ii - 1; | 110 int32_t inverseii = height - ii - 1; |
111 for (int32_t jj = 0; jj < width; jj++) { | 111 for (int32_t jj = 0; jj < width; jj++) { |
112 bitarray[jj * height + inverseii] = temp[ii * width + jj]; | 112 bitarray[jj * height + inverseii] = temp[ii * width + jj]; |
113 } | 113 } |
114 } | 114 } |
115 } | 115 } |
OLD | NEW |