Rotates an ARGB16U source image by the provided factor of 90.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Accelerate
Declaration
func vImageRotate90_ARGB16U(_ src: Unsafe Pointer<v Image _Buffer>, _ dest: Unsafe Pointer<v Image _Buffer>, _ rotationConstant: UInt8, _ backColor: Unsafe Pointer<UInt16>, _ flags: v Image _Flags) -> v Image _Error
Parameters
src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
dest
A pointer to a vImage buffer data structure. You're responsible for filling out the
height
,width
, androw
fields of this structure, and for allocating a data buffer of the appropriate size. On return, the data buffer this structure points to contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.Bytes rotationConstant
A value specifying the angle of rotation.
backColor
A background color. Pass a pixel value only if you also set the
kv
flag.Image Background Color Fill flags
The options to use when performing the operation. If you plan to perform your own tiling or use multithreading, pass
kv
.Image Do Not Tile
Return Value
kv
; otherwise, one of the error codes described in Data Types and Constants.
Discussion
This function maps the center point of the source image to the center point of the destination image. It doesn't scale or resample; instead, the function copies individual pixels unchanged to new locations.
This function places certain restrictions on the pixel height and width of the source and destination buffers, so that it can precisely map the center of the source to the center of the destination precisely. The restrictions are:
If you're rotating the image 90 or 270 degrees, the height of the source image and the width of the destination image must both be even or both be odd.
The width of the source image and the height of the destination image must both be even or both be odd.
If your images don't meet these restrictions, you can use the general (high-level) rotate function instead, with an angle of 90 or 270 degrees.
Depending on the relative sizes of the source image and the destination buffer, parts of the source image may be clipped. Areas outside the source image may appear in the destination image as the background color.