TIOVisionPipeline

@interface TIOVisionPipeline : NSObject

The TIOVisionPipeline is responsible for scaling and croping, rotating, and converting the provided pixel buffer to an ARGB or BGRA pixel format, using properties specified by the model.

  • A description of the pixel input expected by the model.

    Declaration

    Objective-C

    @property (readonly, atomic)
        TIOPixelBufferLayerDescription *_Nonnull pixelBufferDescription;

    Swift

    var pixelBufferDescription: TIOPixelBufferLayerDescription { get }
  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTIOPixelBufferDescription:
        (nonnull TIOPixelBufferLayerDescription *)pixelBufferDescription;

    Swift

    init(tioPixelBufferDescription pixelBufferDescription: TIOPixelBufferLayerDescription)

    Parameters

    pixelBufferDescription

    A description of the input layer that specifies the transformations needed to convert a pixel buffer to a format that can be accepted by the model.

  • Unavailable

    Use the designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Transform a pixel buffer into the format required by the TIOPixelBufferLayerDescription.

    A single TIOVisionPipeline may be used to transform multiple pixel buffers for the same model.

    Declaration

    Objective-C

    - (nullable CVPixelBufferRef)transform:(nonnull CVPixelBufferRef)pixelBuffer
                               orientation:(CGImagePropertyOrientation)orientation;

    Swift

    func transform(_ pixelBuffer: CVPixelBuffer, orientation: CGImagePropertyOrientation) -> Unmanaged<CVPixelBuffer>?

    Parameters

    pixelBuffer

    The CVPixelBufferRef that will be transformed.

    orientation

    The orientation of the pixel buffer.

    Return Value

    A CVPixelBufferRef that is suitable for use as input to the model.