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 <setjmp.h> | 7 #include <setjmp.h> |
8 | 8 |
9 #include "core/fxcodec/codec/codec_int.h" | 9 #include "core/fxcodec/codec/codec_int.h" |
10 #include "core/fxcodec/include/fx_codec.h" | 10 #include "core/fxcodec/include/fx_codec.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 public: | 311 public: |
312 CCodec_JpegDecoder(); | 312 CCodec_JpegDecoder(); |
313 ~CCodec_JpegDecoder() override; | 313 ~CCodec_JpegDecoder() override; |
314 | 314 |
315 FX_BOOL Create(const uint8_t* src_buf, | 315 FX_BOOL Create(const uint8_t* src_buf, |
316 uint32_t src_size, | 316 uint32_t src_size, |
317 int width, | 317 int width, |
318 int height, | 318 int height, |
319 int nComps, | 319 int nComps, |
320 FX_BOOL ColorTransform); | 320 FX_BOOL ColorTransform); |
321 void Destroy() { delete this; } | |
322 | 321 |
323 // CCodec_ScanlineDecoder | 322 // CCodec_ScanlineDecoder |
324 FX_BOOL v_Rewind() override; | 323 FX_BOOL v_Rewind() override; |
325 uint8_t* v_GetNextLine() override; | 324 uint8_t* v_GetNextLine() override; |
326 uint32_t GetSrcOffset() override; | 325 uint32_t GetSrcOffset() override; |
327 | 326 |
328 FX_BOOL InitDecode(); | 327 FX_BOOL InitDecode(); |
329 | 328 |
330 jmp_buf m_JmpBuf; | 329 jmp_buf m_JmpBuf; |
331 struct jpeg_decompress_struct cinfo; | 330 struct jpeg_decompress_struct cinfo; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 uint32_t CCodec_JpegModule::GetAvailInput(FXJPEG_Context* ctx, | 647 uint32_t CCodec_JpegModule::GetAvailInput(FXJPEG_Context* ctx, |
649 uint8_t** avail_buf_ptr) { | 648 uint8_t** avail_buf_ptr) { |
650 if (avail_buf_ptr) { | 649 if (avail_buf_ptr) { |
651 *avail_buf_ptr = NULL; | 650 *avail_buf_ptr = NULL; |
652 if (ctx->m_SrcMgr.bytes_in_buffer > 0) { | 651 if (ctx->m_SrcMgr.bytes_in_buffer > 0) { |
653 *avail_buf_ptr = (uint8_t*)ctx->m_SrcMgr.next_input_byte; | 652 *avail_buf_ptr = (uint8_t*)ctx->m_SrcMgr.next_input_byte; |
654 } | 653 } |
655 } | 654 } |
656 return (uint32_t)ctx->m_SrcMgr.bytes_in_buffer; | 655 return (uint32_t)ctx->m_SrcMgr.bytes_in_buffer; |
657 } | 656 } |
OLD | NEW |