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

Side by Side Diff: xfa/src/fxbarcode/BC_BarCode.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months 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/fwl/src/theme/widgettp.cpp ('k') | xfa/src/fxbarcode/BC_Binarizer.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 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "pdf417/BC_PDF417Reader.h" 79 #include "pdf417/BC_PDF417Reader.h"
80 #include "pdf417/BC_PDF417HighLevelEncoder.h" 80 #include "pdf417/BC_PDF417HighLevelEncoder.h"
81 #include "qrcode/BC_QRCodeReader.h" 81 #include "qrcode/BC_QRCodeReader.h"
82 #include "qrcode/BC_QRCodeWriter.h" 82 #include "qrcode/BC_QRCodeWriter.h"
83 CBC_CodeBase :: CBC_CodeBase() 83 CBC_CodeBase :: CBC_CodeBase()
84 { 84 {
85 } 85 }
86 CBC_CodeBase :: ~CBC_CodeBase() 86 CBC_CodeBase :: ~CBC_CodeBase()
87 { 87 {
88 } 88 }
89 FX_BOOL CBC_CodeBase::SetCharEncoding(FX_INT32 encoding) 89 FX_BOOL CBC_CodeBase::SetCharEncoding(int32_t encoding)
90 { 90 {
91 if (m_pBCWriter) { 91 if (m_pBCWriter) {
92 return m_pBCWriter->SetCharEncoding(encoding); 92 return m_pBCWriter->SetCharEncoding(encoding);
93 } 93 }
94 return FALSE; 94 return FALSE;
95 } 95 }
96 FX_BOOL CBC_CodeBase::SetModuleHeight(FX_INT32 moduleHeight) 96 FX_BOOL CBC_CodeBase::SetModuleHeight(int32_t moduleHeight)
97 { 97 {
98 if (m_pBCWriter) { 98 if (m_pBCWriter) {
99 return m_pBCWriter->SetModuleHeight(moduleHeight); 99 return m_pBCWriter->SetModuleHeight(moduleHeight);
100 } 100 }
101 return FALSE; 101 return FALSE;
102 } 102 }
103 FX_BOOL CBC_CodeBase::SetModuleWidth(FX_INT32 moduleWidth) 103 FX_BOOL CBC_CodeBase::SetModuleWidth(int32_t moduleWidth)
104 { 104 {
105 if (m_pBCWriter) { 105 if (m_pBCWriter) {
106 return m_pBCWriter->SetModuleWidth(moduleWidth); 106 return m_pBCWriter->SetModuleWidth(moduleWidth);
107 } 107 }
108 return FALSE; 108 return FALSE;
109 } 109 }
110 FX_BOOL CBC_CodeBase::SetHeight(FX_INT32 height) 110 FX_BOOL CBC_CodeBase::SetHeight(int32_t height)
111 { 111 {
112 if (m_pBCWriter) { 112 if (m_pBCWriter) {
113 return m_pBCWriter->SetHeight(height); 113 return m_pBCWriter->SetHeight(height);
114 } 114 }
115 return FALSE; 115 return FALSE;
116 } 116 }
117 FX_BOOL CBC_CodeBase::SetWidth(FX_INT32 width) 117 FX_BOOL CBC_CodeBase::SetWidth(int32_t width)
118 { 118 {
119 if (m_pBCWriter) { 119 if (m_pBCWriter) {
120 return m_pBCWriter->SetWidth(width); 120 return m_pBCWriter->SetWidth(width);
121 } 121 }
122 return FALSE; 122 return FALSE;
123 } 123 }
124 void CBC_CodeBase::SetBackgroundColor(FX_ARGB backgroundColor) 124 void CBC_CodeBase::SetBackgroundColor(FX_ARGB backgroundColor)
125 { 125 {
126 if (m_pBCWriter) { 126 if (m_pBCWriter) {
127 m_pBCWriter->SetBackgroundColor(backgroundColor); 127 m_pBCWriter->SetBackgroundColor(backgroundColor);
(...skipping 25 matching lines...) Expand all
153 return tmp; 153 return tmp;
154 } 154 }
155 return ((CBC_OneDimWriter*)m_pBCWriter)->FilterContents(contents); 155 return ((CBC_OneDimWriter*)m_pBCWriter)->FilterContents(contents);
156 } 156 }
157 void CBC_OneCode::SetPrintChecksum(FX_BOOL checksum) 157 void CBC_OneCode::SetPrintChecksum(FX_BOOL checksum)
158 { 158 {
159 if (m_pBCWriter) { 159 if (m_pBCWriter) {
160 ((CBC_OneDimWriter*)m_pBCWriter)->SetPrintChecksum(checksum); 160 ((CBC_OneDimWriter*)m_pBCWriter)->SetPrintChecksum(checksum);
161 } 161 }
162 } 162 }
163 void CBC_OneCode::SetDataLength(FX_INT32 length) 163 void CBC_OneCode::SetDataLength(int32_t length)
164 { 164 {
165 if (m_pBCWriter) { 165 if (m_pBCWriter) {
166 ((CBC_OneDimWriter*)m_pBCWriter)->SetDataLength(length); 166 ((CBC_OneDimWriter*)m_pBCWriter)->SetDataLength(length);
167 } 167 }
168 } 168 }
169 void CBC_OneCode::SetCalChecksum(FX_BOOL calc) 169 void CBC_OneCode::SetCalChecksum(FX_BOOL calc)
170 { 170 {
171 if (m_pBCWriter) { 171 if (m_pBCWriter) {
172 ((CBC_OneDimWriter*)m_pBCWriter)->SetCalcChecksum(calc); 172 ((CBC_OneDimWriter*)m_pBCWriter)->SetCalcChecksum(calc);
173 } 173 }
174 } 174 }
175 FX_BOOL CBC_OneCode::SetFont(CFX_Font* cFont) 175 FX_BOOL CBC_OneCode::SetFont(CFX_Font* cFont)
176 { 176 {
177 if (m_pBCWriter) { 177 if (m_pBCWriter) {
178 return ((CBC_OneDimWriter*)m_pBCWriter)->SetFont(cFont); 178 return ((CBC_OneDimWriter*)m_pBCWriter)->SetFont(cFont);
179 } 179 }
180 return FALSE; 180 return FALSE;
181 } 181 }
182 void CBC_OneCode::SetFontSize(FX_FLOAT size) 182 void CBC_OneCode::SetFontSize(FX_FLOAT size)
183 { 183 {
184 if (m_pBCWriter) { 184 if (m_pBCWriter) {
185 ((CBC_OneDimWriter*)m_pBCWriter)->SetFontSize(size); 185 ((CBC_OneDimWriter*)m_pBCWriter)->SetFontSize(size);
186 } 186 }
187 } 187 }
188 void CBC_OneCode::SetFontStyle(FX_INT32 style) 188 void CBC_OneCode::SetFontStyle(int32_t style)
189 { 189 {
190 if (m_pBCWriter) { 190 if (m_pBCWriter) {
191 ((CBC_OneDimWriter*)m_pBCWriter)->SetFontStyle(style); 191 ((CBC_OneDimWriter*)m_pBCWriter)->SetFontStyle(style);
192 } 192 }
193 } 193 }
194 void CBC_OneCode::SetFontColor(FX_ARGB color) 194 void CBC_OneCode::SetFontColor(FX_ARGB color)
195 { 195 {
196 if (m_pBCWriter) { 196 if (m_pBCWriter) {
197 ((CBC_OneDimWriter*)m_pBCWriter)->SetFontColor(color); 197 ((CBC_OneDimWriter*)m_pBCWriter)->SetFontColor(color);
198 } 198 }
(...skipping 17 matching lines...) Expand all
216 { 216 {
217 if(m_pBCReader) { 217 if(m_pBCReader) {
218 delete(m_pBCReader); 218 delete(m_pBCReader);
219 m_pBCReader = NULL; 219 m_pBCReader = NULL;
220 } 220 }
221 if(m_pBCWriter) { 221 if(m_pBCWriter) {
222 delete(m_pBCWriter); 222 delete(m_pBCWriter);
223 m_pBCWriter = NULL; 223 m_pBCWriter = NULL;
224 } 224 }
225 } 225 }
226 FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 226 FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
227 { 227 {
228 if(contents.IsEmpty()) { 228 if(contents.IsEmpty()) {
229 e = BCExceptionNoContents; 229 e = BCExceptionNoContents;
230 return FALSE; 230 return FALSE;
231 } 231 }
232 BCFORMAT format = BCFORMAT_CODE_39; 232 BCFORMAT format = BCFORMAT_CODE_39;
233 FX_INT32 outWidth = 0; 233 int32_t outWidth = 0;
234 FX_INT32 outHeight = 0; 234 int32_t outHeight = 0;
235 CFX_WideString filtercontents = ((CBC_OnedCode39Writer*)m_pBCWriter)->Filter Contents(contents); 235 CFX_WideString filtercontents = ((CBC_OnedCode39Writer*)m_pBCWriter)->Filter Contents(contents);
236 CFX_WideString renderContents = ((CBC_OnedCode39Writer*)m_pBCWriter)->Render TextContents(contents); 236 CFX_WideString renderContents = ((CBC_OnedCode39Writer*)m_pBCWriter)->Render TextContents(contents);
237 m_renderContents = renderContents; 237 m_renderContents = renderContents;
238 CFX_ByteString byteString = filtercontents.UTF8Encode(); 238 CFX_ByteString byteString = filtercontents.UTF8Encode();
239 FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); 239 uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
240 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 240 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
241 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(renderContents, data, outWidt h, isDevice, e); 241 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(renderContents, data, outWidt h, isDevice, e);
242 FX_Free(data); 242 FX_Free(data);
243 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 243 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
244 return TRUE; 244 return TRUE;
245 } 245 }
246 FX_BOOL»CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* mat irx, FX_INT32 &e) 246 FX_BOOL»CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* mat irx, int32_t &e)
247 { 247 {
248 CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedCont ents(m_renderContents, e); 248 CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedCont ents(m_renderContents, e);
249 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderC on, e); 249 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderC on, e);
250 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 250 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
251 return TRUE; 251 return TRUE;
252 } 252 }
253 FX_BOOL»CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 253 FX_BOOL»CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
254 { 254 {
255 CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedCont ents(m_renderContents, e); 255 CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedCont ents(m_renderContents, e);
256 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e); 256 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e);
257 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 257 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
258 return TRUE; 258 return TRUE;
259 } 259 }
260 CFX_WideString CBC_Code39::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) 260 CFX_WideString CBC_Code39::Decode(uint8_t* buf, int32_t width, int32_t hight, in t32_t &e)
261 { 261 {
262 CFX_WideString str; 262 CFX_WideString str;
263 return str; 263 return str;
264 } 264 }
265 CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 265 CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
266 { 266 {
267 CBC_BufferedImageLuminanceSource source(pBitmap); 267 CBC_BufferedImageLuminanceSource source(pBitmap);
268 CBC_GlobalHistogramBinarizer binarizer(&source); 268 CBC_GlobalHistogramBinarizer binarizer(&source);
269 CBC_BinaryBitmap bitmap(&binarizer); 269 CBC_BinaryBitmap bitmap(&binarizer);
270 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); 270 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
271 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 271 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
272 return CFX_WideString::FromUTF8(str, str.GetLength()); 272 return CFX_WideString::FromUTF8(str, str.GetLength());
273 } 273 }
274 FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location) 274 FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location)
275 { 275 {
276 if (m_pBCWriter) { 276 if (m_pBCWriter) {
277 return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetTextLocation(location); 277 return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetTextLocation(location);
278 } 278 }
279 return FALSE; 279 return FALSE;
280 } 280 }
281 FX_BOOL CBC_Code39::SetWideNarrowRatio(FX_INT32 ratio) 281 FX_BOOL CBC_Code39::SetWideNarrowRatio(int32_t ratio)
282 { 282 {
283 if (m_pBCWriter) { 283 if (m_pBCWriter) {
284 return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetWideNarrowRatio(ratio); 284 return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetWideNarrowRatio(ratio);
285 } 285 }
286 return FALSE; 286 return FALSE;
287 } 287 }
288 CBC_Codabar::CBC_Codabar() 288 CBC_Codabar::CBC_Codabar()
289 { 289 {
290 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedCodaBarReader); 290 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedCodaBarReader);
291 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedCodaBarWriter); 291 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedCodaBarWriter);
(...skipping 20 matching lines...) Expand all
312 { 312 {
313 if (m_pBCWriter) { 313 if (m_pBCWriter) {
314 return ((CBC_OnedCodaBarWriter*)m_pBCWriter)->SetEndChar(end); 314 return ((CBC_OnedCodaBarWriter*)m_pBCWriter)->SetEndChar(end);
315 } 315 }
316 return FALSE; 316 return FALSE;
317 } 317 }
318 FX_BOOL CBC_Codabar::SetTextLocation(BC_TEXT_LOC location) 318 FX_BOOL CBC_Codabar::SetTextLocation(BC_TEXT_LOC location)
319 { 319 {
320 return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetTextLocation(location); 320 return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetTextLocation(location);
321 } 321 }
322 FX_BOOL CBC_Codabar::SetWideNarrowRatio(FX_INT32 ratio) 322 FX_BOOL CBC_Codabar::SetWideNarrowRatio(int32_t ratio)
323 { 323 {
324 if (m_pBCWriter) { 324 if (m_pBCWriter) {
325 return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetWideNarrowRatio(ratio) ; 325 return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetWideNarrowRatio(ratio) ;
326 } 326 }
327 return FALSE; 327 return FALSE;
328 } 328 }
329 FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 329 FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
330 { 330 {
331 if(contents.IsEmpty()) { 331 if(contents.IsEmpty()) {
332 e = BCExceptionNoContents; 332 e = BCExceptionNoContents;
333 return FALSE; 333 return FALSE;
334 } 334 }
335 BCFORMAT format = BCFORMAT_CODABAR; 335 BCFORMAT format = BCFORMAT_CODABAR;
336 FX_INT32 outWidth = 0; 336 int32_t outWidth = 0;
337 FX_INT32 outHeight = 0; 337 int32_t outHeight = 0;
338 CFX_WideString filtercontents = ((CBC_OneDimWriter*)m_pBCWriter)->FilterCont ents(contents); 338 CFX_WideString filtercontents = ((CBC_OneDimWriter*)m_pBCWriter)->FilterCont ents(contents);
339 CFX_ByteString byteString = filtercontents.UTF8Encode(); 339 CFX_ByteString byteString = filtercontents.UTF8Encode();
340 m_renderContents = filtercontents; 340 m_renderContents = filtercontents;
341 FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); 341 uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
342 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 342 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
343 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(filtercontents, data, outWidt h, isDevice, e); 343 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(filtercontents, data, outWidt h, isDevice, e);
344 FX_Free(data); 344 FX_Free(data);
345 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 345 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
346 return TRUE; 346 return TRUE;
347 } 347 }
348 FX_BOOL»CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* ma tirx, FX_INT32 &e) 348 FX_BOOL»CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* ma tirx, int32_t &e)
349 { 349 {
350 CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedCon tents(m_renderContents); 350 CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedCon tents(m_renderContents);
351 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderC on, e); 351 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderC on, e);
352 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 352 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
353 return TRUE; 353 return TRUE;
354 } 354 }
355 FX_BOOL»CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 355 FX_BOOL»CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
356 { 356 {
357 CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedCon tents(m_renderContents); 357 CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedCon tents(m_renderContents);
358 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e); 358 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e);
359 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 359 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
360 return TRUE; 360 return TRUE;
361 } 361 }
362 CFX_WideString CBC_Codabar::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) 362 CFX_WideString CBC_Codabar::Decode(uint8_t* buf, int32_t width, int32_t hight, i nt32_t &e)
363 { 363 {
364 CFX_WideString str; 364 CFX_WideString str;
365 return str; 365 return str;
366 } 366 }
367 CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 367 CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
368 { 368 {
369 CBC_BufferedImageLuminanceSource source(pBitmap); 369 CBC_BufferedImageLuminanceSource source(pBitmap);
370 CBC_GlobalHistogramBinarizer binarizer(&source); 370 CBC_GlobalHistogramBinarizer binarizer(&source);
371 CBC_BinaryBitmap bitmap(&binarizer); 371 CBC_BinaryBitmap bitmap(&binarizer);
372 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); 372 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
373 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 373 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
374 return CFX_WideString::FromUTF8(str, str.GetLength()); 374 return CFX_WideString::FromUTF8(str, str.GetLength());
375 } 375 }
376 CBC_Code128::CBC_Code128(BC_TYPE type) 376 CBC_Code128::CBC_Code128(BC_TYPE type)
377 { 377 {
(...skipping 11 matching lines...) Expand all
389 m_pBCWriter = NULL; 389 m_pBCWriter = NULL;
390 } 390 }
391 } 391 }
392 FX_BOOL CBC_Code128::SetTextLocation(BC_TEXT_LOC location) 392 FX_BOOL CBC_Code128::SetTextLocation(BC_TEXT_LOC location)
393 { 393 {
394 if (m_pBCWriter) { 394 if (m_pBCWriter) {
395 return (( CBC_OnedCode128Writer*)m_pBCWriter)->SetTextLocation(location) ; 395 return (( CBC_OnedCode128Writer*)m_pBCWriter)->SetTextLocation(location) ;
396 } 396 }
397 return FALSE; 397 return FALSE;
398 } 398 }
399 FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 399 FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
400 { 400 {
401 if(contents.IsEmpty()) { 401 if(contents.IsEmpty()) {
402 e = BCExceptionNoContents; 402 e = BCExceptionNoContents;
403 return FALSE; 403 return FALSE;
404 } 404 }
405 BCFORMAT format = BCFORMAT_CODE_128; 405 BCFORMAT format = BCFORMAT_CODE_128;
406 FX_INT32 outWidth = 0; 406 int32_t outWidth = 0;
407 FX_INT32 outHeight = 0; 407 int32_t outHeight = 0;
408 CFX_WideString content = contents; 408 CFX_WideString content = contents;
409 if (contents.GetLength() % 2 && ((CBC_OnedCode128Writer *)m_pBCWriter)->GetT ype() == BC_CODE128_C) { 409 if (contents.GetLength() % 2 && ((CBC_OnedCode128Writer *)m_pBCWriter)->GetT ype() == BC_CODE128_C) {
410 content += '0'; 410 content += '0';
411 } 411 }
412 CFX_WideString encodeContents = ((CBC_OnedCode128Writer*)m_pBCWriter)->Filte rContents(content); 412 CFX_WideString encodeContents = ((CBC_OnedCode128Writer*)m_pBCWriter)->Filte rContents(content);
413 m_renderContents = encodeContents; 413 m_renderContents = encodeContents;
414 CFX_ByteString byteString = encodeContents.UTF8Encode(); 414 CFX_ByteString byteString = encodeContents.UTF8Encode();
415 FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); 415 uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
416 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 416 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
417 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e); 417 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e);
418 FX_Free(data); 418 FX_Free(data);
419 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 419 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
420 return TRUE; 420 return TRUE;
421 } 421 }
422 FX_BOOL»CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* ma tirx, FX_INT32 &e) 422 FX_BOOL»CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* ma tirx, int32_t &e)
423 { 423 {
424 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e); 424 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e);
425 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 425 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
426 return TRUE; 426 return TRUE;
427 } 427 }
428 FX_BOOL»CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 428 FX_BOOL»CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
429 { 429 {
430 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e); 430 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e);
431 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 431 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
432 return TRUE; 432 return TRUE;
433 } 433 }
434 CFX_WideString CBC_Code128::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) 434 CFX_WideString CBC_Code128::Decode(uint8_t* buf, int32_t width, int32_t hight, i nt32_t &e)
435 { 435 {
436 CFX_WideString str; 436 CFX_WideString str;
437 return str; 437 return str;
438 } 438 }
439 CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 439 CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
440 { 440 {
441 CBC_BufferedImageLuminanceSource source(pBitmap); 441 CBC_BufferedImageLuminanceSource source(pBitmap);
442 CBC_GlobalHistogramBinarizer binarizer(&source); 442 CBC_GlobalHistogramBinarizer binarizer(&source);
443 CBC_BinaryBitmap bitmap(&binarizer); 443 CBC_BinaryBitmap bitmap(&binarizer);
444 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); 444 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
445 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 445 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
446 return CFX_WideString::FromUTF8(str, str.GetLength()); 446 return CFX_WideString::FromUTF8(str, str.GetLength());
447 } 447 }
448 CBC_EAN8::CBC_EAN8() 448 CBC_EAN8::CBC_EAN8()
449 { 449 {
450 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedEAN8Reader); 450 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedEAN8Reader);
451 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedEAN8Writer); 451 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedEAN8Writer);
452 } 452 }
453 CBC_EAN8::~CBC_EAN8() 453 CBC_EAN8::~CBC_EAN8()
454 { 454 {
455 if(m_pBCReader) { 455 if(m_pBCReader) {
456 delete(m_pBCReader); 456 delete(m_pBCReader);
457 m_pBCReader = NULL; 457 m_pBCReader = NULL;
458 } 458 }
459 if(m_pBCWriter) { 459 if(m_pBCWriter) {
460 delete(m_pBCWriter); 460 delete(m_pBCWriter);
461 m_pBCWriter = NULL; 461 m_pBCWriter = NULL;
462 } 462 }
463 } 463 }
464 CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents) 464 CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents)
465 { 465 {
466 CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterCo ntents(contents); 466 CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterCo ntents(contents);
467 FX_INT32 length = encodeContents.GetLength(); 467 int32_t length = encodeContents.GetLength();
468 if (length <= 7) { 468 if (length <= 7) {
469 for (FX_INT32 i = 0; i < 7 - length; i++) { 469 for (int32_t i = 0; i < 7 - length; i++) {
470 encodeContents = FX_WCHAR('0') + encodeContents; 470 encodeContents = FX_WCHAR('0') + encodeContents;
471 } 471 }
472 CFX_ByteString byteString = encodeContents.UTF8Encode(); 472 CFX_ByteString byteString = encodeContents.UTF8Encode();
473 FX_INT32 checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(by teString); 473 int32_t checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(byt eString);
474 encodeContents += FX_WCHAR(checksum - 0 + '0'); 474 encodeContents += FX_WCHAR(checksum - 0 + '0');
475 } 475 }
476 if (length > 8) { 476 if (length > 8) {
477 encodeContents = encodeContents.Mid(0, 8); 477 encodeContents = encodeContents.Mid(0, 8);
478 } 478 }
479 return encodeContents; 479 return encodeContents;
480 } 480 }
481 FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 481 FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
482 { 482 {
483 if(contents.IsEmpty()) { 483 if(contents.IsEmpty()) {
484 e = BCExceptionNoContents; 484 e = BCExceptionNoContents;
485 return FALSE; 485 return FALSE;
486 } 486 }
487 BCFORMAT format = BCFORMAT_EAN_8; 487 BCFORMAT format = BCFORMAT_EAN_8;
488 FX_INT32 outWidth = 0; 488 int32_t outWidth = 0;
489 FX_INT32 outHeight = 0; 489 int32_t outHeight = 0;
490 CFX_WideString encodeContents = Preprocess(contents); 490 CFX_WideString encodeContents = Preprocess(contents);
491 CFX_ByteString byteString = encodeContents.UTF8Encode(); 491 CFX_ByteString byteString = encodeContents.UTF8Encode();
492 m_renderContents = encodeContents; 492 m_renderContents = encodeContents;
493 FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); 493 uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
494 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 494 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
495 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e); 495 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e);
496 FX_Free(data); 496 FX_Free(data);
497 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 497 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
498 return TRUE; 498 return TRUE;
499 } 499 }
500 FX_BOOL»CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matir x, FX_INT32 &e) 500 FX_BOOL»CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matir x, int32_t &e)
501 { 501 {
502 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e); 502 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e);
503 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 503 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
504 return TRUE; 504 return TRUE;
505 } 505 }
506 FX_BOOL»CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 506 FX_BOOL»CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
507 { 507 {
508 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e); 508 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e);
509 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 509 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
510 return TRUE; 510 return TRUE;
511 } 511 }
512 CFX_WideString CBC_EAN8::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX _INT32 &e) 512 CFX_WideString CBC_EAN8::Decode(uint8_t* buf, int32_t width, int32_t hight, int3 2_t &e)
513 { 513 {
514 CFX_WideString str; 514 CFX_WideString str;
515 return str; 515 return str;
516 } 516 }
517 CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 517 CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
518 { 518 {
519 CBC_BufferedImageLuminanceSource source(pBitmap); 519 CBC_BufferedImageLuminanceSource source(pBitmap);
520 CBC_GlobalHistogramBinarizer binarizer(&source); 520 CBC_GlobalHistogramBinarizer binarizer(&source);
521 CBC_BinaryBitmap bitmap(&binarizer); 521 CBC_BinaryBitmap bitmap(&binarizer);
522 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); 522 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
523 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 523 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
524 return CFX_WideString::FromUTF8(str, str.GetLength()); 524 return CFX_WideString::FromUTF8(str, str.GetLength());
525 } 525 }
526 CBC_EAN13::CBC_EAN13() 526 CBC_EAN13::CBC_EAN13()
527 { 527 {
528 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedEAN13Reader); 528 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedEAN13Reader);
529 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedEAN13Writer); 529 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedEAN13Writer);
530 } 530 }
531 CBC_EAN13::~CBC_EAN13() 531 CBC_EAN13::~CBC_EAN13()
532 { 532 {
533 if(m_pBCReader) { 533 if(m_pBCReader) {
534 delete(m_pBCReader); 534 delete(m_pBCReader);
535 m_pBCReader = NULL; 535 m_pBCReader = NULL;
536 } 536 }
537 if(m_pBCWriter) { 537 if(m_pBCWriter) {
538 delete(m_pBCWriter); 538 delete(m_pBCWriter);
539 m_pBCWriter = NULL; 539 m_pBCWriter = NULL;
540 } 540 }
541 } 541 }
542 CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents) 542 CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents)
543 { 543 {
544 CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterCo ntents(contents); 544 CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterCo ntents(contents);
545 FX_INT32 length = encodeContents.GetLength(); 545 int32_t length = encodeContents.GetLength();
546 if (length <= 12) { 546 if (length <= 12) {
547 for (FX_INT32 i = 0; i < 12 - length; i++) { 547 for (int32_t i = 0; i < 12 - length; i++) {
548 encodeContents = FX_WCHAR('0') + encodeContents; 548 encodeContents = FX_WCHAR('0') + encodeContents;
549 } 549 }
550 CFX_ByteString byteString = encodeContents.UTF8Encode(); 550 CFX_ByteString byteString = encodeContents.UTF8Encode();
551 FX_INT32 checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(b yteString); 551 int32_t checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(by teString);
552 byteString += checksum - 0 + '0'; 552 byteString += checksum - 0 + '0';
553 encodeContents = byteString.UTF8Decode(); 553 encodeContents = byteString.UTF8Decode();
554 } 554 }
555 if (length > 13) { 555 if (length > 13) {
556 encodeContents = encodeContents.Mid(0, 13); 556 encodeContents = encodeContents.Mid(0, 13);
557 } 557 }
558 return encodeContents; 558 return encodeContents;
559 } 559 }
560 FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 560 FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
561 { 561 {
562 if(contents.IsEmpty()) { 562 if(contents.IsEmpty()) {
563 e = BCExceptionNoContents; 563 e = BCExceptionNoContents;
564 return FALSE; 564 return FALSE;
565 } 565 }
566 BCFORMAT format = BCFORMAT_EAN_13; 566 BCFORMAT format = BCFORMAT_EAN_13;
567 FX_INT32 outWidth = 0; 567 int32_t outWidth = 0;
568 FX_INT32 outHeight = 0; 568 int32_t outHeight = 0;
569 CFX_WideString encodeContents = Preprocess(contents); 569 CFX_WideString encodeContents = Preprocess(contents);
570 CFX_ByteString byteString = encodeContents.UTF8Encode(); 570 CFX_ByteString byteString = encodeContents.UTF8Encode();
571 m_renderContents = encodeContents; 571 m_renderContents = encodeContents;
572 FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); 572 uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
573 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 573 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
574 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e); 574 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e);
575 FX_Free(data); 575 FX_Free(data);
576 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 576 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
577 return TRUE; 577 return TRUE;
578 } 578 }
579 FX_BOOL»CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* mati rx, FX_INT32 &e) 579 FX_BOOL»CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* mati rx, int32_t &e)
580 { 580 {
581 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e); 581 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e);
582 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 582 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
583 return TRUE; 583 return TRUE;
584 } 584 }
585 FX_BOOL»CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 585 FX_BOOL»CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
586 { 586 {
587 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e); 587 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e);
588 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 588 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
589 return TRUE; 589 return TRUE;
590 } 590 }
591 CFX_WideString CBC_EAN13::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, F X_INT32 &e) 591 CFX_WideString CBC_EAN13::Decode(uint8_t* buf, int32_t width, int32_t hight, int 32_t &e)
592 { 592 {
593 CFX_WideString str; 593 CFX_WideString str;
594 return str; 594 return str;
595 } 595 }
596 CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 596 CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
597 { 597 {
598 CBC_BufferedImageLuminanceSource source(pBitmap); 598 CBC_BufferedImageLuminanceSource source(pBitmap);
599 CBC_GlobalHistogramBinarizer binarizer(&source); 599 CBC_GlobalHistogramBinarizer binarizer(&source);
600 CBC_BinaryBitmap bitmap(&binarizer); 600 CBC_BinaryBitmap bitmap(&binarizer);
601 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); 601 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
602 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 602 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
603 return CFX_WideString::FromUTF8(str, str.GetLength()); 603 return CFX_WideString::FromUTF8(str, str.GetLength());
604 } 604 }
605 CBC_UPCA::CBC_UPCA() 605 CBC_UPCA::CBC_UPCA()
606 { 606 {
607 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedUPCAReader); 607 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedUPCAReader);
608 ((CBC_OnedUPCAReader *)m_pBCReader)->Init(); 608 ((CBC_OnedUPCAReader *)m_pBCReader)->Init();
609 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedUPCAWriter); 609 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedUPCAWriter);
610 } 610 }
611 CBC_UPCA::~CBC_UPCA() 611 CBC_UPCA::~CBC_UPCA()
612 { 612 {
613 if(m_pBCReader) { 613 if(m_pBCReader) {
614 delete(m_pBCReader); 614 delete(m_pBCReader);
615 m_pBCReader = NULL; 615 m_pBCReader = NULL;
616 } 616 }
617 if(m_pBCWriter) { 617 if(m_pBCWriter) {
618 delete(m_pBCWriter); 618 delete(m_pBCWriter);
619 m_pBCWriter = NULL; 619 m_pBCWriter = NULL;
620 } 620 }
621 } 621 }
622 CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents) 622 CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents)
623 { 623 {
624 CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterCo ntents(contents); 624 CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterCo ntents(contents);
625 FX_INT32 length = encodeContents.GetLength(); 625 int32_t length = encodeContents.GetLength();
626 if (length <= 11) { 626 if (length <= 11) {
627 for (FX_INT32 i = 0; i < 11 - length; i++) { 627 for (int32_t i = 0; i < 11 - length; i++) {
628 encodeContents = FX_WCHAR('0') + encodeContents; 628 encodeContents = FX_WCHAR('0') + encodeContents;
629 } 629 }
630 CFX_ByteString byteString = encodeContents.UTF8Encode(); 630 CFX_ByteString byteString = encodeContents.UTF8Encode();
631 FX_INT32 checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(by teString); 631 int32_t checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(byt eString);
632 byteString += checksum - 0 + '0'; 632 byteString += checksum - 0 + '0';
633 encodeContents = byteString.UTF8Decode(); 633 encodeContents = byteString.UTF8Decode();
634 } 634 }
635 if (length > 12) { 635 if (length > 12) {
636 encodeContents = encodeContents.Mid(0, 12); 636 encodeContents = encodeContents.Mid(0, 12);
637 } 637 }
638 return encodeContents; 638 return encodeContents;
639 } 639 }
640 FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 640 FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
641 { 641 {
642 if(contents.IsEmpty()) { 642 if(contents.IsEmpty()) {
643 e = BCExceptionNoContents; 643 e = BCExceptionNoContents;
644 return FALSE; 644 return FALSE;
645 } 645 }
646 BCFORMAT format = BCFORMAT_UPC_A; 646 BCFORMAT format = BCFORMAT_UPC_A;
647 FX_INT32 outWidth = 0; 647 int32_t outWidth = 0;
648 FX_INT32 outHeight = 0; 648 int32_t outHeight = 0;
649 CFX_WideString encodeContents = Preprocess(contents); 649 CFX_WideString encodeContents = Preprocess(contents);
650 CFX_ByteString byteString = encodeContents.UTF8Encode(); 650 CFX_ByteString byteString = encodeContents.UTF8Encode();
651 m_renderContents = encodeContents; 651 m_renderContents = encodeContents;
652 ((CBC_OnedUPCAWriter*)m_pBCWriter)->Init(); 652 ((CBC_OnedUPCAWriter*)m_pBCWriter)->Init();
653 FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); 653 uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);
654 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 654 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
655 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e); 655 ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidt h, isDevice, e);
656 FX_Free(data); 656 FX_Free(data);
657 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 657 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
658 return TRUE; 658 return TRUE;
659 } 659 }
660 FX_BOOL»CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matir x, FX_INT32 &e) 660 FX_BOOL»CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matir x, int32_t &e)
661 { 661 {
662 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e); 662 ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_rende rContents, e);
663 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 663 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
664 return TRUE; 664 return TRUE;
665 } 665 }
666 FX_BOOL»CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 666 FX_BOOL»CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
667 { 667 {
668 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e); 668 ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderCon tents, e);
669 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 669 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
670 return TRUE; 670 return TRUE;
671 } 671 }
672 CFX_WideString CBC_UPCA::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX _INT32 &e) 672 CFX_WideString CBC_UPCA::Decode(uint8_t* buf, int32_t width, int32_t hight, int3 2_t &e)
673 { 673 {
674 CFX_WideString str; 674 CFX_WideString str;
675 return str; 675 return str;
676 } 676 }
677 CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 677 CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
678 { 678 {
679 CBC_BufferedImageLuminanceSource source(pBitmap); 679 CBC_BufferedImageLuminanceSource source(pBitmap);
680 CBC_GlobalHistogramBinarizer binarizer(&source); 680 CBC_GlobalHistogramBinarizer binarizer(&source);
681 CBC_BinaryBitmap bitmap(&binarizer); 681 CBC_BinaryBitmap bitmap(&binarizer);
682 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e); 682 CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);
683 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 683 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
684 return CFX_WideString::FromUTF8(str, str.GetLength()); 684 return CFX_WideString::FromUTF8(str, str.GetLength());
685 } 685 }
686 CBC_QRCode::CBC_QRCode() 686 CBC_QRCode::CBC_QRCode()
687 { 687 {
688 m_pBCReader = (CBC_Reader *) FX_NEW (CBC_QRCodeReader); 688 m_pBCReader = (CBC_Reader *) FX_NEW (CBC_QRCodeReader);
689 ((CBC_QRCodeReader*)m_pBCReader)->Init(); 689 ((CBC_QRCodeReader*)m_pBCReader)->Init();
690 m_pBCWriter = (CBC_Writer *) FX_NEW (CBC_QRCodeWriter); 690 m_pBCWriter = (CBC_Writer *) FX_NEW (CBC_QRCodeWriter);
691 } 691 }
692 CBC_QRCode ::~CBC_QRCode() 692 CBC_QRCode ::~CBC_QRCode()
693 { 693 {
694 if(m_pBCReader) { 694 if(m_pBCReader) {
695 delete(m_pBCReader); 695 delete(m_pBCReader);
696 m_pBCReader = NULL; 696 m_pBCReader = NULL;
697 } 697 }
698 if(m_pBCWriter) { 698 if(m_pBCWriter) {
699 delete(m_pBCWriter); 699 delete(m_pBCWriter);
700 m_pBCWriter = NULL; 700 m_pBCWriter = NULL;
701 } 701 }
702 } 702 }
703 FX_BOOL CBC_QRCode::SetVersion(FX_INT32 version) 703 FX_BOOL CBC_QRCode::SetVersion(int32_t version)
704 { 704 {
705 if (version < 0 || version > 40) { 705 if (version < 0 || version > 40) {
706 return FALSE; 706 return FALSE;
707 } 707 }
708 if (m_pBCWriter == NULL) { 708 if (m_pBCWriter == NULL) {
709 return FALSE; 709 return FALSE;
710 } 710 }
711 return((CBC_QRCodeWriter*)m_pBCWriter)->SetVersion(version); 711 return((CBC_QRCodeWriter*)m_pBCWriter)->SetVersion(version);
712 } 712 }
713 FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (FX_INT32 level) 713 FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (int32_t level)
714 { 714 {
715 if (level < 0 || level > 3) { 715 if (level < 0 || level > 3) {
716 return FALSE; 716 return FALSE;
717 } 717 }
718 if (m_pBCWriter == NULL) { 718 if (m_pBCWriter == NULL) {
719 return FALSE; 719 return FALSE;
720 } 720 }
721 return ((CBC_TwoDimWriter*)m_pBCWriter)->SetErrorCorrectionLevel(level); 721 return ((CBC_TwoDimWriter*)m_pBCWriter)->SetErrorCorrectionLevel(level);
722 } 722 }
723 FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 723 FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
724 { 724 {
725 FX_INT32 outWidth = 0; 725 int32_t outWidth = 0;
726 FX_INT32 outHeight = 0; 726 int32_t outHeight = 0;
727 FX_BYTE *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRC odeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e); 727 uint8_t *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRC odeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e);
728 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 728 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
729 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e) ; 729 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e) ;
730 FX_Free(data); 730 FX_Free(data);
731 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 731 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
732 return TRUE; 732 return TRUE;
733 } 733 }
734 FX_BOOL»CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* mat irx, FX_INT32 &e) 734 FX_BOOL»CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* mat irx, int32_t &e)
735 { 735 {
736 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx); 736 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);
737 return TRUE; 737 return TRUE;
738 } 738 }
739 FX_BOOL»CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 739 FX_BOOL»CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
740 { 740 {
741 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e); 741 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);
742 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 742 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
743 return TRUE; 743 return TRUE;
744 } 744 }
745 CFX_WideString CBC_QRCode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) 745 CFX_WideString CBC_QRCode::Decode(uint8_t* buf, int32_t width, int32_t hight, in t32_t &e)
746 { 746 {
747 CFX_WideString str; 747 CFX_WideString str;
748 return str; 748 return str;
749 } 749 }
750 CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 750 CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
751 { 751 {
752 CBC_BufferedImageLuminanceSource source(pBitmap); 752 CBC_BufferedImageLuminanceSource source(pBitmap);
753 CBC_GlobalHistogramBinarizer binarizer(&source); 753 CBC_GlobalHistogramBinarizer binarizer(&source);
754 CBC_BinaryBitmap bitmap(&binarizer); 754 CBC_BinaryBitmap bitmap(&binarizer);
755 CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e); 755 CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e);
756 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 756 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
757 return CFX_WideString::FromUTF8(retStr, retStr.GetLength()); 757 return CFX_WideString::FromUTF8(retStr, retStr.GetLength());
758 } 758 }
759 CBC_PDF417I::CBC_PDF417I() 759 CBC_PDF417I::CBC_PDF417I()
760 { 760 {
761 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_PDF417Reader); 761 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_PDF417Reader);
762 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_PDF417Writer); 762 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_PDF417Writer);
763 } 763 }
764 CBC_PDF417I::~CBC_PDF417I() 764 CBC_PDF417I::~CBC_PDF417I()
765 { 765 {
766 if(m_pBCReader) { 766 if(m_pBCReader) {
767 delete(m_pBCReader); 767 delete(m_pBCReader);
768 m_pBCReader = NULL; 768 m_pBCReader = NULL;
769 } 769 }
770 if(m_pBCWriter) { 770 if(m_pBCWriter) {
771 delete(m_pBCWriter); 771 delete(m_pBCWriter);
772 m_pBCWriter = NULL; 772 m_pBCWriter = NULL;
773 } 773 }
774 } 774 }
775 FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (FX_INT32 level) 775 FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (int32_t level)
776 { 776 {
777 ((CBC_PDF417Writer*)m_pBCWriter)->SetErrorCorrectionLevel(level); 777 ((CBC_PDF417Writer*)m_pBCWriter)->SetErrorCorrectionLevel(level);
778 return TRUE; 778 return TRUE;
779 } 779 }
780 void CBC_PDF417I::SetTruncated(FX_BOOL truncated) 780 void CBC_PDF417I::SetTruncated(FX_BOOL truncated)
781 { 781 {
782 ((CBC_PDF417Writer*)m_pBCWriter)->SetTruncated(truncated); 782 ((CBC_PDF417Writer*)m_pBCWriter)->SetTruncated(truncated);
783 } 783 }
784 FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 784 FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
785 { 785 {
786 BCFORMAT format = BCFORMAT_PDF_417; 786 BCFORMAT format = BCFORMAT_PDF_417;
787 FX_INT32 outWidth = 0; 787 int32_t outWidth = 0;
788 FX_INT32 outHeight = 0; 788 int32_t outHeight = 0;
789 FX_BYTE *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e); 789 uint8_t *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);
790 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 790 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
791 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e) ; 791 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e) ;
792 FX_Free(data); 792 FX_Free(data);
793 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 793 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
794 return TRUE; 794 return TRUE;
795 } 795 }
796 FX_BOOL»CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* ma tirx, FX_INT32 &e) 796 FX_BOOL»CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* ma tirx, int32_t &e)
797 { 797 {
798 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx); 798 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);
799 return TRUE; 799 return TRUE;
800 } 800 }
801 FX_BOOL»CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 801 FX_BOOL»CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
802 { 802 {
803 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e); 803 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);
804 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 804 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
805 return TRUE; 805 return TRUE;
806 } 806 }
807 CFX_WideString CBC_PDF417I::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) 807 CFX_WideString CBC_PDF417I::Decode(uint8_t* buf, int32_t width, int32_t hight, i nt32_t &e)
808 { 808 {
809 CFX_WideString str; 809 CFX_WideString str;
810 return str; 810 return str;
811 } 811 }
812 CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 812 CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
813 { 813 {
814 CBC_BufferedImageLuminanceSource source(pBitmap); 814 CBC_BufferedImageLuminanceSource source(pBitmap);
815 CBC_GlobalHistogramBinarizer binarizer(&source); 815 CBC_GlobalHistogramBinarizer binarizer(&source);
816 CBC_BinaryBitmap bitmap(&binarizer); 816 CBC_BinaryBitmap bitmap(&binarizer);
817 CFX_ByteString bytestring = m_pBCReader->Decode(&bitmap, 0, e); 817 CFX_ByteString bytestring = m_pBCReader->Decode(&bitmap, 0, e);
818 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 818 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
819 return CFX_WideString::FromUTF8(bytestring, bytestring.GetLength()); 819 return CFX_WideString::FromUTF8(bytestring, bytestring.GetLength());
820 } 820 }
821 CBC_DataMatrix::CBC_DataMatrix() 821 CBC_DataMatrix::CBC_DataMatrix()
822 { 822 {
823 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_DataMatrixReader); 823 m_pBCReader = (CBC_Reader*) FX_NEW (CBC_DataMatrixReader);
824 ((CBC_DataMatrixReader*)m_pBCReader)->Init(); 824 ((CBC_DataMatrixReader*)m_pBCReader)->Init();
825 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_DataMatrixWriter); 825 m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_DataMatrixWriter);
826 } 826 }
827 CBC_DataMatrix::~CBC_DataMatrix() 827 CBC_DataMatrix::~CBC_DataMatrix()
828 { 828 {
829 if(m_pBCReader) { 829 if(m_pBCReader) {
830 delete(m_pBCReader); 830 delete(m_pBCReader);
831 m_pBCReader = NULL; 831 m_pBCReader = NULL;
832 } 832 }
833 if(m_pBCWriter) { 833 if(m_pBCWriter) {
834 delete(m_pBCWriter); 834 delete(m_pBCWriter);
835 m_pBCWriter = NULL; 835 m_pBCWriter = NULL;
836 } 836 }
837 } 837 }
838 FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) 838 FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e)
839 { 839 {
840 FX_INT32 outWidth = 0; 840 int32_t outWidth = 0;
841 FX_INT32 outHeight = 0; 841 int32_t outHeight = 0;
842 FX_BYTE *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outW idth, outHeight, e); 842 uint8_t *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outW idth, outHeight, e);
843 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 843 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
844 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e) ; 844 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e) ;
845 FX_Free(data); 845 FX_Free(data);
846 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 846 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
847 return TRUE; 847 return TRUE;
848 } 848 }
849 FX_BOOL»CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) 849 FX_BOOL»CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e)
850 { 850 {
851 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx); 851 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);
852 return TRUE; 852 return TRUE;
853 } 853 }
854 FX_BOOL»CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) 854 FX_BOOL»CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e)
855 { 855 {
856 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e); 856 ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);
857 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); 857 BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
858 return TRUE; 858 return TRUE;
859 } 859 }
860 CFX_WideString CBC_DataMatrix::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hig ht, FX_INT32 &e) 860 CFX_WideString CBC_DataMatrix::Decode(uint8_t* buf, int32_t width, int32_t hight , int32_t &e)
861 { 861 {
862 CFX_WideString str; 862 CFX_WideString str;
863 return str; 863 return str;
864 } 864 }
865 CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) 865 CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, int32_t &e)
866 { 866 {
867 CBC_BufferedImageLuminanceSource source(pBitmap); 867 CBC_BufferedImageLuminanceSource source(pBitmap);
868 CBC_GlobalHistogramBinarizer binarizer(&source); 868 CBC_GlobalHistogramBinarizer binarizer(&source);
869 CBC_BinaryBitmap bitmap(&binarizer); 869 CBC_BinaryBitmap bitmap(&binarizer);
870 CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e); 870 CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e);
871 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L"")); 871 BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));
872 return CFX_WideString::FromUTF8(retStr, retStr.GetLength()); 872 return CFX_WideString::FromUTF8(retStr, retStr.GetLength());
873 } 873 }
OLDNEW
« no previous file with comments | « xfa/src/fwl/src/theme/widgettp.cpp ('k') | xfa/src/fxbarcode/BC_Binarizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698