pngdec.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2012 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. // PNG decode.
  11. #ifndef WEBP_IMAGEIO_PNGDEC_H_
  12. #define WEBP_IMAGEIO_PNGDEC_H_
  13. #include "webp/types.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. struct Metadata;
  18. struct WebPPicture;
  19. // Reads a PNG from 'data', returning the decoded output in 'pic'.
  20. // Output is RGBA or YUVA, depending on pic->use_argb value.
  21. // If 'keep_alpha' is true and the PNG has an alpha channel, the output is RGBA
  22. // or YUVA. Otherwise, alpha channel is dropped and output is RGB or YUV.
  23. // Returns true on success.
  24. int ReadPNG(const uint8_t* const data, size_t data_size,
  25. struct WebPPicture* const pic,
  26. int keep_alpha, struct Metadata* const metadata);
  27. #ifdef __cplusplus
  28. } // extern "C"
  29. #endif
  30. #endif // WEBP_IMAGEIO_PNGDEC_H_