extras.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2015 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. #ifndef WEBP_WEBP_EXTRAS_H_
  11. #define WEBP_WEBP_EXTRAS_H_
  12. #include "./types.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include "./encode.h"
  17. #define WEBP_EXTRAS_ABI_VERSION 0x0000 // MAJOR(8b) + MINOR(8b)
  18. //------------------------------------------------------------------------------
  19. // Returns the version number of the extras library, packed in hexadecimal using
  20. // 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507.
  21. WEBP_EXTERN(int) WebPGetExtrasVersion(void);
  22. //------------------------------------------------------------------------------
  23. // Ad-hoc colorspace importers.
  24. // Import luma sample (gray scale image) into 'picture'. The 'picture'
  25. // width and height must be set prior to calling this function.
  26. WEBP_EXTERN(int) WebPImportGray(const uint8_t* gray, WebPPicture* picture);
  27. // Import rgb sample in RGB565 packed format into 'picture'. The 'picture'
  28. // width and height must be set prior to calling this function.
  29. WEBP_EXTERN(int) WebPImportRGB565(const uint8_t* rgb565, WebPPicture* pic);
  30. // Import rgb sample in RGB4444 packed format into 'picture'. The 'picture'
  31. // width and height must be set prior to calling this function.
  32. WEBP_EXTERN(int) WebPImportRGB4444(const uint8_t* rgb4444, WebPPicture* pic);
  33. //------------------------------------------------------------------------------
  34. #ifdef __cplusplus
  35. } // extern "C"
  36. #endif
  37. #endif /* WEBP_WEBP_EXTRAS_H_ */