Home | History | Annotate | Download | only in dec
      1 // Copyright 2013 Google Inc. All Rights Reserved.
      2 //
      3 // Use of this source code is governed by a BSD-style license
      4 // that can be found in the COPYING file in the root of the source
      5 // tree. An additional intellectual property rights grant can be found
      6 // in the file PATENTS. All contributing project authors may
      7 // be found in the AUTHORS file in the root of the source tree.
      8 // -----------------------------------------------------------------------------
      9 //
     10 // Alpha decoder: internal header.
     11 //
     12 // Author: Urvang (urvang (at) google.com)
     13 
     14 #ifndef WEBP_DEC_ALPHAI_DEC_H_
     15 #define WEBP_DEC_ALPHAI_DEC_H_
     16 
     17 #include "src/dec/webpi_dec.h"
     18 #include "src/utils/filters_utils.h"
     19 
     20 #ifdef __cplusplus
     21 extern "C" {
     22 #endif
     23 
     24 struct VP8LDecoder;  // Defined in dec/vp8li.h.
     25 
     26 typedef struct ALPHDecoder ALPHDecoder;
     27 struct ALPHDecoder {
     28   int width_;
     29   int height_;
     30   int method_;
     31   WEBP_FILTER_TYPE filter_;
     32   int pre_processing_;
     33   struct VP8LDecoder* vp8l_dec_;
     34   VP8Io io_;
     35   int use_8b_decode_;  // Although alpha channel requires only 1 byte per
     36                        // pixel, sometimes VP8LDecoder may need to allocate
     37                        // 4 bytes per pixel internally during decode.
     38   uint8_t* output_;
     39   const uint8_t* prev_line_;   // last output row (or NULL)
     40 };
     41 
     42 //------------------------------------------------------------------------------
     43 // internal functions. Not public.
     44 
     45 // Deallocate memory associated to dec->alpha_plane_ decoding
     46 void WebPDeallocateAlphaMemory(VP8Decoder* const dec);
     47 
     48 //------------------------------------------------------------------------------
     49 
     50 #ifdef __cplusplus
     51 }    // extern "C"
     52 #endif
     53 
     54 #endif  /* WEBP_DEC_ALPHAI_DEC_H_ */
     55