GPUImagePicture.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #import <UIKit/UIKit.h>
  2. #import "GPUImageOutput.h"
  3. @interface GPUImagePicture : GPUImageOutput
  4. {
  5. CGSize pixelSizeOfImage;
  6. BOOL hasProcessedImage;
  7. dispatch_semaphore_t imageUpdateSemaphore;
  8. }
  9. // Initialization and teardown
  10. - (id)initWithURL:(NSURL *)url;
  11. - (id)initWithImage:(UIImage *)newImageSource;
  12. - (id)initWithCGImage:(CGImageRef)newImageSource;
  13. - (id)initWithImage:(UIImage *)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput;
  14. - (id)initWithCGImage:(CGImageRef)newImageSource smoothlyScaleOutput:(BOOL)smoothlyScaleOutput;
  15. // Image rendering
  16. - (void)processImage;
  17. - (CGSize)outputImageSize;
  18. /**
  19. * Process image with all targets and filters asynchronously
  20. * The completion handler is called after processing finished in the
  21. * GPU's dispatch queue - and only if this method did not return NO.
  22. *
  23. * @returns NO if resource is blocked and processing is discarded, YES otherwise
  24. */
  25. - (BOOL)processImageWithCompletionHandler:(void (^)(void))completion;
  26. - (void)processImageUpToFilter:(GPUImageOutput<GPUImageInput> *)finalFilterInChain withCompletionHandler:(void (^)(UIImage *processedImage))block;
  27. @end