pub unsafe trait CIImageProcessorInput {
// Provided methods
unsafe fn region(&self) -> CGRect
where Self: Sized + Message { ... }
unsafe fn bytesPerRow(&self) -> usize
where Self: Sized + Message { ... }
unsafe fn format(&self) -> CIFormat
where Self: Sized + Message { ... }
unsafe fn baseAddress(&self) -> NonNull<c_void>
where Self: Sized + Message { ... }
unsafe fn surface(&self) -> Retained<IOSurfaceRef>
where Self: Sized + Message { ... }
unsafe fn pixelBuffer(&self) -> Option<Retained<CVPixelBuffer>>
where Self: Sized + Message { ... }
unsafe fn metalTexture(
&self,
) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>
where Self: Sized + Message { ... }
unsafe fn digest(&self) -> u64
where Self: Sized + Message { ... }
unsafe fn roiTileIndex(&self) -> NSUInteger
where Self: Sized + Message { ... }
unsafe fn roiTileCount(&self) -> NSUInteger
where Self: Sized + Message { ... }
}CIImageProcessor only.Expand description
Your app does not define classes that adopt this protocol; Core Image provides an object of this type
when rendering a custom image processor you create with a CIImageProcessorKernel subclass.
When a CIImage containing your CIImageProcessorKernel class is rendered, your
CIImageProcessorKernel/processWithInputs:arguments:output:error: class method will be called as
needed for that render. The method may be called more than once if Core Image needs to tile to
limit memory usage.
When your image processor class method is called, use the provided CIImageProcessorInput object to
access the image data and supporting information to perform your custom image processing routine.
For example, if you process the image using a Metal shader, use the metalTexture property to bind the
image as an input texture. Or, if you process the image using a CPU-based routine, use the baseAddress
property to access pixel data in memory.
You should use the input’s region property to determine which portion of the input image is available
to be processed.
To finish setting up or performing your image processing routine, use the provided CIImageProcessorOutput
object to return processed pixel data to Core Image.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn region(&self) -> CGRect
Available on crate feature objc2-core-foundation only.
unsafe fn region(&self) -> CGRect
objc2-core-foundation only.The rectangular region of the input image that your Core Image Processor Kernel can use to provide the output.
Note: This will contain but may be larger than the rect returned by ‘roiCallback’.
Sourceunsafe fn bytesPerRow(&self) -> usize
unsafe fn bytesPerRow(&self) -> usize
The bytes per row of the CPU memory that your Core Image Processor Kernel can read pixelsfrom.
Sourceunsafe fn format(&self) -> CIFormat
Available on crate feature CIImage only.
unsafe fn format(&self) -> CIFormat
CIImage only.The pixel format of the CPU memory that your Core Image Processor Kernel can read pixels from.
Sourceunsafe fn baseAddress(&self) -> NonNull<c_void>
unsafe fn baseAddress(&self) -> NonNull<c_void>
The base address of CPU memory that your Core Image Processor Kernel can read pixels from.
Warning: This memory must not be modified by the
CIImageProcessorKernel.
Sourceunsafe fn surface(&self) -> Retained<IOSurfaceRef>
Available on crate feature objc2-io-surface only.
unsafe fn surface(&self) -> Retained<IOSurfaceRef>
objc2-io-surface only.An input surface object that your Core Image Processor Kernel can read from.
Warning: This surface must not be modified by the
CIImageProcessorKernel.
Sourceunsafe fn pixelBuffer(&self) -> Option<Retained<CVPixelBuffer>>
Available on crate feature objc2-core-video only.
unsafe fn pixelBuffer(&self) -> Option<Retained<CVPixelBuffer>>
objc2-core-video only.An input pixel buffer object that your Core Image Processor Kernel can read from.
Warning: This buffer must not be modified by the
CIImageProcessorKernel.
Sourceunsafe fn metalTexture(
&self,
) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>
Available on crate feature objc2-metal only.
unsafe fn metalTexture( &self, ) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>
objc2-metal only.A MTLTexture object that can be bound for input using Metal.
Warning: This texture must not be modified by the
CIImageProcessorKernel.
Sourceunsafe fn digest(&self) -> u64
unsafe fn digest(&self) -> u64
A 64-bit digest that uniquely describes the contents of the input to a processor.
This digest will change if the graph of the input changes in any way.
Sourceunsafe fn roiTileIndex(&self) -> NSUInteger
unsafe fn roiTileIndex(&self) -> NSUInteger
This property tells a tiled-input processor which input tile index is being processed.
This property is only relevant if your processor implements /CIImageProcessorKernel/roiTileArrayForInput:arguments:outputRect:
This can be useful if the processor needs to clear the CIImageProcessorOutput before the first tile is processed.
Sourceunsafe fn roiTileCount(&self) -> NSUInteger
unsafe fn roiTileCount(&self) -> NSUInteger
This property tells a tiled-input processor how many input tiles will be processed.
This property is only relevant if your processor implements /CIImageProcessorKernel/roiTileArrayForInput:arguments:outputRect:
This can be useful if the processor needs to do work CIImageProcessorOutput after the last tile is processed.