Instance Property

renderScale

The scale factor of the frame image relative to the Live Photo’s photo content.

Required.

Declaration

@property(readonly) CGFloat renderScale;

Discussion

Photos calls your frameProcessor block repeatedly, both to process each frame of the Live Photo’s video content and to process the Live Photo’s still photo content. Video frames can be a different size than still photo content—use this value to scale any of your image processing parameters that depend on the image’s size.

For example, the following code uses this property to ensure that the radius of a blur filter is consistent across all frames of a Live Photo:

context.frameProcessor = ^CIImage *(id <PHLivePhotoFrame> frame, NSError **error) {
    // Apply a blur whose radius is 10 pixels in the photo, scaled accordingly for video frames.
    return [frame.image imageByApplyingGaussianBlurWithRadius:(frame.renderScale * 10)];
};

See Also

Getting Information About the Frame

time

The time offset, in seconds, of this frame relative to the start of the Live Photo.

Required.

type

The type of image content in this frame.

Required.

PHLivePhotoFrameType

Identifiers for the type of frame image to be processed. Used with the type property.