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

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

Issue 1177483002: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 6 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/fpdftext/text_int.h ('k') | core/src/fxcodec/codec/fx_codec.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 12
13 #include "../../../include/fxcodec/fx_codec.h" 13 #include "../../../include/fxcodec/fx_codec.h"
14 #include "../jbig2/JBig2_Context.h" 14 #include "../jbig2/JBig2_Context.h"
15 #include "../fx_libopenjpeg/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T. 15 #include "../fx_libopenjpeg/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T.
16 16
17 class CCodec_BasicModule : public ICodec_BasicModule 17 class CCodec_BasicModule : public ICodec_BasicModule
18 { 18 {
19 public: 19 public:
20 virtual FX_BOOL» RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_siz e, FX_LPBYTE& dest_buf, 20 virtual FX_BOOL» RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_siz e, FX_LPBYTE& dest_buf,
21 FX_DWORD& dest_size); 21 FX_DWORD& dest_size);
22 virtual FX_BOOL» A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_ LPBYTE& dest_buf, 22 virtual FX_BOOL» A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_ LPBYTE& dest_buf,
23 FX_DWORD& dest_size); 23 FX_DWORD& dest_size);
24 virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_bu f, FX_DWORD src_size, int width, int height, 24 virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_bu f, FX_DWORD src_size, int width, int height,
25 int nComps, int bpc); 25 int nComps, int bpc);
26 }; 26 };
27 struct CCodec_ImageDataCache { 27 struct CCodec_ImageDataCache {
28 int m_Width, m_Height; 28 int m_Width, m_Height;
29 int m_nCachedLines; 29 int m_nCachedLines;
30 FX_BYTE» » m_Data; 30 uint8_t» » m_Data;
31 }; 31 };
32 class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder 32 class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder
33 { 33 {
34 public: 34 public:
35 35
36 CCodec_ScanlineDecoder(); 36 CCodec_ScanlineDecoder();
37 37
38 virtual ~CCodec_ScanlineDecoder(); 38 virtual ~CCodec_ScanlineDecoder();
39 39
40 virtual FX_DWORD GetSrcOffset() 40 virtual FX_DWORD GetSrcOffset()
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 public: 119 public:
120 virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWO RD src_size, int width, int height, 120 virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWO RD src_size, int width, int height,
121 int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1 , int Columns, int Rows); 121 int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1 , int Columns, int Rows);
122 FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pi tch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); 122 FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pi tch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
123 }; 123 };
124 class CCodec_FlateModule : public ICodec_FlateModule 124 class CCodec_FlateModule : public ICodec_FlateModule
125 { 125 {
126 public: 126 public:
127 virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWO RD src_size, int width, int height, 127 virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWO RD src_size, int width, int height,
128 int nComps, int bpc, int predictor, int Colors, int BitsPerComponent , int Columns); 128 int nComps, int bpc, int predictor, int Colors, int BitsPerComponent , int Columns);
129 virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_D WORD src_size, FX_BOOL bEarlyChange, 129 virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_D WORD src_size, FX_BOOL bEarlyChange,
130 int predictor, int Colors, int BitsPerComp onent, int Columns, 130 int predictor, int Colors, int BitsPerComp onent, int Columns,
131 FX_DWORD estimated_size, FX_LPBYTE& dest_b uf, FX_DWORD& dest_size); 131 FX_DWORD estimated_size, FX_LPBYTE& dest_b uf, FX_DWORD& dest_size);
132 virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size, 132 virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size,
133 int predictor, int Colors, int BitsPerComponent, int Columns, 133 int predictor, int Colors, int BitsPerComponent, int Columns,
134 FX_LPBYTE& dest_buf, FX_DWORD& dest_size); 134 FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
135 virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX _LPBYTE& dest_buf, FX_DWORD& dest_size); 135 virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX _LPBYTE& dest_buf, FX_DWORD& dest_size);
136 }; 136 };
137 class CCodec_JpegModule : public ICodec_JpegModule 137 class CCodec_JpegModule : public ICodec_JpegModule
138 { 138 {
139 public: 139 public:
140 CCodec_JpegModule() : m_pExtProvider(NULL) {} 140 CCodec_JpegModule() : m_pExtProvider(NULL) {}
141 void SetPovider(IFX_JpegProvider* pJP) 141 void SetPovider(IFX_JpegProvider* pJP)
142 { 142 {
(...skipping 21 matching lines...) Expand all
164 virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, un signed int dwProfileSize); 164 virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, un signed int dwProfileSize);
165 virtual IccCS GetProfileCS(IFX_FileRead* pFile); 165 virtual IccCS GetProfileCS(IFX_FileRead* pFile);
166 virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInp utParam, 166 virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInp utParam,
167 ICodec_IccModule::IccParam* pOutputP aram, 167 ICodec_IccModule::IccParam* pOutputP aram,
168 ICodec_IccModule::IccParam* pProofPa ram = NULL, 168 ICodec_IccModule::IccParam* pProofPa ram = NULL,
169 FX_DWORD dwIntent = Icc_INTENT_PERCE PTUAL, 169 FX_DWORD dwIntent = Icc_INTENT_PERCE PTUAL,
170 FX_DWORD dwFlag = Icc_FLAGS_DEFAULT, 170 FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
171 FX_DWORD dwPrfIntent = Icc_INTENT_AB SOLUTE_COLORIMETRIC, 171 FX_DWORD dwPrfIntent = Icc_INTENT_AB SOLUTE_COLORIMETRIC,
172 FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTP ROOFING 172 FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTP ROOFING
173 ); 173 );
174 virtual FX_LPVOID» » CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX _DWORD dwProfileSize, FX_INT32& nComponents, FX_INT32 intent = 0, 174 virtual FX_LPVOID» » CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX _DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0,
175 FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT); 175 FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT);
176 virtual FX_LPVOID» » CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, FX_INT32& nSrcComponents, 176 virtual FX_LPVOID» » CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents,
177 FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, FX_INT32 inte nt = 0, 177 FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t inten t = 0,
178 FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, 178 FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
179 FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT 179 FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
180 ); 180 );
181 virtual void DestroyTransform(FX_LPVOID pTransform); 181 virtual void DestroyTransform(FX_LPVOID pTransform);
182 virtual void Translate(FX_LPVOID pTransform, FX_FLOAT * pSrcValues, FX_FLOAT* pDestValues); 182 virtual void Translate(FX_LPVOID pTransform, FX_FLOAT * pSrcValues, FX_FLOAT* pDestValues);
183 virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels); 183 virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels);
184 virtual void SetComponents(FX_DWORD nComponents) {m_n Components = nComponents;} 184 virtual void SetComponents(FX_DWORD nComponents) {m_n Components = nComponents;}
185 virtual ~CCodec_IccModule(); 185 virtual ~CCodec_IccModule();
186 protected: 186 protected:
187 CFX_MapByteStringToPtr m_MapTranform; 187 CFX_MapByteStringToPtr m_MapTranform;
(...skipping 15 matching lines...) Expand all
203 void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& h eight, 203 void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& h eight,
204 FX_DWORD& codestream_nComps, FX_DWORD& output_nComp s); 204 FX_DWORD& codestream_nComps, FX_DWORD& output_nComp s);
205 FX_BOOL Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOO L bTranslateColor, FX_LPBYTE offsets); 205 FX_BOOL Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOO L bTranslateColor, FX_LPBYTE offsets);
206 void DestroyDecoder(void* ctx); 206 void DestroyDecoder(void* ctx);
207 }; 207 };
208 class CPDF_Jbig2Interface : public CJBig2_Module 208 class CPDF_Jbig2Interface : public CJBig2_Module
209 { 209 {
210 public: 210 public:
211 virtual void *JBig2_Malloc(FX_DWORD dwSize) 211 virtual void *JBig2_Malloc(FX_DWORD dwSize)
212 { 212 {
213 return FX_Alloc(FX_BYTE, dwSize); 213 return FX_Alloc(uint8_t, dwSize);
214 } 214 }
215 virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) 215 virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize)
216 { 216 {
217 if (dwSize && num >= UINT_MAX / dwSize) { 217 if (dwSize && num >= UINT_MAX / dwSize) {
218 return NULL; 218 return NULL;
219 } 219 }
220 return FX_Alloc(FX_BYTE, num * dwSize); 220 return FX_Alloc(uint8_t, num * dwSize);
221 } 221 }
222 virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2) 222 virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2)
223 { 223 {
224 if (dwSize2 && dwSize >= UINT_MAX / dwSize2) { 224 if (dwSize2 && dwSize >= UINT_MAX / dwSize2) {
225 return NULL; 225 return NULL;
226 } 226 }
227 FX_DWORD size = dwSize2 * dwSize; 227 FX_DWORD size = dwSize2 * dwSize;
228 if (size && num >= UINT_MAX / size) { 228 if (size && num >= UINT_MAX / size) {
229 return NULL; 229 return NULL;
230 } 230 }
231 return FX_Alloc(FX_BYTE, num * size); 231 return FX_Alloc(uint8_t, num * size);
232 } 232 }
233 virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize) 233 virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize)
234 { 234 {
235 return FX_Realloc(FX_BYTE, pMem, dwSize); 235 return FX_Realloc(uint8_t, pMem, dwSize);
236 } 236 }
237 virtual void JBig2_Free(FX_LPVOID pMem) 237 virtual void JBig2_Free(FX_LPVOID pMem)
238 { 238 {
239 FX_Free(pMem); 239 FX_Free(pMem);
240 } 240 }
241 }; 241 };
242 class CCodec_Jbig2Context 242 class CCodec_Jbig2Context
243 { 243 {
244 public: 244 public:
245 CCodec_Jbig2Context(); 245 CCodec_Jbig2Context();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 OPJ_SIZE_T offset; 290 OPJ_SIZE_T offset;
291 }; 291 };
292 292
293 /* Wrappers for C-style callbacks. */ 293 /* Wrappers for C-style callbacks. */
294 OPJ_SIZE_T opj_read_from_memory (void* p_buffer, OPJ_SIZE_T nb_bytes, void* p_u ser_data); 294 OPJ_SIZE_T opj_read_from_memory (void* p_buffer, OPJ_SIZE_T nb_bytes, void* p_u ser_data);
295 OPJ_SIZE_T opj_write_from_memory (void* p_buffer, OPJ_SIZE_T nb_bytes, void* p_u ser_data); 295 OPJ_SIZE_T opj_write_from_memory (void* p_buffer, OPJ_SIZE_T nb_bytes, void* p_u ser_data);
296 OPJ_OFF_T opj_skip_from_memory (OPJ_OFF_T nb_bytes, void* p_user_data); 296 OPJ_OFF_T opj_skip_from_memory (OPJ_OFF_T nb_bytes, void* p_user_data);
297 OPJ_BOOL opj_seek_from_memory (OPJ_OFF_T nb_bytes, void* p_user_data); 297 OPJ_BOOL opj_seek_from_memory (OPJ_OFF_T nb_bytes, void* p_user_data);
298 298
299 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ 299 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_
OLDNEW
« no previous file with comments | « core/src/fpdftext/text_int.h ('k') | core/src/fxcodec/codec/fx_codec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698