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 2011 ZXing authors | 8 * Copyright 2011 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 } | 131 } |
132 return filtercontents; | 132 return filtercontents; |
133 } | 133 } |
134 uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, | 134 uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, |
135 BCFORMAT format, | 135 BCFORMAT format, |
136 int32_t& outWidth, | 136 int32_t& outWidth, |
137 int32_t& outHeight, | 137 int32_t& outHeight, |
138 int32_t& e) { | 138 int32_t& e) { |
139 uint8_t* ret = Encode(contents, format, outWidth, outHeight, 0, e); | 139 uint8_t* ret = Encode(contents, format, outWidth, outHeight, 0, e); |
140 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 140 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); |
141 return ret; | 141 return ret; |
142 } | 142 } |
143 uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, | 143 uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, |
144 BCFORMAT format, | 144 BCFORMAT format, |
145 int32_t& outWidth, | 145 int32_t& outWidth, |
146 int32_t& outHeight, | 146 int32_t& outHeight, |
147 int32_t hints, | 147 int32_t hints, |
148 int32_t& e) { | 148 int32_t& e) { |
149 if (format != BCFORMAT_CODABAR) { | 149 if (format != BCFORMAT_CODABAR) { |
150 e = BCExceptionOnlyEncodeCODEBAR; | 150 e = BCExceptionOnlyEncodeCODEBAR; |
151 return NULL; | 151 return nullptr; |
152 } | 152 } |
153 uint8_t* ret = | 153 uint8_t* ret = |
154 CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); | 154 CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); |
155 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 155 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); |
156 return ret; | 156 return ret; |
157 } | 157 } |
158 uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, | 158 uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents, |
159 int32_t& outLength, | 159 int32_t& outLength, |
160 int32_t& e) { | 160 int32_t& e) { |
161 CBC_OnedCodaBarReader CodaBarR; | 161 CBC_OnedCodaBarReader CodaBarR; |
162 CFX_ByteString data = m_chStart + contents + m_chEnd; | 162 CFX_ByteString data = m_chStart + contents + m_chEnd; |
163 m_iContentLen = data.GetLength(); | 163 m_iContentLen = data.GetLength(); |
164 uint8_t* result = FX_Alloc2D(uint8_t, m_iWideNarrRatio * 7, data.GetLength()); | 164 uint8_t* result = FX_Alloc2D(uint8_t, m_iWideNarrRatio * 7, data.GetLength()); |
165 FX_CHAR ch; | 165 FX_CHAR ch; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 return strStart + contents + strEnd; | 222 return strStart + contents + strEnd; |
223 } | 223 } |
224 void CBC_OnedCodaBarWriter::RenderResult(const CFX_WideStringC& contents, | 224 void CBC_OnedCodaBarWriter::RenderResult(const CFX_WideStringC& contents, |
225 uint8_t* code, | 225 uint8_t* code, |
226 int32_t codeLength, | 226 int32_t codeLength, |
227 FX_BOOL isDevice, | 227 FX_BOOL isDevice, |
228 int32_t& e) { | 228 int32_t& e) { |
229 CBC_OneDimWriter::RenderResult(encodedContents(contents).AsStringC(), code, | 229 CBC_OneDimWriter::RenderResult(encodedContents(contents).AsStringC(), code, |
230 codeLength, isDevice, e); | 230 codeLength, isDevice, e); |
231 } | 231 } |
OLD | NEW |