Converts an indexed 4-bit image to a Planar8 image.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Accelerate
Declaration
func vImageConvert_Indexed4toPlanar8(_ src: Unsafe Pointer<v Image _Buffer>, _ dest: Unsafe Pointer<v Image _Buffer>, _ colors: Unsafe Pointer<Pixel _8>, _ flags: v Image _Flags) -> v Image _Error
Parameters
src
A pointer to the source vImage buffer object. Because the source pixel format is smaller than a byte, there are multiple pixels in each byte of the data buffer. These pixels are interpreted as being in big endian order (that is, the low-indexed pixel is in the high-order bits of the byte).
Sub-byte indexing of scanlines is unsupported, because the data and rowBytes fields of the buffer are specified in whole bytes.
Widths, however, are measured in pixels, so a scanline may end in the middle of a byte. If this occurs, the contents of any unused bits of the final byte are ignored.
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 colors
Color table from which to lookup pixel values for the destination image.
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
For each pixel in the destination image, the value is looked up in the color table using the corresponding pixel value from the source image as an index.