| 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 CORE_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ | 7 #ifndef CORE_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ |
| 8 #define CORE_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ | 8 #define CORE_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" | 15 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" |
| 16 #include "core/fxcodec/include/fx_codec_def.h" | 16 #include "core/fxcodec/include/fx_codec_def.h" |
| 17 #include "core/fxcodec/jbig2/JBig2_List.h" | 17 #include "core/fxcodec/jbig2/JBig2_List.h" |
| 18 #include "core/fxcodec/jbig2/JBig2_Page.h" | 18 #include "core/fxcodec/jbig2/JBig2_Page.h" |
| 19 #include "core/fxcodec/jbig2/JBig2_Segment.h" | 19 #include "core/fxcodec/jbig2/JBig2_Segment.h" |
| 20 | 20 |
| 21 class CJBig2_ArithDecoder; | 21 class CJBig2_ArithDecoder; |
| 22 class CJBig2_GRDProc; | 22 class CJBig2_GRDProc; |
| 23 class CPDF_StreamAcc; | 23 class CPDF_StreamAcc; |
| 24 class IFX_Pause; | 24 class IFX_Pause; |
| 25 | 25 |
| 26 // Cache is keyed by the ObjNum of a stream and an index within the stream. | 26 // Cache is keyed by the ObjNum of a stream and an index within the stream. |
| 27 using CJBig2_CacheKey = std::pair<uint32_t, uint32_t>; | 27 using CJBig2_CacheKey = std::pair<uint32_t, uint32_t>; |
| 28 // NB: CJBig2_SymbolDict* is owned. | 28 using CJBig2_CachePair = |
| 29 using CJBig2_CachePair = std::pair<CJBig2_CacheKey, CJBig2_SymbolDict*>; | 29 std::pair<CJBig2_CacheKey, std::unique_ptr<CJBig2_SymbolDict>>; |
| 30 | 30 |
| 31 #define JBIG2_SUCCESS 0 | 31 #define JBIG2_SUCCESS 0 |
| 32 #define JBIG2_FAILED -1 | 32 #define JBIG2_FAILED -1 |
| 33 #define JBIG2_ERROR_TOO_SHORT -2 | 33 #define JBIG2_ERROR_TOO_SHORT -2 |
| 34 #define JBIG2_ERROR_FATAL -3 | 34 #define JBIG2_ERROR_FATAL -3 |
| 35 #define JBIG2_END_OF_PAGE 2 | 35 #define JBIG2_END_OF_PAGE 2 |
| 36 #define JBIG2_END_OF_FILE 3 | 36 #define JBIG2_END_OF_FILE 3 |
| 37 #define JBIG2_ERROR_FILE_FORMAT -4 | 37 #define JBIG2_ERROR_FILE_FORMAT -4 |
| 38 #define JBIG2_ERROR_STREAM_TYPE -5 | 38 #define JBIG2_ERROR_STREAM_TYPE -5 |
| 39 #define JBIG2_ERROR_LIMIT -6 | 39 #define JBIG2_ERROR_LIMIT -6 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 std::unique_ptr<CJBig2_ArithDecoder> m_pArithDecoder; | 102 std::unique_ptr<CJBig2_ArithDecoder> m_pArithDecoder; |
| 103 std::unique_ptr<CJBig2_GRDProc> m_pGRD; | 103 std::unique_ptr<CJBig2_GRDProc> m_pGRD; |
| 104 std::unique_ptr<CJBig2_Segment> m_pSegment; | 104 std::unique_ptr<CJBig2_Segment> m_pSegment; |
| 105 uint32_t m_dwOffset; | 105 uint32_t m_dwOffset; |
| 106 JBig2RegionInfo m_ri; | 106 JBig2RegionInfo m_ri; |
| 107 std::list<CJBig2_CachePair>* const m_pSymbolDictCache; | 107 std::list<CJBig2_CachePair>* const m_pSymbolDictCache; |
| 108 bool m_bIsGlobal; | 108 bool m_bIsGlobal; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 #endif // CORE_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ | 111 #endif // CORE_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ |
| OLD | NEW |