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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
87 return result; | 87 return result; |
88 } | 88 } |
89 uint8_t* CBC_DataMatrixWriter::Encode(const CFX_ByteString& contents, | |
90 BCFORMAT format, | |
91 int32_t& outWidth, | |
92 int32_t& outHeight, | |
93 int32_t& e) { | |
94 return NULL; | |
95 } | |
96 uint8_t* CBC_DataMatrixWriter::Encode(const CFX_ByteString& contents, | |
97 BCFORMAT format, | |
98 int32_t& outWidth, | |
99 int32_t& outHeight, | |
100 int32_t hints, | |
101 int32_t& e) { | |
102 return NULL; | |
103 } | |
104 CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel( | 89 CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel( |
105 CBC_DefaultPlacement* placement, | 90 CBC_DefaultPlacement* placement, |
106 CBC_SymbolInfo* symbolInfo, | 91 CBC_SymbolInfo* symbolInfo, |
107 int32_t& e) { | 92 int32_t& e) { |
108 int32_t symbolWidth = symbolInfo->getSymbolDataWidth(e); | 93 int32_t symbolWidth = symbolInfo->getSymbolDataWidth(e); |
109 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 94 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
110 int32_t symbolHeight = symbolInfo->getSymbolDataHeight(e); | 95 int32_t symbolHeight = symbolInfo->getSymbolDataHeight(e); |
111 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 96 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
112 CBC_CommonByteMatrix* matrix = new CBC_CommonByteMatrix( | 97 CBC_CommonByteMatrix* matrix = new CBC_CommonByteMatrix( |
113 symbolInfo->getSymbolWidth(e), symbolInfo->getSymbolHeight(e)); | 98 symbolInfo->getSymbolWidth(e), symbolInfo->getSymbolHeight(e)); |
(...skipping 28 matching lines...) Expand all Loading... |
142 matrixX = 0; | 127 matrixX = 0; |
143 for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { | 128 for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { |
144 matrix->Set(matrixX, matrixY, TRUE); | 129 matrix->Set(matrixX, matrixY, TRUE); |
145 matrixX++; | 130 matrixX++; |
146 } | 131 } |
147 matrixY++; | 132 matrixY++; |
148 } | 133 } |
149 } | 134 } |
150 return matrix; | 135 return matrix; |
151 } | 136 } |
OLD | NEW |