| Framework | Accelerate/vImage |
| Companion guide | |
| Declared in | Alpha.h |
Alpha compositing (also known as alpha blending) is the process of layering multiple images, with the alpha value for a pixel in a given layer indicating what fraction of the colors from lower layers are seen through the color at the given level. The functions described in this reference operate on the alpha values of pixels either by blending alpha values or clipping them.
Most of the alpha compositing functions blend two input images—a top image and a bottom image—to create a composite image. The vImage framework computes the alpha values of the composite image from the alpha values of the input images. Some functions operate on interleaved formats (ARGB8888, ARGBFFFF, RGBA8888, RGBAFFFF) while others operate on planar formats. Interleaved formats contain an alpha value for each pixel, but planar formats do not. To perform alpha compositing with planar images, you need to supply the alpha information separately.
Alpha compositing functions by default perform tiling internally and may multithread internally as well. If you plan to perform your own tiling or multithreading, you must turn off vImage internal tiling and multithreading by supplying the kvImageDoNotTile flag as an option to the functions you use.
The vImage framework provides functions for alpha compositing for both the premultiplied alpha case and the nonpremultiplied alpha case. Mac OS X v10.4 adds some alpha compositing functions for common mixed cases. Premultiplying pixel color values by the associated alpha value results in greater computational efficiency than providing nonpremultiplied data, especially when you composite more than two images. When you use premultiplied alpha, you still need to maintain the original alpha information, so that you can retrieve the original, nonpremultiplied values of the pixels when you need them. You also need to supply the original alpha value for the bottom layer in a compositing operation.
For floating-point formats, you can multiply the color value by the alpha value directly. For integer formats in which both values are in the range of 0 to 255, you multiply the color and alpha values, then you must scale the result so that it is in the 0 to 255 range. The scaling calculation is:
scaledColor = (alpha * color + 127) / 255 |
Alpha compositing functions use a vImage buffer structure (vImage_Buffer—see vImage Data Types and Constants Reference) to receive and supply image data. This buffer contains a pointer to image data, the height and width (in pixels) of the image data, and the number of row bytes. You actually pass a pointer to a vImage buffer structure. You can provide a pointer to the same vImage buffer structure for one of the source images and the destination image because alpha compositing functions “work in place”. That is , the source and destination images can occupy the same memory if the they are strictly aligned pixel for pixel.
vImageAlphaBlend_ARGBFFFF
vImageAlphaBlend_ARGB8888
vImageAlphaBlend_PlanarF
vImageAlphaBlend_Planar8
vImagePremultipliedAlphaBlend_ARGBFFFF
vImagePremultipliedAlphaBlend_ARGB8888
vImagePremultipliedAlphaBlend_PlanarF
vImagePremultipliedAlphaBlend_Planar8
vImagePremultipliedConstAlphaBlend_ARGBFFFF
vImagePremultipliedConstAlphaBlend_ARGB8888
vImagePremultipliedConstAlphaBlend_PlanarF
vImagePremultipliedConstAlphaBlend_Planar8
vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGBFFFF
vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888
vImageAlphaBlend_NonpremultipliedToPremultiplied_PlanarF
vImageAlphaBlend_NonpremultipliedToPremultiplied_Planar8
vImagePremultiplyData_ARGBFFFF
vImagePremultiplyData_RGBAFFFF
vImagePremultiplyData_ARGB8888
vImagePremultiplyData_RGBA8888
vImagePremultiplyData_PlanarF
vImagePremultiplyData_Planar8
vImageUnpremultiplyData_ARGBFFFF
vImageUnpremultiplyData_RGBAFFFF
vImageUnpremultiplyData_ARGB8888
vImageUnpremultiplyData_RGBA8888
vImageUnpremultiplyData_PlanarF
vImageUnpremultiplyData_Planar8
vImageClipToAlpha_Planar8
vImageClipToAlpha_ARGB8888
vImageClipToAlpha_PlanarF
vImageClipToAlpha_ARGBFFFF
Performs nonpremultiplied alpha compositing of two ARGB8888 images, placing the result in a destination buffer.
vImage_Error vImageAlphaBlend_ARGB8888 ( const vImage_Buffer *srcTop, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
The calculation for each color channel is:
resultAlpha = (topAlpha * 255 + (255 - topAlpha) |
* bottomAlpha + 127) / 255 |
resultColor = (topAlpha * topColor + (((255 - topAlpha) |
* bottomAlpha + 127) / 255) * bottomColor + 127) |
/ resultAlpha |
Alpha.hPerforms nonpremultiplied alpha compositing of two ARGBFFFF images, placing the result in a destination buffer.
vImage_Error vImageAlphaBlend_ARGBFFFF ( const vImage_Buffer *srcTop, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
The calculation for each color channel is:
resultAlpha = topAlpha + (1.0f - topAlpha) * bottomAlpha |
resultColor = (topAlpha * topColor + (1.0f - topAlpha) |
* bottomAlpha * bottomColor) / resultAlpha |
Alpha.hPerforms mixed alpha compositing of a nonpremultiplied ARGB8888 image over a premultiplied ARGB8888 image, placing the premultiplied result in a destination buffer.
vImage_Error vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888 ( const vImage_Buffer *srcTop, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source images must be at least as wide and at least as high as the destination buffer.
Alpha.hPerforms mixed alpha compositing of a nonpremultiplied ARGBFFFF image over a premultiplied ARGBFFFF image, placing the premultiplied result in a destination buffer.
vImage_Error vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGBFFFF ( const vImage_Buffer *srcTop, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source images must be at least as wide and at least as high as the destination buffer.
Alpha.hPerforms mixed alpha compositing of a nonpremultiplied Planar8 image over a premultiplied Planar8 image, placing the premultiplied result in a destination buffer.
vImage_Error vImageAlphaBlend_NonpremultipliedToPremultiplied_Planar8 ( const vImage_Buffer *srcTop, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source images must be at least as wide and at least as high as the destination buffer.
Alpha.hPerforms mixed alpha compositing of a nonpremultiplied PlanarF image over a premultiplied PlanarF image, placing the premultiplied result in a destination buffer.
vImage_Error vImageAlphaBlend_NonpremultipliedToPremultiplied_PlanarF ( const vImage_Buffer *srcTop, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source images must be at least as wide and at least as high as the destination buffer.
Alpha.hPerforms nonpremultiplied alpha compositing of two Planar8 images, placing the result in a destination buffer.
vImage_Error vImageAlphaBlend_Planar8 ( const vImage_Buffer *srcTop, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *srcBottomAlpha, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the bottom source image.
A pointer to a vImage buffer structure that contains data for the precalculated alpha values of the composite image. You must precalculate these values by calling the function vPremultipliedAlphaBlend_PlanarF. See the Discussion for details on using this function.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source, alpha values, destination, and composite alpha values must contain the same height and width.
For performance reasons, this function does not calculate alpha values for the composite image; you must provide them. You’ll typically call this function three times, once for each color channel (red, green, blue). Because each call uses the same alpha value, it is much more efficient for you to precalculate the alpha values using the function vImagePremultipliedAlphaBlend_Planar8, rather than have the calculation repeated three times by thevImageAlphaBlend_Planar8 function. Call the function vPremultipliedAlphaBlend_Planar8 using the parameters shown:
vImagePremultipliedAlphaBlend_Planar8(srcTopAlpha, |
srcTopAlpha, // Yes, use this twice |
srcBottomAlpha, |
alpha, //On return, contains the composite alpha values |
kvImageNoFlags ); |
After calling the vPremultipliedAlphaBlend_Planar8 function, the resulting values for each color channel are:
resultAlpha = topAlpha + (1.0f - topAlpha) * bottomAlpha |
resultColor = (topAlpha * topColor + (1.0f - topAlpha) |
* bottomAlpha * bottomColor) / resultAlpha |
Alpha.hPerforms nonpremultiplied alpha compositing of two PlanarF images, placing the result in a destination buffer.
vImage_Error vImageAlphaBlend_PlanarF ( const vImage_Buffer *srcTop, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *srcBottomAlpha, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the bottom source image.
A pointer to a vImage buffer structure that contains data for the precalculated alpha values of the composite image. You must precalculate these values by calling the function vPremultipliedAlphaBlend_PlanarF. See the Discussion for details on using this function.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source, alpha values, destination, and composite alpha values must contain the same height and width.
For performance reasons, this function does not calculate alpha values for the composite image; you must provide them. You’ll typically call this function three times, once for each color channel (red, green, blue). Because each call uses the same alpha value, it is much more efficient for you to precalculate the alpha values using the function vImagePremultipliedAlphaBlend_PlanarF, rather than to have the calculation repeated three times by thevImageAlphaBlend_PlanarF function. Call the function vPremultipliedAlphaBlend_PlanarF using the parameters shown:
vImagePremultipliedAlphaBlend_PlanarF(srcTopAlpha, |
srcTopAlpha, // Yes, use this twice |
srcBottomAlpha, |
alpha, //On return, contains the composite alpha values |
kvImageNoFlags ); |
After calling the vPremultipliedAlphaBlend_PlanarF function, the resulting values for each color channel are:
resultAlpha = topAlpha + (1.0f - topAlpha) * bottomAlpha |
resultColor = (topAlpha * topColor + (1.0f - topAlpha) |
* bottomAlpha * bottomColor) / resultAlpha |
Alpha.hSets the color channel of each pixel in an ARGB8888 image to the smaller of two values—either the color channel or the alpha value for that pixel.
vImage_Error vImageClipToAlpha_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
For each pixel:
alpha_result = sourceAlpha; |
color_result = MIN(sourceColor, sourceAlpha); |
Alpha.hSets the color channel of each pixel in an ARGBFFFF image to the smaller of two values—either the color channel or the alpha value for that pixel.
vImage_Error vImageClipToAlpha_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
For each pixel:
alpha_result = sourceAlpha; |
color_result = MIN(sourceColor, sourceAlpha); |
Alpha.hSets the color channel of each pixel in a Planar8 image to the smaller of two values—either the color channel or the alpha value for that pixel.
vImage_Error vImageClipToAlpha_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for alpha values of the source image. The planar source image does not contain its own alpha information, so you must supply the alpha information.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
For each pixel:
alpha_result = sourceAlpha; |
color_result = MIN(sourceColor, sourceAlpha); |
Alpha.hSets the color channel of each pixel in a PlanarF image to the smaller of two values—either the color channel or the alpha value for that pixel.
vImage_Error vImageClipToAlpha_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the source image.
A pointer to a vImage buffer structure that contains data for alpha values of the source image. The planar source image does not contain its own alpha information, so you must supply the alpha information.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
For each pixel:
alpha_result = sourceAlpha; |
color_result = MIN(sourceColor, sourceAlpha); |
Alpha.hPerforms premultiplied alpha compositing of two ARGB8888 images, placing the result in a destination buffer.
vImage_Error vImagePremultipliedAlphaBlend_ARGB8888 ( const vImage_Buffer *srcTop, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hPerforms premultiplied alpha compositing of two ARGBFFFF images, placing the result in a destination buffer.
vImage_Error vImagePremultipliedAlphaBlend_ARGBFFFF ( const vImage_Buffer *srcTop, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hPerforms premultiplied alpha compositing of two Planar8 images, placing the result in a destination buffer.
vImage_Error vImagePremultipliedAlphaBlend_Planar8 ( const vImage_Buffer *srcTop, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image. Even though the alpha values are already premultiplied into the pixel values, the function also requires the original alpha information for the top image to do its calculations. There is no way to extract this information from the premultiplied planar values, so you must provide it.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hPerforms premultiplied alpha compositing of two PlanarF images, placing the result in a destination buffer.
vImage_Error vImagePremultipliedAlphaBlend_PlanarF ( const vImage_Buffer *srcTop, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image. Even though the alpha values are already premultiplied into the pixel values, the function also requires the original alpha information for the top image to do its calculations. There is no way to extract this information from the premultiplied planar values, so you must provide it.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
Alpha.hPerforms premultiplied alpha compositing of two ARGB8888 images, using a single alpha value for the whole image and placing the result in a destination buffer.
vImage_Error vImagePremultipliedConstAlphaBlend_ARGB8888 ( const vImage_Buffer *srcTop, Pixel_8 constAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
The alpha value you want to apply to the image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hPerforms premultiplied alpha compositing of two ARGBFFFF images, using a single alpha value for the whole image and placing the result in a destination buffer.
vImage_Error vImagePremultipliedConstAlphaBlend_ARGBFFFF ( const vImage_Buffer *srcTop, Pixel_F constAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
The alpha value you want to apply to the image.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hPerforms premultiplied alpha compositing of two Planar8 images, using a single alpha value for the entire image and placing the result in a destination buffer.
vImage_Error vImagePremultipliedConstAlphaBlend_Planar8 ( const vImage_Buffer *srcTop, Pixel_8 constAlpha, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
The alpha value you want to apply to the image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image. Even though the alpha values are already premultiplied into the pixel values, the function also requires the original alpha information for the top image to do its calculations. There is no way to extract this information from the premultiplied planar values, so you must provide it.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hPerforms premultiplied alpha compositing of a two PlanarF images, using a single alpha value for the whole image and placing the result in a destination buffer.
vImage_Error vImagePremultipliedConstAlphaBlend_PlanarF ( const vImage_Buffer *srcTop, Pixel_F constAlpha, const vImage_Buffer *srcTopAlpha, const vImage_Buffer *srcBottom, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains data for the top source image.
The alpha value you want to apply to the image.
A pointer to a vImage buffer structure that contains data for the alpha values of the top source image. Even though the alpha values are already premultiplied into the pixel values, the function also requires the original alpha information for the top image to do its calculations. There is no way to extract this information from the premultiplied planar values, so you must provide it.
A pointer to a vImage buffer structure that contains data for the bottom source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
The vImage buffer structures for the source and destination images must use the same height and width.
Alpha.hTakes an ARGB8888 image in nonpremultiplied alpha format and transforms it into an image in premultiplied alpha format.
vImage_Error vImagePremultiplyData_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.hTakes an ARGBFFFF image in nonpremultiplied alpha format and transforms it into an image in premultiplied alpha format.
vImage_Error vImagePremultiplyData_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.hTakes a Planar8 image in nonpremultiplied alpha format, along with alpha information, and transforms it into an image in premultiplied alpha format.
vImage_Error vImagePremultiplyData_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer structure that contains data for alpha values of the source image. The planar source image does not contain its own alpha information, so you must supply the alpha information.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
Alpha.hTakes a PlanarF image in nonpremultiplied alpha format, along with alpha information, and transforms it into an image in premultiplied alpha format.
vImage_Error vImagePremultiplyData_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer structure that contains data for alpha values of the source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
Alpha.hTakes an RGBA8888 image in nonpremultiplied alpha format and transforms it into an image in premultiplied alpha format.
vImage_Error vImagePremultiplyData_RGBA8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.hTakes an RGBAFFFF image in nonpremultiplied alpha format and transforms it into an image in premultiplied alpha format.
vImage_Error vImagePremultiplyData_RGBAFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.h Takes an ARGB8888 image in premultiplied alpha format and transforms it into an image in nonpremultiplied alpha format.
vImage_Error vImageUnpremultiplyData_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.h Takes an ARGBFFFF image in premultiplied alpha format and transforms it into an image in nonpremultiplied alpha format.
vImage_Error vImageUnpremultiplyData_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.h Takes a Planar8 image in premultiplied alpha format, along with alpha information, and transforms it into an image in nonpremultiplied alpha format.
vImage_Error vImageUnpremultiplyData_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the premultiplied data for the source image.]
A pointer to a vImage buffer structure that contains data for alpha values of the source image. The planar source image does not contain its own alpha information, so you must supply the alpha information.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
Alpha.h Takes a PlanarF image in premultiplied alpha format, along with alpha information, and transforms it into an image in nonpremultiplied alpha format.
vImage_Error vImageUnpremultiplyData_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *alpha, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the premultiplied data for the source image.]
A pointer to a vImage buffer structure that contains data for alpha values of the source image. The planar source image does not contain its own alpha information, so you must supply the alpha information.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
Alpha.hTakes an RGBA8888 image in premultiplied alpha format and transforms it into an image in nonpremultiplied alpha format.
vImage_Error vImageUnpremultiplyData_RGBA8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the premultiplied data for the source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise one of the error codes described in vImage Data Types and Constants Reference.
This function gets the required alpha information from the alpha channel of the original image. The alpha channel is copied over unchanged to the destination image.
Alpha.hTakes an RGBAFFFF image in premultiplied alpha format and transforms it into an image in nonpremultiplied alpha format.
vImage_Error vImageUnpremultiplyData_RGBAFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the nonpremultiplied data for the top source image.
A pointer to a vImage buffer data structure. You are 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 pointed to by this structure contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.
The options to use when performing the compositing. Pass kvImageDoNotTile if you plan to perform your own tiling or use multithreading.