Mat+Converters.h 658 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // Mat+Converters.h
  3. //
  4. // Created by Masaya Tsuruta on 2020/10/08.
  5. //
  6. #pragma once
  7. #ifdef __cplusplus
  8. #import "opencv2/core.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import "Mat.h"
  13. #import <Foundation/Foundation.h>
  14. #import <AppKit/AppKit.h>
  15. NS_ASSUME_NONNULL_BEGIN
  16. CV_EXPORTS @interface Mat (Converters)
  17. -(CGImageRef)toCGImage CF_RETURNS_RETAINED;
  18. -(instancetype)initWithCGImage:(CGImageRef)image;
  19. -(instancetype)initWithCGImage:(CGImageRef)image alphaExist:(BOOL)alphaExist;
  20. -(NSImage*)toNSImage;
  21. -(instancetype)initWithNSImage:(NSImage*)image;
  22. -(instancetype)initWithNSImage:(NSImage*)image alphaExist:(BOOL)alphaExist;
  23. @end
  24. NS_ASSUME_NONNULL_END