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_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ | 7 #ifndef CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ |
8 #define CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ | 8 #define CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = nullptr); | 69 FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = nullptr); |
70 | 70 |
71 struct PixelWeight { | 71 struct PixelWeight { |
72 int m_SrcStart; | 72 int m_SrcStart; |
73 int m_SrcEnd; | 73 int m_SrcEnd; |
74 int m_Weights[1]; | 74 int m_Weights[1]; |
75 }; | 75 }; |
76 | 76 |
77 class CFXCODEC_WeightTable { | 77 class CFXCODEC_WeightTable { |
78 public: | 78 public: |
79 CFXCODEC_WeightTable() {} | 79 CFXCODEC_WeightTable(); |
80 ~CFXCODEC_WeightTable() {} | 80 ~CFXCODEC_WeightTable(); |
81 | 81 |
82 void Calc(int dest_len, | 82 void Calc(int dest_len, |
83 int dest_min, | 83 int dest_min, |
84 int dest_max, | 84 int dest_max, |
85 int src_len, | 85 int src_len, |
86 int src_min, | 86 int src_min, |
87 int src_max, | 87 int src_max, |
88 FX_BOOL bInterpol); | 88 FX_BOOL bInterpol); |
89 PixelWeight* GetPixelWeight(int pixel) { | 89 PixelWeight* GetPixelWeight(int pixel) { |
90 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + | 90 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + |
91 (pixel - m_DestMin) * m_ItemSize); | 91 (pixel - m_DestMin) * m_ItemSize); |
92 } | 92 } |
93 | 93 |
94 int m_DestMin; | 94 int m_DestMin; |
95 int m_ItemSize; | 95 int m_ItemSize; |
96 std::vector<uint8_t> m_pWeightTables; | 96 std::vector<uint8_t> m_pWeightTables; |
97 }; | 97 }; |
98 | 98 |
99 class CFXCODEC_HorzTable { | 99 class CFXCODEC_HorzTable { |
100 public: | 100 public: |
101 CFXCODEC_HorzTable() {} | 101 CFXCODEC_HorzTable(); |
102 ~CFXCODEC_HorzTable() {} | 102 ~CFXCODEC_HorzTable(); |
103 | 103 |
104 void Calc(int dest_len, int src_len, FX_BOOL bInterpol); | 104 void Calc(int dest_len, int src_len, FX_BOOL bInterpol); |
105 PixelWeight* GetPixelWeight(int pixel) { | 105 PixelWeight* GetPixelWeight(int pixel) { |
106 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + | 106 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + |
107 pixel * m_ItemSize); | 107 pixel * m_ItemSize); |
108 } | 108 } |
109 | 109 |
110 int m_ItemSize; | 110 int m_ItemSize; |
111 std::vector<uint8_t> m_pWeightTables; | 111 std::vector<uint8_t> m_pWeightTables; |
112 }; | 112 }; |
113 | 113 |
114 class CFXCODEC_VertTable { | 114 class CFXCODEC_VertTable { |
115 public: | 115 public: |
116 CFXCODEC_VertTable() {} | 116 CFXCODEC_VertTable(); |
117 ~CFXCODEC_VertTable() {} | 117 ~CFXCODEC_VertTable(); |
| 118 |
118 void Calc(int dest_len, int src_len); | 119 void Calc(int dest_len, int src_len); |
119 PixelWeight* GetPixelWeight(int pixel) { | 120 PixelWeight* GetPixelWeight(int pixel) { |
120 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + | 121 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + |
121 pixel * m_ItemSize); | 122 pixel * m_ItemSize); |
122 } | 123 } |
123 int m_ItemSize; | 124 int m_ItemSize; |
124 std::vector<uint8_t> m_pWeightTables; | 125 std::vector<uint8_t> m_pWeightTables; |
125 }; | 126 }; |
126 | 127 |
127 IFX_FileRead* m_pFile; | 128 IFX_FileRead* m_pFile; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 FXCODEC_STATUS& err_status); | 229 FXCODEC_STATUS& err_status); |
229 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, | 230 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, |
230 double scale_y, | 231 double scale_y, |
231 int des_row); | 232 int des_row); |
232 FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, | 233 FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, |
233 FXCODEC_STATUS& err_status); | 234 FXCODEC_STATUS& err_status); |
234 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); | 235 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); |
235 }; | 236 }; |
236 | 237 |
237 #endif // CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ | 238 #endif // CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ |
OLD | NEW |