iOS Developer Library

Developer

AVFoundation Framework Reference AVCaptureOutput Class Reference

Options
Deployment Target:

On This Page
Language:

AVCaptureOutput

AVCaptureOutput is an abstract base class describing an output destination of an AVCaptureSession object. More...

Conforms To


Import Statement


import AVFoundation @import AVFoundation;

Availability


Available in iOS 4.0 and later.
  • Converts an AVMetadataObject's visual properties to the receiver's coordinates.

    Declaration

    Swift

    func transformedMetadataObjectForMetadataObject(_ metadataObject: AVMetadataObject!, connection connection: AVCaptureConnection!) -> AVMetadataObject!

    Objective-C

    - (AVMetadataObject *)transformedMetadataObjectForMetadataObject:(AVMetadataObject *)metadataObject connection:(AVCaptureConnection *)connection

    Parameters

    metadataObject

    An AVMetadataObject originating from the same AVCaptureInput as the receiver.

    connection

    The receiver's connection whose AVCaptureInput matches that of the metadata object to be converted.

    Return Value

    An AVMetadataObject whose properties are in output coordinates, or nil if metadataObject originates from an input source other than the preview layer.

    Discussion

    This method converts the visual properties in the coordinate space of the supplied AVMetadataObject to the coordinate space of the receiver. The conversion takes orientation, mirroring, and scaling into consideration and alters the visual properties of the provided metadata object to match the physical rotation and mirroring of the sample buffers provided by the receiver through the indicated connection.

    This means that for video data output (AVCaptureVideoDataOutput), adjusted metadata object coordinates are rotated and mirrored. For still image (AVCaptureStillImageOutput) and movie file (AVCaptureMovieFileOutput) output, they are not. Instead, the rotation and mirroring of the metadata object coordinates for these two types of output are determined on playback.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 6.0 and later.

  • Converts a rectangle in the capture output object’s coordinate system to one in the coordinate system used for metadata outputs.

    Declaration

    Swift

    func metadataOutputRectOfInterestForRect(_ rectInOutputCoordinates: CGRect) -> CGRect

    Objective-C

    - (CGRect)metadataOutputRectOfInterestForRect:(CGRect)rectInOutputCoordinates

    Parameters

    rectInOutputCoordinates

    A rectangle in the AVCaptureOutput object’s coordinate system.

    Return Value

    A rectangle in the AVCaptureMetadataOutput coordinate system.

    Discussion

    The rectangle of interest for an AVCaptureMetadataOutput object is in a coordinate system extending from (0,0) in the top left to (1,1) in the bottom right, relative to the device’s natural orientation. A capture output object uses a pixel coordinate space which may be zoomed, rotated, or mirrored. Use this convenience method to quickly convert between coordinate spaces.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

  • Converts a rectangle in the coordinate system used for metadata outputs to one in the capture output object’s coordinate system.

    Declaration

    Swift

    func rectForMetadataOutputRectOfInterest(_ rectInMetadataOutputCoordinates: CGRect) -> CGRect

    Objective-C

    - (CGRect)rectForMetadataOutputRectOfInterest:(CGRect)rectInMetadataOutputCoordinates

    Parameters

    rectInMetadataOutputCoordinates

    A rectangle in the AVCaptureMetadataOutput coordinate system.

    Return Value

    A rectangle in the AVCaptureOutput object’s coordinate system.

    Discussion

    The rectangle of interest for an AVCaptureMetadataOutput object is in a coordinate system extending from (0,0) in the top left to (1,1) in the bottom right, relative to the device’s natural orientation. A capture output object uses a pixel coordinate space which may be zoomed, rotated, or mirrored. Use this convenience method to quickly convert between coordinate spaces.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.