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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 uint8_t*& dest_buf, | 151 uint8_t*& dest_buf, |
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() {} |
162 void SetPovider(IFX_JpegProvider* pJP) { m_pExtProvider = pJP; } | |
163 ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, | 162 ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, |
164 FX_DWORD src_size, | 163 FX_DWORD src_size, |
165 int width, | 164 int width, |
166 int height, | 165 int height, |
167 int nComps, | 166 int nComps, |
168 FX_BOOL ColorTransform); | 167 FX_BOOL ColorTransform) override; |
169 FX_BOOL LoadInfo(const uint8_t* src_buf, | 168 FX_BOOL LoadInfo(const uint8_t* src_buf, |
170 FX_DWORD src_size, | 169 FX_DWORD src_size, |
171 int& width, | 170 int& width, |
172 int& height, | 171 int& height, |
173 int& num_components, | 172 int& num_components, |
174 int& bits_per_components, | 173 int& bits_per_components, |
175 FX_BOOL& color_transform, | 174 FX_BOOL& color_transform, |
176 uint8_t** icc_buf_ptr, | 175 uint8_t** icc_buf_ptr, |
177 FX_DWORD* icc_length); | 176 FX_DWORD* icc_length) override; |
178 FX_BOOL Encode(const CFX_DIBSource* pSource, | 177 FX_BOOL Encode(const CFX_DIBSource* pSource, |
179 uint8_t*& dest_buf, | 178 uint8_t*& dest_buf, |
180 FX_STRSIZE& dest_size, | 179 FX_STRSIZE& dest_size, |
181 int quality, | 180 int quality, |
182 const uint8_t* icc_buf, | 181 const uint8_t* icc_buf, |
183 FX_DWORD icc_length); | 182 FX_DWORD icc_length) override; |
184 virtual void* Start(); | 183 void* Start() override; |
185 virtual void Finish(void* pContext); | 184 void Finish(void* pContext) override; |
186 virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size); | 185 void Input(void* pContext, |
187 virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps); | 186 const uint8_t* src_buf, |
188 virtual int StartScanline(void* pContext, int down_scale); | 187 FX_DWORD src_size) override; |
189 virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf); | 188 int ReadHeader(void* pContext, int* width, int* height, int* nComps) override; |
190 virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr); | 189 int StartScanline(void* pContext, int down_scale) override; |
191 | 190 FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) override; |
192 protected: | 191 FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override; |
193 IFX_JpegProvider* m_pExtProvider; | |
194 }; | 192 }; |
195 class CCodec_IccModule : public ICodec_IccModule { | 193 class CCodec_IccModule : public ICodec_IccModule { |
196 public: | 194 public: |
197 virtual IccCS GetProfileCS(const uint8_t* pProfileData, | 195 virtual IccCS GetProfileCS(const uint8_t* pProfileData, |
198 unsigned int dwProfileSize); | 196 unsigned int dwProfileSize); |
199 virtual IccCS GetProfileCS(IFX_FileRead* pFile); | 197 virtual IccCS GetProfileCS(IFX_FileRead* pFile); |
200 virtual void* CreateTransform( | 198 virtual void* CreateTransform( |
201 ICodec_IccModule::IccParam* pInputParam, | 199 ICodec_IccModule::IccParam* pInputParam, |
202 ICodec_IccModule::IccParam* pOutputParam, | 200 ICodec_IccModule::IccParam* pOutputParam, |
203 ICodec_IccModule::IccParam* pProofParam = NULL, | 201 ICodec_IccModule::IccParam* pProofParam = NULL, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, | 316 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, |
319 OPJ_SIZE_T nb_bytes, | 317 OPJ_SIZE_T nb_bytes, |
320 void* p_user_data); | 318 void* p_user_data); |
321 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, | 319 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, |
322 OPJ_SIZE_T nb_bytes, | 320 OPJ_SIZE_T nb_bytes, |
323 void* p_user_data); | 321 void* p_user_data); |
324 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 322 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
325 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 323 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
326 | 324 |
327 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 325 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
OLD | NEW |