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 | 6 |
7 #ifndef _BC_ONEDUPCEANREADER_H_ | 7 #ifndef _BC_ONEDUPCEANREADER_H_ |
8 #define _BC_ONEDUPCEANREADER_H_ | 8 #define _BC_ONEDUPCEANREADER_H_ |
9 class CBC_OneDReader; | 9 class CBC_OneDReader; |
10 class CBC_CommonBitArray; | 10 class CBC_CommonBitArray; |
11 class CBC_OneDimReader; | 11 class CBC_OneDimReader; |
12 class CBC_OneDimReader : public CBC_OneDReader | 12 class CBC_OneDimReader : public CBC_OneDReader |
13 { | 13 { |
14 private: | 14 private: |
15 const static FX_INT32 MAX_AVG_VARIANCE; | 15 const static int32_t MAX_AVG_VARIANCE; |
16 const static FX_INT32 MAX_INDIVIDUAL_VARIANCE; | 16 const static int32_t MAX_INDIVIDUAL_VARIANCE; |
17 | 17 |
18 FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e); | 18 FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, int32_t &e); |
19 public: | 19 public: |
20 const static FX_INT32 START_END_PATTERN[3]; | 20 const static int32_t START_END_PATTERN[3]; |
21 const static FX_INT32 MIDDLE_PATTERN[5]; | 21 const static int32_t MIDDLE_PATTERN[5]; |
22 const static FX_INT32 L_PATTERNS[10][4]; | 22 const static int32_t L_PATTERNS[10][4]; |
23 const static FX_INT32 L_AND_G_PATTERNS[20][4]; | 23 const static int32_t L_AND_G_PATTERNS[20][4]; |
24 CBC_OneDimReader(); | 24 CBC_OneDimReader(); |
25 virtual ~CBC_OneDimReader(); | 25 virtual ~CBC_OneDimReader(); |
26 CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT
32 hints, FX_INT32 &e); | 26 CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t
hints, int32_t &e); |
27 CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_In
t32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e); | 27 CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int
32Array *startGuardRange, int32_t hints, int32_t &e); |
28 protected: | 28 protected: |
29 CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e); | 29 CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, int32_t &e); |
30 virtual FX_BOOL CheckChecksum(CFX_ByteString &s, FX_INT32 &e); | 30 virtual FX_BOOL CheckChecksum(CFX_ByteString &s, int32_t &e); |
31 CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset
, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &e); | 31 CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, int32_t rowOffset,
FX_BOOL whiteFirst, CFX_Int32Array *pattern, int32_t &e); |
32 FX_INT32 DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_I
NT32 rowOffset, const FX_INT32* patterns, FX_INT32 patternLength, FX_INT32 &e); | 32 int32_t DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32
_t rowOffset, const int32_t* patterns, int32_t patternLength, int32_t &e); |
33 virtual FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *start
Range, CFX_ByteString &resultResult, FX_INT32 &e) | 33 virtual int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startR
ange, CFX_ByteString &resultResult, int32_t &e) |
34 { | 34 { |
35 return 0; | 35 return 0; |
36 } | 36 } |
37 virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, FX_INT32 endStart
, FX_INT32 &e); | 37 virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, int32_t endStart,
int32_t &e); |
38 }; | 38 }; |
39 #endif | 39 #endif |
OLD | NEW |