OLD | NEW |
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 #include "../../../include/fxcodec/fx_codec.h" | 7 #include "../../../include/fxcodec/fx_codec.h" |
8 #include "../../../include/fxge/fx_dib.h" | 8 #include "../../../include/fxge/fx_dib.h" |
9 #include "codec_int.h" | 9 #include "codec_int.h" |
10 | 10 |
11 extern "C" { | 11 extern "C" { |
12 #include "third_party/tiff_v403/tiffiop.h" | 12 #include "third_party/libtiff/tiffiop.h" |
13 } | 13 } |
14 | 14 |
15 void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData, | 15 void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData, |
16 unsigned int dwProfileSize, | 16 unsigned int dwProfileSize, |
17 int nComponents, | 17 int nComponents, |
18 int intent, | 18 int intent, |
19 FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT); | 19 FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT); |
20 void IccLib_TranslateImage(void* pTransform, | 20 void IccLib_TranslateImage(void* pTransform, |
21 unsigned char* pDest, | 21 unsigned char* pDest, |
22 const unsigned char* pSrc, | 22 const unsigned char* pSrc, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 void _TIFFmemset(void* ptr, int val, tmsize_t size) { | 175 void _TIFFmemset(void* ptr, int val, tmsize_t size) { |
176 FXSYS_memset(ptr, val, (size_t)size); | 176 FXSYS_memset(ptr, val, (size_t)size); |
177 } | 177 } |
178 void _TIFFmemcpy(void* des, const void* src, tmsize_t size) { | 178 void _TIFFmemcpy(void* des, const void* src, tmsize_t size) { |
179 FXSYS_memcpy(des, src, (size_t)size); | 179 FXSYS_memcpy(des, src, (size_t)size); |
180 } | 180 } |
181 int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) { | 181 int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) { |
182 return FXSYS_memcmp(ptr1, ptr2, (size_t)size); | 182 return FXSYS_memcmp(ptr1, ptr2, (size_t)size); |
183 } | 183 } |
184 static void _tiff_warning_ext(thandle_t context, | 184 |
185 const char* module, | 185 TIFFErrorHandler _TIFFwarningHandler = nullptr; |
186 const char* fmt, | 186 TIFFErrorHandler _TIFFerrorHandler = nullptr; |
187 va_list ap) { | 187 |
188 if (module != NULL) { | |
189 } | |
190 } | |
191 TIFFErrorHandlerExt _TIFFwarningHandlerExt = _tiff_warning_ext; | |
192 static void _tiff_error_ext(thandle_t context, | |
193 const char* module, | |
194 const char* fmt, | |
195 va_list ap) { | |
196 if (module != NULL) { | |
197 } | |
198 } | |
199 TIFFErrorHandlerExt _TIFFerrorHandlerExt = _tiff_error_ext; | |
200 int TIFFCmyk2Rgb(thandle_t context, | 188 int TIFFCmyk2Rgb(thandle_t context, |
201 uint8 c, | 189 uint8 c, |
202 uint8 m, | 190 uint8 m, |
203 uint8 y, | 191 uint8 y, |
204 uint8 k, | 192 uint8 k, |
205 uint8* r, | 193 uint8* r, |
206 uint8* g, | 194 uint8* g, |
207 uint8* b) { | 195 uint8* b) { |
208 if (context == NULL) { | 196 if (context == NULL) { |
209 return 0; | 197 return 0; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 return pDecoder->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute); | 535 return pDecoder->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute); |
548 } | 536 } |
549 FX_BOOL CCodec_TiffModule::Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) { | 537 FX_BOOL CCodec_TiffModule::Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) { |
550 CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx; | 538 CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx; |
551 return pDecoder->Decode(pDIBitmap); | 539 return pDecoder->Decode(pDIBitmap); |
552 } | 540 } |
553 void CCodec_TiffModule::DestroyDecoder(void* ctx) { | 541 void CCodec_TiffModule::DestroyDecoder(void* ctx) { |
554 CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx; | 542 CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx; |
555 delete pDecoder; | 543 delete pDecoder; |
556 } | 544 } |
OLD | NEW |