Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: core/src/fxcodec/codec/codec_int.h

Issue 1301793002: Merge to XFA: CFX_MapByteStringToPtr considered harmful (combo patch). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/render_int.h ('k') | core/src/fxcodec/codec/fx_codec_icc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <list> 11 #include <list>
12 #include <map>
12 13
13 #include "../../../../third_party/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T. 14 #include "../../../../third_party/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T.
14 #include "../../../include/fxcodec/fx_codec.h" 15 #include "../../../include/fxcodec/fx_codec.h"
15 #include "../jbig2/JBig2_Context.h" 16 #include "../jbig2/JBig2_Context.h"
16 17
18 class CFX_IccProfileCache;
19 class CFX_IccTransformCache;
20
17 class CCodec_BasicModule : public ICodec_BasicModule { 21 class CCodec_BasicModule : public ICodec_BasicModule {
18 public: 22 public:
19 virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, 23 virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf,
20 FX_DWORD src_size, 24 FX_DWORD src_size,
21 uint8_t*& dest_buf, 25 uint8_t*& dest_buf,
22 FX_DWORD& dest_size); 26 FX_DWORD& dest_size);
23 virtual FX_BOOL A85Encode(const uint8_t* src_buf, 27 virtual FX_BOOL A85Encode(const uint8_t* src_buf,
24 FX_DWORD src_size, 28 FX_DWORD src_size,
25 uint8_t*& dest_buf, 29 uint8_t*& dest_buf,
26 FX_DWORD& dest_size); 30 FX_DWORD& dest_size);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 virtual void TranslateScanline(void* pTransform, 286 virtual void TranslateScanline(void* pTransform,
283 uint8_t* pDest, 287 uint8_t* pDest,
284 const uint8_t* pSrc, 288 const uint8_t* pSrc,
285 int pixels); 289 int pixels);
286 virtual void SetComponents(FX_DWORD nComponents) { 290 virtual void SetComponents(FX_DWORD nComponents) {
287 m_nComponents = nComponents; 291 m_nComponents = nComponents;
288 } 292 }
289 virtual ~CCodec_IccModule(); 293 virtual ~CCodec_IccModule();
290 294
291 protected: 295 protected:
292 CFX_MapByteStringToPtr m_MapTranform; 296 enum Icc_CLASS {
293 CFX_MapByteStringToPtr m_MapProfile;
294 FX_DWORD m_nComponents;
295 typedef enum {
296 Icc_CLASS_INPUT = 0, 297 Icc_CLASS_INPUT = 0,
297 Icc_CLASS_OUTPUT, 298 Icc_CLASS_OUTPUT,
298 Icc_CLASS_PROOF, 299 Icc_CLASS_PROOF,
299 Icc_CLASS_MAX 300 Icc_CLASS_MAX
300 } Icc_CLASS; 301 };
301 void* CreateProfile(ICodec_IccModule::IccParam* pIccParam, 302 void* CreateProfile(ICodec_IccModule::IccParam* pIccParam,
302 Icc_CLASS ic, 303 Icc_CLASS ic,
303 CFX_BinaryBuf* pTransformKey); 304 CFX_BinaryBuf* pTransformKey);
305
306 FX_DWORD m_nComponents;
307 std::map<CFX_ByteString, CFX_IccTransformCache*> m_MapTranform;
308 std::map<CFX_ByteString, CFX_IccProfileCache*> m_MapProfile;
304 }; 309 };
305 310
306 class CCodec_JpxModule : public ICodec_JpxModule { 311 class CCodec_JpxModule : public ICodec_JpxModule {
307 public: 312 public:
308 CCodec_JpxModule(); 313 CCodec_JpxModule();
309 void* CreateDecoder(const uint8_t* src_buf, 314 void* CreateDecoder(const uint8_t* src_buf,
310 FX_DWORD src_size, 315 FX_DWORD src_size,
311 FX_BOOL useColorSpace = FALSE); 316 FX_BOOL useColorSpace = FALSE);
312 void GetImageInfo(void* ctx, 317 void GetImageInfo(void* ctx,
313 FX_DWORD& width, 318 FX_DWORD& width,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, 481 OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
477 OPJ_SIZE_T nb_bytes, 482 OPJ_SIZE_T nb_bytes,
478 void* p_user_data); 483 void* p_user_data);
479 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, 484 OPJ_SIZE_T opj_write_from_memory(void* p_buffer,
480 OPJ_SIZE_T nb_bytes, 485 OPJ_SIZE_T nb_bytes,
481 void* p_user_data); 486 void* p_user_data);
482 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); 487 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
483 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); 488 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
484 489
485 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ 490 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/render_int.h ('k') | core/src/fxcodec/codec/fx_codec_icc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698