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 2008 ZXing authors | 8 * Copyright 2008 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 contents, ecLevel, shape, minSize, maxSize, e); | 66 contents, ecLevel, shape, minSize, maxSize, e); |
67 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 67 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
68 CBC_SymbolInfo* symbolInfo = CBC_SymbolInfo::lookup( | 68 CBC_SymbolInfo* symbolInfo = CBC_SymbolInfo::lookup( |
69 encoded.GetLength(), shape, minSize, maxSize, TRUE, e); | 69 encoded.GetLength(), shape, minSize, maxSize, TRUE, e); |
70 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 70 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
71 CFX_WideString codewords = | 71 CFX_WideString codewords = |
72 CBC_ErrorCorrection::encodeECC200(encoded, symbolInfo, e); | 72 CBC_ErrorCorrection::encodeECC200(encoded, symbolInfo, e); |
73 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 73 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
74 CBC_DefaultPlacement* placement = | 74 CBC_DefaultPlacement* placement = |
75 new CBC_DefaultPlacement(codewords, symbolInfo->getSymbolDataWidth(e), | 75 new CBC_DefaultPlacement(codewords, symbolInfo->getSymbolDataWidth(e), |
76 symbolInfo->getSymbolDataHeight(e)); | 76 symbolInfo->getSymbolDataHeight(e)); |
77 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 77 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
78 placement->place(); | 78 placement->place(); |
79 CBC_CommonByteMatrix* bytematrix = encodeLowLevel(placement, symbolInfo, e); | 79 CBC_CommonByteMatrix* bytematrix = encodeLowLevel(placement, symbolInfo, e); |
80 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 80 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
81 outWidth = bytematrix->GetWidth(); | 81 outWidth = bytematrix->GetWidth(); |
82 outHeight = bytematrix->GetHeight(); | 82 outHeight = bytematrix->GetHeight(); |
83 uint8_t* result = FX_Alloc(uint8_t, outWidth * outHeight); | 83 uint8_t* result = FX_Alloc(uint8_t, outWidth * outHeight); |
84 FXSYS_memcpy(result, bytematrix->GetArray(), outWidth * outHeight); | 84 FXSYS_memcpy(result, bytematrix->GetArray(), outWidth * outHeight); |
85 delete bytematrix; | 85 delete bytematrix; |
86 delete placement; | 86 delete placement; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 matrixX = 0; | 142 matrixX = 0; |
143 for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { | 143 for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { |
144 matrix->Set(matrixX, matrixY, TRUE); | 144 matrix->Set(matrixX, matrixY, TRUE); |
145 matrixX++; | 145 matrixX++; |
146 } | 146 } |
147 matrixY++; | 147 matrixY++; |
148 } | 148 } |
149 } | 149 } |
150 return matrix; | 150 return matrix; |
151 } | 151 } |
OLD | NEW |