OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef _BC_ONEDUPCEANREADER_H_ | |
8 #define _BC_ONEDUPCEANREADER_H_ | |
9 class CBC_OneDReader; | |
10 class CBC_CommonBitArray; | |
11 class CBC_OneDimReader; | |
12 class CBC_OneDimReader : public CBC_OneDReader | |
13 { | |
14 private: | |
15 const static FX_INT32 MAX_AVG_VARIANCE; | |
16 const static FX_INT32 MAX_INDIVIDUAL_VARIANCE; | |
17 | |
18 FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e); | |
19 public: | |
20 const static FX_INT32 START_END_PATTERN[3]; | |
21 const static FX_INT32 MIDDLE_PATTERN[5]; | |
22 const static FX_INT32 L_PATTERNS[10][4]; | |
23 const static FX_INT32 L_AND_G_PATTERNS[20][4]; | |
24 CBC_OneDimReader(); | |
25 virtual ~CBC_OneDimReader(); | |
26 CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT
32 hints, FX_INT32 &e); | |
27 CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_In
t32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e); | |
28 protected: | |
29 CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e); | |
30 virtual FX_BOOL CheckChecksum(CFX_ByteString &s, FX_INT32 &e); | |
31 CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset
, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &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); | |
33 virtual FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *start
Range, CFX_ByteString &resultResult, FX_INT32 &e) | |
34 { | |
35 return 0; | |
36 } | |
37 virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, FX_INT32 endStart
, FX_INT32 &e); | |
38 }; | |
39 #endif | |
OLD | NEW |