Class CIContext

    • Constructor Detail

      • CIContext

        protected CIContext​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • context

        public static CIContext context()
      • contextWithCGContextOptions

        public static CIContext contextWithCGContextOptions​(CGContextRef cgctx,
                                                            NSDictionary<java.lang.String,​?> options)
        Create a context specifying a destination CGContext. Core Image will use an internal destination context when methods such as [context render:to...] or [context createCGImage:...] are called. The [context drawImage:...] render methods will render to the CGContext.
      • contextWithEAGLContext

        public static CIContext contextWithEAGLContext​(EAGLContext eaglContext)
      • contextWithEAGLContextOptions

        public static CIContext contextWithEAGLContextOptions​(EAGLContext eaglContext,
                                                              NSDictionary<java.lang.String,​?> options)
      • contextWithMTLDevice

        public static CIContext contextWithMTLDevice​(MTLDevice device)
        If a system has more than one MTLDevice, then you can create a CIContext that uses a specific device. If a client wishes to use the default MTLDevice then call [CIContext contextWithOptions:] instead.
      • contextWithMTLDeviceOptions

        public static CIContext contextWithMTLDeviceOptions​(MTLDevice device,
                                                            NSDictionary<java.lang.String,​?> options)
      • contextWithOptions

        public static CIContext contextWithOptions​(NSDictionary<java.lang.String,​?> options)
        Create a context without specifying a destination CG/GL/Metal context. Core Image will use an internal destination context when methods such as [context render:to...] or [context createCGImage:...] are called. The [context drawImage:...] render methods will not operate on this type of context.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • JPEGRepresentationOfImageColorSpaceOptions

        public NSData JPEGRepresentationOfImageColorSpaceOptions​(CIImage image,
                                                                 CGColorSpaceRef colorSpace,
                                                                 NSDictionary<java.lang.String,​?> options)
        Render a CIImage to JPEG data. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome. Supported options keys are kCGImageDestinationLossyCompressionQuality, and the depth, disparity, and matte options.
      • TIFFRepresentationOfImageFormatColorSpaceOptions

        public NSData TIFFRepresentationOfImageFormatColorSpaceOptions​(CIImage image,
                                                                       int format,
                                                                       CGColorSpaceRef colorSpace,
                                                                       NSDictionary<java.lang.String,​?> options)
        Render a CIImage to TIFF data. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. No options keys are supported at this time.
      • clearCaches

        public void clearCaches()
        Frees any cached data (such as temporary images) associated with the context. This also runs the garbage collector.
      • createCGImageFromRect

        public CGImageRef createCGImageFromRect​(CIImage image,
                                                CGRect fromRect)
        Render the region 'fromRect' of image 'image' into a temporary buffer using the context, then create and return a new CoreGraphics image with the results. The caller is responsible for releasing the returned image. The return value will be null if size is empty or too big.
      • createCGImageFromRectFormatColorSpace

        public CGImageRef createCGImageFromRectFormatColorSpace​(CIImage image,
                                                                CGRect fromRect,
                                                                int format,
                                                                CGColorSpaceRef colorSpace)
        Create a new CGImage from the specified subrect of the image. If non-nil the new image will be created in the specified format and colorspace. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. This will return null if fromRect is empty or infinite or the format isn't supported.
      • createCGImageFromRectFormatColorSpaceDeferred

        public CGImageRef createCGImageFromRectFormatColorSpaceDeferred​(CIImage image,
                                                                        CGRect fromRect,
                                                                        int format,
                                                                        CGColorSpaceRef colorSpace,
                                                                        boolean deferred)
        Create a new CGImage from the specified subrect of the image. The new CGImageRef will be created in the specified format and colorspace. The return value will be null if fromRect is empty or infinite. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. This will return null if fromRect is empty or infinite or the format isn't supported. If deferred is NO, then the CIImage will be rendered once when this method is called. If deferred is YES, then the CIImage will be rendered whenever the CGImage is rendered.
      • drawImageAtPointFromRect

        @Deprecated
        public void drawImageAtPointFromRect​(CIImage image,
                                             CGPoint atPoint,
                                             CGRect fromRect)
        Deprecated.
        DEPRECATED, please use drawImage:inRect:fromRect: instead. Render the subregion 'fromRect' of 'image' to point 'atPoint' in the context's destination.
      • drawImageInRectFromRect

        public void drawImageInRectFromRect​(CIImage image,
                                            CGRect inRect,
                                            CGRect fromRect)
        Render the rectangle 'fromRect' of 'image' to the rectangle 'inRect' in the context's destination.
      • inputImageMaximumSize

        public CGSize inputImageMaximumSize()
        Returns the maximum dimension for input images that can be processed on the context.
      • outputImageMaximumSize

        public CGSize outputImageMaximumSize()
        Returns the maximum dimension for image that can be rendered on the context.
      • renderToBitmapRowBytesBoundsFormatColorSpace

        public void renderToBitmapRowBytesBoundsFormatColorSpace​(CIImage image,
                                                                 org.moe.natj.general.ptr.VoidPtr data,
                                                                 long rowBytes,
                                                                 CGRect bounds,
                                                                 int format,
                                                                 CGColorSpaceRef colorSpace)
        Render 'image' to the given bitmap. The 'data' parameter must point to at least rowBytes*floor(bounds.size.height) bytes. The 'bounds' parameter has the following behavior: The 'bounds' parameter acts to specify the region of 'image' to render. This region (regardless of its origin) is rendered at upper-left corner of 'data'. Passing a 'colorSpace' value of null means: Disable output color management if app is linked against iOS SDK Disable output color management if app is linked against OSX 10.11 SDK or later Match to context's output color space if app is linked against OSX 10.10 SDK or earlier
      • renderToCVPixelBuffer

        public void renderToCVPixelBuffer​(CIImage image,
                                          CVBufferRef buffer)
        Render 'image' into the given CVPixelBuffer. In OS X 10.11.3 and iOS 9.3 and later CI will color match to the colorspace of the buffer. otherwise CI will color match to the context's output colorspace.
      • renderToCVPixelBufferBoundsColorSpace

        public void renderToCVPixelBufferBoundsColorSpace​(CIImage image,
                                                          CVBufferRef buffer,
                                                          CGRect bounds,
                                                          CGColorSpaceRef colorSpace)
        Render 'image' to the given CVPixelBufferRef. The 'bounds' parameter has the following behavior: In OS X and iOS 9 and later: The 'image' is rendered into 'buffer' so that point (0,0) of 'image' aligns to the lower left corner of 'buffer'. The 'bounds' acts like a clip rect to limit what region of 'buffer' is modified. In iOS 8 and earlier: The 'bounds' parameter acts to specify the region of 'image' to render. This region (regardless of its origin) is rendered at upper-left corner of 'buffer'. If 'colorSpace' is nil, CI will not color match to the destination.
      • renderToMTLTextureCommandBufferBoundsColorSpace

        public void renderToMTLTextureCommandBufferBoundsColorSpace​(CIImage image,
                                                                    MTLTexture texture,
                                                                    MTLCommandBuffer commandBuffer,
                                                                    CGRect bounds,
                                                                    CGColorSpaceRef colorSpace)
        Render 'bounds' of 'image' to a Metal texture, optionally specifying what command buffer to use. Texture type must be MTLTexture2D. NOTE: Rendering to a texture initialized with a commandBuffer requires encoding all the commands to render an image into the specified buffer. This may impact system responsiveness and may result in higher memory usage if the image requires many passes to render. To avoid this impact, it is recommended to create a context using [CIContext contextWithMTLCommandQueue:].
      • workingColorSpace

        public CGColorSpaceRef workingColorSpace()
        The working color space of the CIContext The property will be null if the context was created with color management disabled.
      • workingFormat

        public int workingFormat()
        The working pixel format of the CIContext used for intermediate buffers
      • writeJPEGRepresentationOfImageToURLColorSpaceOptionsError

        public boolean writeJPEGRepresentationOfImageToURLColorSpaceOptionsError​(CIImage image,
                                                                                 NSURL url,
                                                                                 CGColorSpaceRef colorSpace,
                                                                                 NSDictionary<java.lang.String,​?> options,
                                                                                 org.moe.natj.general.ptr.Ptr<NSError> errorPtr)
        Render a CIImage to JPEG file. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome. Supported options keys are kCGImageDestinationLossyCompressionQuality, and the depth, disparity, and matte options.
      • writeTIFFRepresentationOfImageToURLFormatColorSpaceOptionsError

        public boolean writeTIFFRepresentationOfImageToURLFormatColorSpaceOptionsError​(CIImage image,
                                                                                       NSURL url,
                                                                                       int format,
                                                                                       CGColorSpaceRef colorSpace,
                                                                                       NSDictionary<java.lang.String,​?> options,
                                                                                       org.moe.natj.general.ptr.Ptr<NSError> errorPtr)
        Render a CIImage to TIFF file. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. No options keys are supported at this time.
      • HEIFRepresentationOfImageFormatColorSpaceOptions

        public NSData HEIFRepresentationOfImageFormatColorSpaceOptions​(CIImage image,
                                                                       int format,
                                                                       CGColorSpaceRef colorSpace,
                                                                       NSDictionary<java.lang.String,​?> options)
        Render a CIImage to HEIF data. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. Supported options keys are kCGImageDestinationLossyCompressionQuality, and the depth, disparity, and matte options.
      • PNGRepresentationOfImageFormatColorSpaceOptions

        public NSData PNGRepresentationOfImageFormatColorSpaceOptions​(CIImage image,
                                                                      int format,
                                                                      CGColorSpaceRef colorSpace,
                                                                      NSDictionary<java.lang.String,​?> options)
        Render a CIImage to PNG data. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. No options keys are supported at this time.
      • prepareRenderFromRectToDestinationAtPointError

        public boolean prepareRenderFromRectToDestinationAtPointError​(CIImage image,
                                                                      CGRect fromRect,
                                                                      CIRenderDestination destination,
                                                                      CGPoint atPoint,
                                                                      org.moe.natj.general.ptr.Ptr<NSError> error)
        This is an optional call which can be used to "warm up" a CIContext so that a subsequent call to render with the same arguments can be more efficient. By making this call, Core Image will ensure that - any needed kernels will be compiled - any intermedate buffers are allocated and marked volatile
      • renderToIOSurfaceBoundsColorSpace

        public void renderToIOSurfaceBoundsColorSpace​(CIImage image,
                                                      IOSurfaceRef surface,
                                                      CGRect bounds,
                                                      CGColorSpaceRef colorSpace)
        Render 'image' to the given IOSurface. The 'bounds' parameter has the following behavior: The 'image' is rendered into 'surface' so that point (0,0) of 'image' aligns to the lower left corner of 'surface'. The 'bounds' acts like a clip rect to limit what region of 'surface' is modified.
      • startTaskToClearError

        public CIRenderTask startTaskToClearError​(CIRenderDestination destination,
                                                  org.moe.natj.general.ptr.Ptr<NSError> error)
        Fill the entire destination with black (0,0,0,1) if its alphaMode is None or clear (0,0,0,0) if its alphaMode is Premultiplied or Unpremultiplied.
      • startTaskToRenderFromRectToDestinationAtPointError

        public CIRenderTask startTaskToRenderFromRectToDestinationAtPointError​(CIImage image,
                                                                               CGRect fromRect,
                                                                               CIRenderDestination destination,
                                                                               CGPoint atPoint,
                                                                               org.moe.natj.general.ptr.Ptr<NSError> error)
        Renders a portion of image to a point of destination It renders as if 'image' is cropped to 'fromRect' and the origin of the result is placed at 'atPoint' If image.extent and fromRect are infinite, then it renders so that point (0,0) of image is placed at 'atPoint' MTLTexture-backed CIRenderDestinations are only supported by MTLTexture-backed CIContexts. GLTexture-backed CIRenderDestinations are only supported by GLContext-backed CIContexts. For contexts that are initialized with a command queue, this call will return as soon as all the work for the render is enqueued on the context's device. Otherwise, it will return as soon as all the work is scheduled. In many situations, after issuing a render, the client can use the destination or its backing object without waiting for the enqueued work to complete. For example, after rendering a surface CIRenderDestination, the surface can be passed on for further processing by the GPU. In other situations, the client may need to wait for the render to be complete. For example, after rendering a surface CIRenderDestination, the surface can be accessed by CPU code by calling IOSurfaceGetBytePointer only after the render is completed. In this case the client can use the returned CIRenderTask like this: CIRenderTask* task = [context render:...]; [task waitUntilCompletedAndReturnError:&error];
      • startTaskToRenderToDestinationError

        public CIRenderTask startTaskToRenderToDestinationError​(CIImage image,
                                                                CIRenderDestination destination,
                                                                org.moe.natj.general.ptr.Ptr<NSError> error)
        Renders an image to a destination so that point (0,0) of image. is placed at point (0,0) of the destination.
      • writeHEIFRepresentationOfImageToURLFormatColorSpaceOptionsError

        public boolean writeHEIFRepresentationOfImageToURLFormatColorSpaceOptionsError​(CIImage image,
                                                                                       NSURL url,
                                                                                       int format,
                                                                                       CGColorSpaceRef colorSpace,
                                                                                       NSDictionary<java.lang.String,​?> options,
                                                                                       org.moe.natj.general.ptr.Ptr<NSError> errorPtr)
        Render a CIImage to HEIF file. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. Supported options keys are kCGImageDestinationLossyCompressionQuality, and the depth, disparity, and matte options.
      • writePNGRepresentationOfImageToURLFormatColorSpaceOptionsError

        public boolean writePNGRepresentationOfImageToURLFormatColorSpaceOptionsError​(CIImage image,
                                                                                      NSURL url,
                                                                                      int format,
                                                                                      CGColorSpaceRef colorSpace,
                                                                                      NSDictionary<java.lang.String,​?> options,
                                                                                      org.moe.natj.general.ptr.Ptr<NSError> errorPtr)
        Render a CIImage to PNG file. Image must have a finite non-empty extent. The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified CIFormat. No options keys are supported at this time.
      • contextWithMTLCommandQueue

        public static CIContext contextWithMTLCommandQueue​(MTLCommandQueue commandQueue)
        Create a CIContext that commits commands to a specific queue.
      • depthBlurEffectFilterForImageDisparityImagePortraitEffectsMatteHairSemanticSegmentationOrientationOptions

        public CIFilter depthBlurEffectFilterForImageDisparityImagePortraitEffectsMatteHairSemanticSegmentationOrientationOptions​(CIImage image,
                                                                                                                                  CIImage disparityImage,
                                                                                                                                  CIImage portraitEffectsMatte,
                                                                                                                                  CIImage hairSemanticSegmentation,
                                                                                                                                  int orientation,
                                                                                                                                  NSDictionary<?,​?> options)
      • depthBlurEffectFilterForImageDisparityImagePortraitEffectsMatteOrientationOptions

        public CIFilter depthBlurEffectFilterForImageDisparityImagePortraitEffectsMatteOrientationOptions​(CIImage image,
                                                                                                          CIImage disparityImage,
                                                                                                          CIImage portraitEffectsMatte,
                                                                                                          int orientation,
                                                                                                          NSDictionary<?,​?> options)
        Create and CIFilter instance for 'image' that can be used to apply the CIDepthBlurEffect. The receiver context is user to render the image in order to get the facial landmarks The 'orientation' parameter should be CGImagePropertyOrientation enum value as defined in the TIFF spec. The 'options' parameter is a key value/pair reserved for future use.
      • depthBlurEffectFilterForImageDataOptions

        public CIFilter depthBlurEffectFilterForImageDataOptions​(NSData data,
                                                                 NSDictionary<?,​?> options)
        This is the same as the method above expect it uses NSData to instantiate the image data instead of the contents of a NSURL.
      • depthBlurEffectFilterForImageURLOptions

        public CIFilter depthBlurEffectFilterForImageURLOptions​(NSURL url,
                                                                NSDictionary<?,​?> options)
        Create and CIFilter instance for 'image' that can be used to apply the CIDepthBlurEffect. The receiver context is user to render the image in order to get the facial landmarks The 'options' parameter is a key value/pair reserved for future use.
      • depthBlurEffectFilterForImageDisparityImagePortraitEffectsMatteHairSemanticSegmentationGlassesMatteGainMapOrientationOptions

        public CIFilter depthBlurEffectFilterForImageDisparityImagePortraitEffectsMatteHairSemanticSegmentationGlassesMatteGainMapOrientationOptions​(CIImage image,
                                                                                                                                                     CIImage disparityImage,
                                                                                                                                                     CIImage portraitEffectsMatte,
                                                                                                                                                     CIImage hairSemanticSegmentation,
                                                                                                                                                     CIImage glassesMatte,
                                                                                                                                                     CIImage gainMap,
                                                                                                                                                     int orientation,
                                                                                                                                                     NSDictionary<?,​?> options)