alphai_dec.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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@google.com)
  13. #ifndef WEBP_DEC_ALPHAI_DEC_H_
  14. #define WEBP_DEC_ALPHAI_DEC_H_
  15. #include "./webpi_dec.h"
  16. #include "../utils/filters_utils.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct VP8LDecoder; // Defined in dec/vp8li.h.
  21. typedef struct ALPHDecoder ALPHDecoder;
  22. struct ALPHDecoder {
  23. int width_;
  24. int height_;
  25. int method_;
  26. WEBP_FILTER_TYPE filter_;
  27. int pre_processing_;
  28. struct VP8LDecoder* vp8l_dec_;
  29. VP8Io io_;
  30. int use_8b_decode_; // Although alpha channel requires only 1 byte per
  31. // pixel, sometimes VP8LDecoder may need to allocate
  32. // 4 bytes per pixel internally during decode.
  33. uint8_t* output_;
  34. const uint8_t* prev_line_; // last output row (or NULL)
  35. };
  36. //------------------------------------------------------------------------------
  37. // internal functions. Not public.
  38. // Deallocate memory associated to dec->alpha_plane_ decoding
  39. void WebPDeallocateAlphaMemory(VP8Decoder* const dec);
  40. //------------------------------------------------------------------------------
  41. #ifdef __cplusplus
  42. } // extern "C"
  43. #endif
  44. #endif // WEBP_DEC_ALPHAI_DEC_H_