Home | History | Annotate | Download | only in codec
      1 // Copyright 2016 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_CCODEC_GIFMODULE_H_
      8 #define CORE_FXCODEC_CODEC_CCODEC_GIFMODULE_H_
      9 
     10 #include "core/fxcodec/codec/icodec_gifmodule.h"
     11 #include "core/fxcrt/fx_coordinates.h"
     12 #include "core/fxcrt/fx_system.h"
     13 
     14 class CCodec_GifModule : public ICodec_GifModule {
     15  public:
     16   CCodec_GifModule();
     17   ~CCodec_GifModule() override;
     18 
     19   FXGIF_Context* Start() override;
     20   void Finish(FXGIF_Context* pContext) override;
     21   uint32_t GetAvailInput(FXGIF_Context* pContext,
     22                          uint8_t** avail_buf_ptr = nullptr) override;
     23 
     24   void Input(FXGIF_Context* pContext,
     25              const uint8_t* src_buf,
     26              uint32_t src_size) override;
     27 
     28   int32_t ReadHeader(FXGIF_Context* pContext,
     29                      int* width,
     30                      int* height,
     31                      int* pal_num,
     32                      void** pal_pp,
     33                      int* bg_index,
     34                      CFX_DIBAttribute* pAttribute) override;
     35 
     36   int32_t LoadFrameInfo(FXGIF_Context* pContext, int* frame_num) override;
     37   int32_t LoadFrame(FXGIF_Context* pContext,
     38                     int frame_num,
     39                     CFX_DIBAttribute* pAttribute) override;
     40 
     41  protected:
     42   FX_CHAR m_szLastError[256];
     43 };
     44 
     45 #endif  // CORE_FXCODEC_CODEC_CCODEC_GIFMODULE_H_
     46