| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "JBig2_PddProc.h" | 7 #include "JBig2_PddProc.h" |
| 8 | 8 |
| 9 #include "../../../../third_party/base/nonstd_unique_ptr.h" | |
| 10 #include "JBig2_GrdProc.h" | 9 #include "JBig2_GrdProc.h" |
| 11 #include "JBig2_Image.h" | 10 #include "JBig2_Image.h" |
| 12 #include "JBig2_PatternDict.h" | 11 #include "JBig2_PatternDict.h" |
| 12 #include "third_party/base/nonstd_unique_ptr.h" |
| 13 | 13 |
| 14 CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( | 14 CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( |
| 15 CJBig2_ArithDecoder* pArithDecoder, | 15 CJBig2_ArithDecoder* pArithDecoder, |
| 16 JBig2ArithCtx* gbContext, | 16 JBig2ArithCtx* gbContext, |
| 17 IFX_Pause* pPause) { | 17 IFX_Pause* pPause) { |
| 18 FX_DWORD GRAY; | 18 FX_DWORD GRAY; |
| 19 CJBig2_Image* BHDC = nullptr; | 19 CJBig2_Image* BHDC = nullptr; |
| 20 nonstd::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict()); | 20 nonstd::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict()); |
| 21 pDict->NUMPATS = GRAYMAX + 1; | 21 pDict->NUMPATS = GRAYMAX + 1; |
| 22 pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS); | 22 pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return nullptr; | 77 return nullptr; |
| 78 | 78 |
| 79 GRAY = 0; | 79 GRAY = 0; |
| 80 while (GRAY <= GRAYMAX) { | 80 while (GRAY <= GRAYMAX) { |
| 81 pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH); | 81 pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH); |
| 82 GRAY = GRAY + 1; | 82 GRAY = GRAY + 1; |
| 83 } | 83 } |
| 84 delete BHDC; | 84 delete BHDC; |
| 85 return pDict.release(); | 85 return pDict.release(); |
| 86 } | 86 } |
| OLD | NEW |