vImageConvert_RGBFFFtoRGBAFFFF(_:_:_:_:_:_:)
Combines a floating-point 32-bit-per-channel, 3-channel RGB buffer and either an 32-bit alpha buffer or constant alpha value to produce an RGBA result.
Declaration
func vImageConvert_RGBFFFtoRGBAFFFF(_: UnsafePointer<vImage_Buffer>, _: UnsafePointer<vImage_Buffer>!, _: Pixel_F, _: UnsafePointer<vImage_Buffer>, _: Bool, _ flags: vImage_Flags) -> vImage_ErrorReturn Value
kvImageNoError; otherwise, one of the error codes in Data Types and Constants.
Discussion
Parameters
- rgbSrc
The source vImage buffer that contains the red, green, and blue channels.
- aSrc
The source vImage buffer that contains the alpha channel. Set this value to
nilto specify that the function sets the destination alpha as the constant destination alpha value.- alpha
The constant destination alpha value. The function ignores this paramater if the
aSrcparameter isn’tnil.- rgbaDest
A pointer to the destination vImage buffer structure. You’re responsible for filling out the height, width, and rowBytes 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, deallocate the memory to prevent memory leaks.
- premultiply
A Boolean value that specifes whether the function premultiplies the color channels by the alpha channel.
- flags
The options to use when performing the operation. If your code implements its own tiling or its own multithreading, pass kvImageDoNotTile; otherwise, pass kvImageNoFlags.
If you specify premultiply as true, the function uses the following calculation to perform the conversion:
r = (a * r)
g = (a * g)
b = (a * b)