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

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

Issue 1297723002: CFX_MapByteStringToPtr considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Const auto& 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 virtual void TranslateScanline(void* pTransform, 222 virtual void TranslateScanline(void* pTransform,
219 uint8_t* pDest, 223 uint8_t* pDest,
220 const uint8_t* pSrc, 224 const uint8_t* pSrc,
221 int pixels); 225 int pixels);
222 virtual void SetComponents(FX_DWORD nComponents) { 226 virtual void SetComponents(FX_DWORD nComponents) {
223 m_nComponents = nComponents; 227 m_nComponents = nComponents;
224 } 228 }
225 virtual ~CCodec_IccModule(); 229 virtual ~CCodec_IccModule();
226 230
227 protected: 231 protected:
228 CFX_MapByteStringToPtr m_MapTranform; 232 enum Icc_CLASS {
229 CFX_MapByteStringToPtr m_MapProfile;
230 FX_DWORD m_nComponents;
231 typedef enum {
232 Icc_CLASS_INPUT = 0, 233 Icc_CLASS_INPUT = 0,
233 Icc_CLASS_OUTPUT, 234 Icc_CLASS_OUTPUT,
234 Icc_CLASS_PROOF, 235 Icc_CLASS_PROOF,
235 Icc_CLASS_MAX 236 Icc_CLASS_MAX
236 } Icc_CLASS; 237 };
237 void* CreateProfile(ICodec_IccModule::IccParam* pIccParam, 238 void* CreateProfile(ICodec_IccModule::IccParam* pIccParam,
238 Icc_CLASS ic, 239 Icc_CLASS ic,
239 CFX_BinaryBuf* pTransformKey); 240 CFX_BinaryBuf* pTransformKey);
241
242 FX_DWORD m_nComponents;
243 std::map<CFX_ByteString, CFX_IccTransformCache*> m_MapTranform;
244 std::map<CFX_ByteString, CFX_IccProfileCache*> m_MapProfile;
240 }; 245 };
241 246
242 class CCodec_JpxModule : public ICodec_JpxModule { 247 class CCodec_JpxModule : public ICodec_JpxModule {
243 public: 248 public:
244 CCodec_JpxModule(); 249 CCodec_JpxModule();
245 void* CreateDecoder(const uint8_t* src_buf, 250 void* CreateDecoder(const uint8_t* src_buf,
246 FX_DWORD src_size, 251 FX_DWORD src_size,
247 FX_BOOL useColorSpace = FALSE); 252 FX_BOOL useColorSpace = FALSE);
248 void GetImageInfo(void* ctx, 253 void GetImageInfo(void* ctx,
249 FX_DWORD& width, 254 FX_DWORD& width,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, 367 OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
363 OPJ_SIZE_T nb_bytes, 368 OPJ_SIZE_T nb_bytes,
364 void* p_user_data); 369 void* p_user_data);
365 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, 370 OPJ_SIZE_T opj_write_from_memory(void* p_buffer,
366 OPJ_SIZE_T nb_bytes, 371 OPJ_SIZE_T nb_bytes,
367 void* p_user_data); 372 void* p_user_data);
368 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); 373 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
369 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); 374 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
370 375
371 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ 376 #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