Function

vImageConverter_MustOperateOutOfPlace(_:_:_:_:)

Determines whether a converter is capable of operating in place.

Declaration

func vImageConverter_MustOperateOutOfPlace(_ converter: vImageConverter, _ srcs: UnsafePointer<vImage_Buffer>!, _ dests: UnsafePointer<vImage_Buffer>!, _ flags: vImage_Flags) -> vImage_Error

Parameters

converter

The converter to check to determine if it's capable of operating in place.

srcs

The list of source buffers you plan to use with vImageConvert_AnyToAny(_:_:_:_:_:). This parameter may be NULL.

dests

The list of destination buffers you plan to use with vImageConvert_AnyToAny(_:_:_:_:_:). This parameter may be NULL.

flags

The flags you'll pass to vImageConvert_AnyToAny(_:_:_:_:_:).

Return Value

kvImageNoError if the conversion will work in place, kvImageOutOfPlaceOperationRequired if the conversion requires out of place operation; otherwise, one of the error codes described in Data Types and Constants.

Discussion

Some conversions work if the source and destination image buffer scanlines start at the same address. Others don't; for those cases, you need to allocate additional storage to hold the destination buffer.

In-place operation is considered to mean srcs[i].data = dests[i].data and srcs[i].rowBytes = dests[i].rowBytes. Other styles of partial buffer overlap produce undefined behavior.

See Also

Converting Any-to-Any

Building a Basic Conversion Workflow

Learn the fundamentals of the convert-any-to-any function by converting a CMYK image to an RGB image.

class vImageConverter

A description of a conversion from one image format to another.

func vImageConverter_GetSourceBufferOrder(vImageConverter) -> UnsafePointer<vImageBufferTypeCode>!

Returns a list of vImage source buffer channel names, specifying the order of planes.

func vImageConverter_GetDestinationBufferOrder(vImageConverter) -> UnsafePointer<vImageBufferTypeCode>!

Returns a list of vImage destination buffer channel names, specifying the order of planes.

vImage Buffer Type Codes

Constants that specify the contents of vImage buffers.

func vImageConverter_GetNumberOfSourceBuffers(vImageConverter) -> UInt

Returns the number of source buffers consumed by the converter.

func vImageConverter_GetNumberOfDestinationBuffers(vImageConverter) -> UInt

Returns the number of destination buffers written to by the converter.