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 2007 ZXing authors | 8 * Copyright 2007 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 m_name += name; | 48 m_name += name; |
49 m_bits = bits; | 49 m_bits = bits; |
50 } | 50 } |
51 CBC_QRCoderMode::~CBC_QRCoderMode() { | 51 CBC_QRCoderMode::~CBC_QRCoderMode() { |
52 if (m_characterCountBitsForVersions != NULL) { | 52 if (m_characterCountBitsForVersions != NULL) { |
53 FX_Free(m_characterCountBitsForVersions); | 53 FX_Free(m_characterCountBitsForVersions); |
54 } | 54 } |
55 } | 55 } |
56 void CBC_QRCoderMode::Initialize() { | 56 void CBC_QRCoderMode::Initialize() { |
57 sBYTE = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 16, 16, 0x4, "BYTE"); | 57 sBYTE = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 16, 16, 0x4, "BYTE"); |
58 sALPHANUMERIC = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 9, 11, 13, 0x2, | 58 sALPHANUMERIC = |
59 "ALPHANUMERIC"); | 59 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 9, 11, 13, 0x2, "ALPHANUMERIC"); |
60 sECI = new CBC_QRCoderMode(NULL, 0, 0, 0, 0x7, "ECI"); | 60 sECI = new CBC_QRCoderMode(NULL, 0, 0, 0, 0x7, "ECI"); |
61 sKANJI = | 61 sKANJI = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x8, "KANJI"); |
62 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x8, "KANJI"); | |
63 sNUMERIC = | 62 sNUMERIC = |
64 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 10, 12, 14, 0x1, "NUMERIC"); | 63 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 10, 12, 14, 0x1, "NUMERIC"); |
65 sGBK = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x0D, "GBK"); | 64 sGBK = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x0D, "GBK"); |
66 sTERMINATOR = | 65 sTERMINATOR = |
67 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x00, "TERMINATOR"); | 66 new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x00, "TERMINATOR"); |
68 sFNC1_FIRST_POSITION = | 67 sFNC1_FIRST_POSITION = |
69 new CBC_QRCoderMode(NULL, 0, 0, 0, 0x05, "FNC1_FIRST_POSITION"); | 68 new CBC_QRCoderMode(NULL, 0, 0, 0, 0x05, "FNC1_FIRST_POSITION"); |
70 sFNC1_SECOND_POSITION = | 69 sFNC1_SECOND_POSITION = |
71 new CBC_QRCoderMode(NULL, 0, 0, 0, 0x09, "FNC1_SECOND_POSITION"); | 70 new CBC_QRCoderMode(NULL, 0, 0, 0, 0x09, "FNC1_SECOND_POSITION"); |
72 sSTRUCTURED_APPEND = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, | 71 sSTRUCTURED_APPEND = new CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x03, |
73 0x03, "STRUCTURED_APPEND"); | 72 "STRUCTURED_APPEND"); |
74 } | 73 } |
75 void CBC_QRCoderMode::Finalize() { | 74 void CBC_QRCoderMode::Finalize() { |
76 delete sBYTE; | 75 delete sBYTE; |
77 delete sALPHANUMERIC; | 76 delete sALPHANUMERIC; |
78 delete sECI; | 77 delete sECI; |
79 delete sKANJI; | 78 delete sKANJI; |
80 delete sNUMERIC; | 79 delete sNUMERIC; |
81 delete sGBK; | 80 delete sGBK; |
82 delete sTERMINATOR; | 81 delete sTERMINATOR; |
83 delete sFNC1_FIRST_POSITION; | 82 delete sFNC1_FIRST_POSITION; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 170 } |
172 if (sFNC1_SECOND_POSITION) { | 171 if (sFNC1_SECOND_POSITION) { |
173 delete CBC_QRCoderMode::sFNC1_SECOND_POSITION; | 172 delete CBC_QRCoderMode::sFNC1_SECOND_POSITION; |
174 sFNC1_SECOND_POSITION = NULL; | 173 sFNC1_SECOND_POSITION = NULL; |
175 } | 174 } |
176 if (sSTRUCTURED_APPEND) { | 175 if (sSTRUCTURED_APPEND) { |
177 delete CBC_QRCoderMode::sSTRUCTURED_APPEND; | 176 delete CBC_QRCoderMode::sSTRUCTURED_APPEND; |
178 sSTRUCTURED_APPEND = NULL; | 177 sSTRUCTURED_APPEND = NULL; |
179 } | 178 } |
180 } | 179 } |
OLD | NEW |