1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FXCODEC_CODEC_CODEC_INT_H_
8 #define CORE_FXCODEC_CODEC_CODEC_INT_H_
9 
10 #include <limits.h>
11 
12 #include <list>
13 #include <map>
14 #include <memory>
15 #include <vector>
16 
17 #include "core/fxcodec/fx_codec.h"
18 #include "core/fxcodec/jbig2/JBig2_Context.h"
19 #include "third_party/libopenjpeg20/openjpeg.h"
20 
21 class CPDF_ColorSpace;
22 
23 struct DecodeData {
24  public:
DecodeDataDecodeData25   DecodeData(uint8_t* data, OPJ_SIZE_T size)
26       : src_data(data), src_size(size), offset(0) {}
27   uint8_t* src_data;
28   OPJ_SIZE_T src_size;
29   OPJ_SIZE_T offset;
30 };
31 
32 void sycc420_to_rgb(opj_image_t* img);
33 
34 /* Wrappers for C-style callbacks. */
35 OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
36                                 OPJ_SIZE_T nb_bytes,
37                                 void* p_user_data);
38 OPJ_SIZE_T opj_write_from_memory(void* p_buffer,
39                                  OPJ_SIZE_T nb_bytes,
40                                  void* p_user_data);
41 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
42 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
43 
44 #endif  // CORE_FXCODEC_CODEC_CODEC_INT_H_
45