Instance Method

sourceRegion(destinationSize:)

Determines the region of the source texture that will be read for an encode operation.

Declaration

func sourceRegion(destinationSize: MTLSize) -> MPSRegion

Parameters

destinationSize

The size of the full virtual destination image.

Return Value

The area in the virtual source image that will be read.

Discussion

This method is used to determine which region of the source texture will be read by the encode(commandBuffer:sourceTexture:destinationTexture:) method when the filter runs. This information may be needed if the source image is broken into multiple textures. The size of the full (untiled) destination image is provided. The region of the full (untiled) source image that will be read is returned. You can then piece together an appropriate texture containing that information for use in your tiled context.

This method will consult the offset and clipRect properties to determine the full region read by the function. Other properties, such as kernel height and width, will be consulted as necessary. All properties should be set to their intended values prior to calling this method.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software