YYBPGCoder.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // YYBPGCoder.h
  3. // YYKitExample
  4. //
  5. // Created by ibireme on 15/8/13.
  6. // Copyright (c) 2015 ibireme. All rights reserved.
  7. //
  8. #import <YYKit/YYKit.h>
  9. /*
  10. BPG image format:
  11. http://bellard.org/bpg/
  12. */
  13. /**
  14. Decode BPG data
  15. @param bpgData BPG image data.
  16. @param decodeForDisplay YES: returns a premultiply BRGA format image, NO: returns an ARGB format image.
  17. @return A new image, or NULL if an error occurs.
  18. */
  19. CG_EXTERN CGImageRef YYCGImageCreateWithBPGData(CFDataRef bpgData, BOOL decodeForDisplay);
  20. /**
  21. Decode a frame from BPG image data, returns NULL if an error occurs.
  22. @warning This method should only be used for benchmark.
  23. */
  24. CG_EXTERN CGImageRef YYCGImageCreateFrameWithBPGData(CFDataRef bpgData, NSUInteger frameIndex, BOOL decodeForDisplay);
  25. /**
  26. Decode all frames in BPG image data, returns NULL if an error occurs.
  27. @warning This method should only be used for benchmark.
  28. */
  29. CG_EXTERN void YYCGImageDecodeAllFrameInBPGData(CFDataRef bpgData, BOOL decodeForDisplay);
  30. /**
  31. Whether data is bpg.
  32. */
  33. CG_EXTERN BOOL YYImageIsBPGData(CFDataRef data);