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

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

Issue 1336783002: Merge to XFA: Remove CJBig2_Object, CJBig2_Module, and friends. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 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 | « BUILD.gn ('k') | core/src/fxcodec/codec/fx_codec_fax.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>
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 FX_DWORD& comps, 340 FX_DWORD& comps,
341 FX_DWORD& bpc, 341 FX_DWORD& bpc,
342 CFX_DIBAttribute* pAttribute = NULL) override; 342 CFX_DIBAttribute* pAttribute = NULL) override;
343 FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override; 343 FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override;
344 void DestroyDecoder(void* ctx) override; 344 void DestroyDecoder(void* ctx) override;
345 345
346 protected: 346 protected:
347 ~CCodec_TiffModule() override {} 347 ~CCodec_TiffModule() override {}
348 }; 348 };
349 349
350 class CPDF_Jbig2Interface : public CJBig2_Module {
351 public:
352 virtual void* JBig2_Malloc(FX_DWORD dwSize) {
353 return FX_Alloc(uint8_t, dwSize);
354 }
355 virtual void* JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) {
356 if (dwSize && num >= UINT_MAX / dwSize) {
357 return NULL;
358 }
359 return FX_Alloc(uint8_t, num * dwSize);
360 }
361 virtual void* JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2) {
362 if (dwSize2 && dwSize >= UINT_MAX / dwSize2) {
363 return NULL;
364 }
365 FX_DWORD size = dwSize2 * dwSize;
366 if (size && num >= UINT_MAX / size) {
367 return NULL;
368 }
369 return FX_Alloc(uint8_t, num * size);
370 }
371 virtual void* JBig2_Realloc(void* pMem, FX_DWORD dwSize) {
372 return FX_Realloc(uint8_t, pMem, dwSize);
373 }
374 virtual void JBig2_Free(void* pMem) { FX_Free(pMem); }
375 };
376
377 class CCodec_Jbig2Context { 350 class CCodec_Jbig2Context {
378 public: 351 public:
379 CCodec_Jbig2Context(); 352 CCodec_Jbig2Context();
380 ~CCodec_Jbig2Context() {} 353 ~CCodec_Jbig2Context() {}
381 354
382 FX_DWORD m_width; 355 FX_DWORD m_width;
383 FX_DWORD m_height; 356 FX_DWORD m_height;
384 uint8_t* m_src_buf; 357 uint8_t* m_src_buf;
385 FX_DWORD m_src_size; 358 FX_DWORD m_src_size;
386 const uint8_t* m_global_data; 359 const uint8_t* m_global_data;
(...skipping 20 matching lines...) Expand all
407 const uint8_t* global_data, 380 const uint8_t* global_data,
408 FX_DWORD global_size, 381 FX_DWORD global_size,
409 uint8_t* dest_buf, 382 uint8_t* dest_buf,
410 FX_DWORD dest_pitch, 383 FX_DWORD dest_pitch,
411 IFX_Pause* pPause) override; 384 IFX_Pause* pPause) override;
412 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, 385 FXCODEC_STATUS ContinueDecode(void* pJbig2Context,
413 IFX_Pause* pPause) override; 386 IFX_Pause* pPause) override;
414 void DestroyJbig2Context(void* pJbig2Context) override; 387 void DestroyJbig2Context(void* pJbig2Context) override;
415 388
416 private: 389 private:
417 CPDF_Jbig2Interface m_Module;
418 std::list<CJBig2_CachePair> m_SymbolDictCache; 390 std::list<CJBig2_CachePair> m_SymbolDictCache;
419 }; 391 };
420 class CFX_DIBAttributeExif : public IFX_DIBAttributeExif { 392 class CFX_DIBAttributeExif : public IFX_DIBAttributeExif {
421 public: 393 public:
422 CFX_DIBAttributeExif(); 394 CFX_DIBAttributeExif();
423 ~CFX_DIBAttributeExif(); 395 ~CFX_DIBAttributeExif();
424 virtual FX_BOOL GetInfo(FX_WORD tag, void* val); 396 virtual FX_BOOL GetInfo(FX_WORD tag, void* val);
425 397
426 FX_BOOL ParseExif(CFX_MapPtrTemplate<FX_DWORD, uint8_t*>* pHead, 398 FX_BOOL ParseExif(CFX_MapPtrTemplate<FX_DWORD, uint8_t*>* pHead,
427 uint8_t* data, 399 uint8_t* data,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, 434 OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
463 OPJ_SIZE_T nb_bytes, 435 OPJ_SIZE_T nb_bytes,
464 void* p_user_data); 436 void* p_user_data);
465 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, 437 OPJ_SIZE_T opj_write_from_memory(void* p_buffer,
466 OPJ_SIZE_T nb_bytes, 438 OPJ_SIZE_T nb_bytes,
467 void* p_user_data); 439 void* p_user_data);
468 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); 440 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
469 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); 441 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
470 442
471 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ 443 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | core/src/fxcodec/codec/fx_codec_fax.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698