Function

vImageMatrixMultiply_Planar16S(_:_:_:_:_:_:_:_:_:)

Operates on a set of 16-bit source image planes, multiplying each pixel by the provided matrix to produce a set of 16-bit destination image planes.

Declaration

func vImageMatrixMultiply_Planar16S(_ srcs: UnsafeMutablePointer<UnsafePointer<vImage_Buffer>?>, _ dests: UnsafeMutablePointer<UnsafePointer<vImage_Buffer>?>, _ src_planes: UInt32, _ dest_planes: UInt32, _ matrix: UnsafePointer<Int16>, _ divisor: Int32, _ pre_bias: UnsafePointer<Int16>!, _ post_bias: UnsafePointer<Int32>!, _ flags: vImage_Flags) -> vImage_Error

Parameters

srcs

A pointer to an array of vImage buffer structures, one buffer for each source plane.

dests

A pointer to an array of pointers to vImage buffer data structures, one buffer structure for each destination plane. You're responsible for filling out the height, width, and rowBytes fields of these structures, and for allocating data buffers of the appropriate size. On return, the data buffers in these structures contains the destination image data for each plane. When you no longer need the data buffers, you must deallocate the memory.

src_planes

The number of source planes.

dest_planes

The number of destination planes.

matrix

A 1D array whose values represent a matrix with the dimensions dest_planes*src_planes. vImage multiplies each source pixel by this matrix to produce a destination pixel.

divisor

A divisor for normalization after performing the matrix multiplication.

pre_bias

A packed array of bias values, one for each source plane. vImage adds the appropriate bias value to each source value before matrix multiplication. If you don't want to apply a preprocessing bias value, pass NULL.

post_bias

A packed array of bias values, one for each destination plane. vImage adds the appropriate bias value to each destination value after matrix multiplication. If you don't want to apply a preprocessing bias value, pass NULL.

flags

The options to use when performing the operation. If you plan to perform your own tiling or use multithreading, pass kvImageDoNotTile.

Return Value

kvImageNoError; otherwise, one of the error codes described in Data Types and Constants.

Discussion

This function uses 32-bit signed accumulators. If the sum over any matrix column is greater than ±2²³, overflow may occur. Generally speaking, this won't happen because the matrix elements are 16-bit integers, so it would take more than 256 source planes to cause problems.

See Also

Multiplying Pixels by a Matrix

func vImageMatrixMultiply_ARGB8888(UnsafePointer<vImage_Buffer>, UnsafePointer<vImage_Buffer>, UnsafePointer<Int16>, Int32, UnsafePointer<Int16>!, UnsafePointer<Int32>!, vImage_Flags) -> vImage_Error

Operates on an interleaved 8-bit source image, multiplying each pixel by the provided matrix to produce an interleaved 8-bit destination image.

func vImageMatrixMultiply_ARGBFFFF(UnsafePointer<vImage_Buffer>, UnsafePointer<vImage_Buffer>, UnsafePointer<Float>, UnsafePointer<Float>!, UnsafePointer<Float>!, vImage_Flags) -> vImage_Error

Operates on an interleaved floating-point source image, multiplying each pixel by the provided matrix to produce an interleaved floating-point destination image.

func vImageMatrixMultiply_ARGB8888ToPlanar8(UnsafePointer<vImage_Buffer>, UnsafePointer<vImage_Buffer>, UnsafePointer<Int16>, Int32, UnsafePointer<Int16>!, Int32, vImage_Flags) -> vImage_Error

Operates on an interleaved 8-bit source image, multiplying each pixel by the provided matrix to produce a one-channel 8-bit destination image.

func vImageMatrixMultiply_ARGBFFFFToPlanarF(UnsafePointer<vImage_Buffer>, UnsafePointer<vImage_Buffer>, UnsafePointer<Float>, UnsafePointer<Float>!, Float, vImage_Flags) -> vImage_Error

Operates on an interleaved 32-bit source image, multiplying each pixel by the provided matrix to produce a one-channel 32-bit destination image.