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_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 7 #ifndef CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
8 #define CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 8 #define CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
9 | 9 |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 FX_DWORD& dest_size); | 152 FX_DWORD& dest_size); |
153 virtual FX_BOOL Encode(const uint8_t* src_buf, | 153 virtual FX_BOOL Encode(const uint8_t* src_buf, |
154 FX_DWORD src_size, | 154 FX_DWORD src_size, |
155 uint8_t*& dest_buf, | 155 uint8_t*& dest_buf, |
156 FX_DWORD& dest_size); | 156 FX_DWORD& dest_size); |
157 }; | 157 }; |
158 | 158 |
159 class CCodec_JpegModule : public ICodec_JpegModule { | 159 class CCodec_JpegModule : public ICodec_JpegModule { |
160 public: | 160 public: |
161 CCodec_JpegModule() : m_pExtProvider(NULL) {} | 161 CCodec_JpegModule() : m_pExtProvider(NULL) {} |
162 void SetPovider(IFX_JpegProvider* pJP) { m_pExtProvider = pJP; } | 162 void SetPovider(IFX_JpegProvider* pJP) override { m_pExtProvider = pJP; } |
163 ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, | 163 ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, |
164 FX_DWORD src_size, | 164 FX_DWORD src_size, |
165 int width, | 165 int width, |
166 int height, | 166 int height, |
167 int nComps, | 167 int nComps, |
168 FX_BOOL ColorTransform); | 168 FX_BOOL ColorTransform) override; |
169 FX_BOOL LoadInfo(const uint8_t* src_buf, | 169 FX_BOOL LoadInfo(const uint8_t* src_buf, |
170 FX_DWORD src_size, | 170 FX_DWORD src_size, |
171 int& width, | 171 int& width, |
172 int& height, | 172 int& height, |
173 int& num_components, | 173 int& num_components, |
174 int& bits_per_components, | 174 int& bits_per_components, |
175 FX_BOOL& color_transform, | 175 FX_BOOL& color_transform, |
176 uint8_t** icc_buf_ptr, | 176 uint8_t** icc_buf_ptr, |
177 FX_DWORD* icc_length); | 177 FX_DWORD* icc_length) override; |
178 FX_BOOL Encode(const CFX_DIBSource* pSource, | 178 FX_BOOL Encode(const CFX_DIBSource* pSource, |
179 uint8_t*& dest_buf, | 179 uint8_t*& dest_buf, |
180 FX_STRSIZE& dest_size, | 180 FX_STRSIZE& dest_size, |
181 int quality, | 181 int quality, |
182 const uint8_t* icc_buf, | 182 const uint8_t* icc_buf, |
183 FX_DWORD icc_length); | 183 FX_DWORD icc_length) override; |
184 virtual void* Start(); | 184 void* Start() override; |
185 virtual void Finish(void* pContext); | 185 void Finish(void* pContext) override; |
186 virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size); | 186 void Input(void* pContext, |
187 virtual int ReadHeader(void* pContext, | 187 const uint8_t* src_buf, |
188 int* width, | 188 FX_DWORD src_size) override; |
189 int* height, | 189 int ReadHeader(void* pContext, |
190 int* nComps, | 190 int* width, |
191 CFX_DIBAttribute* pAttribute = NULL); | 191 int* height, |
192 virtual int StartScanline(void* pContext, int down_scale); | 192 int* nComps, |
193 virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf); | 193 CFX_DIBAttribute* pAttribute) override; |
194 virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr); | 194 int StartScanline(void* pContext, int down_scale) override; |
| 195 FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) override; |
| 196 FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override; |
195 | 197 |
196 protected: | 198 protected: |
197 IFX_JpegProvider* m_pExtProvider; | 199 IFX_JpegProvider* m_pExtProvider; |
198 }; | 200 }; |
199 #define PNG_ERROR_SIZE 256 | 201 #define PNG_ERROR_SIZE 256 |
200 class CCodec_PngModule : public ICodec_PngModule { | 202 class CCodec_PngModule : public ICodec_PngModule { |
201 public: | 203 public: |
202 CCodec_PngModule() { FXSYS_memset(m_szLastError, '\0', PNG_ERROR_SIZE); } | 204 CCodec_PngModule() { FXSYS_memset(m_szLastError, '\0', PNG_ERROR_SIZE); } |
203 | 205 |
204 virtual void* Start(void* pModule); | 206 virtual void* Start(void* pModule); |
(...skipping 26 matching lines...) Expand all Loading... |
231 | 233 |
232 virtual int32_t LoadFrame(void* pContext, | 234 virtual int32_t LoadFrame(void* pContext, |
233 int frame_num, | 235 int frame_num, |
234 CFX_DIBAttribute* pAttribute); | 236 CFX_DIBAttribute* pAttribute); |
235 | 237 |
236 protected: | 238 protected: |
237 FX_CHAR m_szLastError[256]; | 239 FX_CHAR m_szLastError[256]; |
238 }; | 240 }; |
239 class CCodec_BmpModule : public ICodec_BmpModule { | 241 class CCodec_BmpModule : public ICodec_BmpModule { |
240 public: | 242 public: |
241 CCodec_BmpModule() { FXSYS_memset(m_szLastError, '\0', 256); } | 243 CCodec_BmpModule() { FXSYS_memset(m_szLastError, 0, sizeof(m_szLastError)); } |
242 virtual void* Start(void* pModule); | 244 void* Start(void* pModule) override; |
243 virtual void Finish(void* pContext); | 245 void Finish(void* pContext) override; |
244 virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr); | 246 FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override; |
245 virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size); | 247 void Input(void* pContext, |
246 virtual int32_t ReadHeader(void* pContext, | 248 const uint8_t* src_buf, |
247 int32_t* width, | 249 FX_DWORD src_size) override; |
248 int32_t* height, | 250 int32_t ReadHeader(void* pContext, |
249 FX_BOOL* tb_flag, | 251 int32_t* width, |
250 int32_t* components, | 252 int32_t* height, |
251 int32_t* pal_num, | 253 FX_BOOL* tb_flag, |
252 FX_DWORD** pal_pp, | 254 int32_t* components, |
253 CFX_DIBAttribute* pAttribute); | 255 int32_t* pal_num, |
254 virtual int32_t LoadImage(void* pContext); | 256 FX_DWORD** pal_pp, |
| 257 CFX_DIBAttribute* pAttribute) override; |
| 258 int32_t LoadImage(void* pContext) override; |
255 | 259 |
256 protected: | 260 protected: |
257 FX_CHAR m_szLastError[256]; | 261 FX_CHAR m_szLastError[256]; |
258 }; | 262 }; |
259 class CCodec_IccModule : public ICodec_IccModule { | 263 class CCodec_IccModule : public ICodec_IccModule { |
260 public: | 264 public: |
261 virtual IccCS GetProfileCS(const uint8_t* pProfileData, | 265 virtual IccCS GetProfileCS(const uint8_t* pProfileData, |
262 unsigned int dwProfileSize); | 266 unsigned int dwProfileSize); |
263 virtual IccCS GetProfileCS(IFX_FileRead* pFile); | 267 virtual IccCS GetProfileCS(IFX_FileRead* pFile); |
264 virtual void* CreateTransform( | 268 virtual void* CreateTransform( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 public: | 339 public: |
336 // ICodec_TiffModule | 340 // ICodec_TiffModule |
337 void* CreateDecoder(IFX_FileRead* file_ptr) override; | 341 void* CreateDecoder(IFX_FileRead* file_ptr) override; |
338 void GetFrames(void* ctx, int32_t& frames) override; | 342 void GetFrames(void* ctx, int32_t& frames) override; |
339 FX_BOOL LoadFrameInfo(void* ctx, | 343 FX_BOOL LoadFrameInfo(void* ctx, |
340 int32_t frame, | 344 int32_t frame, |
341 FX_DWORD& width, | 345 FX_DWORD& width, |
342 FX_DWORD& height, | 346 FX_DWORD& height, |
343 FX_DWORD& comps, | 347 FX_DWORD& comps, |
344 FX_DWORD& bpc, | 348 FX_DWORD& bpc, |
345 CFX_DIBAttribute* pAttribute = NULL) override; | 349 CFX_DIBAttribute* pAttribute) override; |
346 FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override; | 350 FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override; |
347 void DestroyDecoder(void* ctx) override; | 351 void DestroyDecoder(void* ctx) override; |
348 | 352 |
349 protected: | 353 protected: |
350 ~CCodec_TiffModule() override {} | 354 ~CCodec_TiffModule() override {} |
351 }; | 355 }; |
352 | 356 |
353 class CCodec_Jbig2Context { | 357 class CCodec_Jbig2Context { |
354 public: | 358 public: |
355 CCodec_Jbig2Context(); | 359 CCodec_Jbig2Context(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, | 404 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, |
401 OPJ_SIZE_T nb_bytes, | 405 OPJ_SIZE_T nb_bytes, |
402 void* p_user_data); | 406 void* p_user_data); |
403 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, | 407 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, |
404 OPJ_SIZE_T nb_bytes, | 408 OPJ_SIZE_T nb_bytes, |
405 void* p_user_data); | 409 void* p_user_data); |
406 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 410 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
407 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 411 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
408 | 412 |
409 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 413 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
OLD | NEW |