| Framework | Accelerate/vImage |
| Companion guide | |
| Declared in | Geometry.h |
Geometric functions rotate, resize, and distort the geometry of images. vImage provides both high-level (rotation, scaling, and warping) and low-level geometric functions (reflection, shearing, and low-level rotation).
Most vImage geometric functions resample image data to avoid creating artifacts, such as interference patterns, in the destination image. vImage uses resampling kernels, which combine data from a target pixel and other nearby pixels to calculate a value for the destination pixel, a procedure somewhat similar to that used for convolution. However, for geometric operations, the resampling kernel itself is resampled during the process of pairing kernel values against the sampled pixel data. The kernel is evaluated at both fractional and integral pixel locations. This has implications for the nature of the kernel—which must be supplied as a function rather than as an M by N matrix. A resampling kernel function is also called a resampling filter, or simply a filter.
For almost all geometric operations, vImage supplies a default resampling filter unless you set the flag kvImageHighQualityResampling, in which case vImage uses a higher-quality filter, but that filter may be slower to use.
The reflection and high-level rotation functions don’t resample. The shear functions can either use a default resampling filter or, if you require more control, a custom filter that you provide.
vImageAffineWarp_ARGBFFFF
vImageAffineWarp_ARGB8888
vImageAffineWarp_PlanarF
vImageAffineWarp_Planar8
vImageHorizontalReflect_ARGBFFFF
vImageHorizontalReflect_PlanarF
vImageHorizontalReflect_Planar8
vImageHorizontalReflect_ARGB8888
vImageVerticalReflect_ARGBFFFF
vImageVerticalReflect_ARGB8888
vImageVerticalReflect_PlanarF
vImageVerticalReflect_Planar8
vImageHorizontalShear_ARGBFFFF
vImageHorizontalShear_ARGB8888
vImageHorizontalShear_PlanarF
vImageHorizontalShear_Planar8
vImageVerticalShear_ARGBFFFF
vImageVerticalShear_ARGB8888
vImageVerticalShear_PlanarF
vImageVerticalShear_Planar8
vImageRotate90_ARGBFFFF
vImageRotate90_ARGB8888
vImageRotate90_PlanarF
vImageRotate90_Planar8
vImageRotate_ARGBFFFF
vImageRotate_ARGB8888
vImageRotate_PlanarF
vImageRotate_Planar8
vImageDestroyResamplingFilter
vImageGetResamplingFilterSize
vImageNewResamplingFilter
vImageNewResamplingFilterForFunctionUsingBuffer
Applies an affine transform to an ARGB8888 source image.
vImage_Error vImageAffineWarp_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, Pixel_8888 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
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.
A pointer to a temporary buffer. If you pass NULL, the function allocates the buffer, then deallocates it before returning. Alternatively, you can allocate the buffer yourself, in which case you are responsible for deallocating it when you is no longer need it.
If you want to allocate the buffer yourself, see the Discussion for information on how to determine the minimum size that you must allocate.
The affine transformation matrix to apply to the source image.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when applying the transform. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps each pixel in the source image [x, y] to a new position [x’, y’] in the destination image by the formula:
(x', y') = (x, y) * transform |
where transform is the 3x3 affine transformation matrix.
If you want to allocate the memory for the tempBuffer parameter yourself, call this function twice, as follows:
To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which should be a positive value. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.
After you allocate enough space for a buffer of the returned size, call the function a second time, passing a valid pointer in the tempBuffer parameter. This time, do not pass the kvImageGetTempBufferSize flag.
Geometry.hApplies an affine transform to an ARGBFFFF source image.
vImage_Error vImageAffineWarp_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, Pixel_FFFF backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
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.
A pointer to a temporary buffer. If you pass NULL, the function allocates the buffer, then deallocates it before returning. Alternatively, you can allocate the buffer yourself, in which case you are responsible for deallocating it when you is no longer need it.
If you want to allocate the buffer yourself, see the Discussion for information on how to determine the minimum size that you must allocate.
The affine transformation matrix to apply to the source image.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when applying the transform. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps each pixel in the source image [x, y] to a new position [x’, y’] in the destination image by the formula:
(x', y') = (x, y) * transform |
where transform is the 3x3 affine transformation matrix.
If you want to allocate the memory for the tempBuffer parameter yourself, call this function twice, as follows:
To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which should be a positive value. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.
After you allocate enough space for a buffer of the returned size, call the function a second time, passing a valid pointer in the tempBuffer parameter. This time, do not pass the kvImageGetTempBufferSize flag.
Geometry.hApplies an affine transform to a Planar8 source image.
vImage_Error vImageAffineWarp_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, Pixel_8 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
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.
A pointer to a temporary buffer. If you pass NULL, the function allocates the buffer, then deallocates it before returning. Alternatively, you can allocate the buffer yourself, in which case you are responsible for deallocating it when you is no longer need it.
If you want to allocate the buffer yourself, see the Discussion for information on how to determine the minimum size that you must allocate.
The affine transformation matrix to apply to the source image.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when applying the transform. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps each pixel in the source image [x, y] to a new position [x’, y’] in the destination image by the formula:
(x', y') = (x, y) * transform |
where transform is the 3x3 affine transformation matrix.
If you want to allocate the memory for the tempBuffer parameter yourself, call this function twice, as follows:
To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which should be a positive value. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.
After you allocate enough space for a buffer of the returned size, call the function a second time, passing a valid pointer in the tempBuffer parameter. This time, do not pass the kvImageGetTempBufferSize flag.
Geometry.hApplies an affine transform to a PlanarF source image.
vImage_Error vImageAffineWarp_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform *transform, Pixel_F backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
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.
A pointer to a temporary buffer. If you pass NULL, the function allocates the buffer, then deallocates it before returning. Alternatively, you can allocate the buffer yourself, in which case you are responsible for deallocating it when you is no longer need it.
If you want to allocate the buffer yourself, see the Discussion for information on how to determine the minimum size that you must allocate.
The affine transformation matrix to apply to the source image.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when applying the transform. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps each pixel in the source image [x, y] to a new position [x’, y’] in the destination image by the formula:
(x', y') = (x, y) * transform |
where transform is the 3x3 affine transformation matrix.
If you want to allocate the memory for the tempBuffer parameter yourself, call this function twice, as follows:
To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which should be a positive value. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.
After you allocate enough space for a buffer of the returned size, call the function a second time, passing a valid pointer in the tempBuffer parameter. This time, do not pass the kvImageGetTempBufferSize flag.
Geometry.hDisposes of a resampling filter object.
void vImageDestroyResamplingFilter ( ResamplingFilter filter );
The resampling filter object to dispose of.
This function deallocates the memory associated with a resampling filter object that was created by calling the function vImageNewResamplingFilter. Do not directly deallocate this memory yourself.
Do not pass this function a resampling filter object created by the function vImageNewResamplingFilterForFunctionUsingBuffer. You are responsible for deallocating the memory associated with resampling filter objects created by that call yourself.
Geometry.hReturns the minimum size, in bytes, for the temporary buffer needed by a high-level geometry function. (Deprecated. Use the kvImageGetTempBufferSize flag with the appropriate geometry function instead of calling this function.)
size_t vImageGetMinimumGeometryTempBufferSize ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags, size_t bytesPerPixel );
A pointer to a vImage buffer structure that you plan to pass to the geometry function.
A pointer to a vImage buffer structure that you plan to pass to the geometry function. You must set the fields of this structure yourself, and allocate memory for its data. When you are done with the buffer structure, you must deallocate the memory.
The flags that you plan to pass to the geometry function.
The number of bytes in a pixel. Make sure to pass the value appropriate for the format of the pixel.
The minimum size, in bytes, of the temporary buffer.
This function does not depend on the data or rowBytes fields of the src or dest parameters; it only uses the height and width fields from those parameters. If the size of the images you are processing stay the same, then the required size of the buffer will also stay the same. More specifically, if, between two calls to vImageGetMinimumGeometryTempBufferSize, the height and width of the src and dest parameters do not increase, and the and the other parameters remain the same, then the result of the vImageGetMinimumGeometryTempBufferSize will not increase. This makes it easy to reuse the same temporary buffer when you are processing a number of images of the same size, as in tiling.
Geometry.hReturns the minimum size, in bytes, for the buffer needed by the function vImageNewResamplingFilterForFunctionUsingBuffer.
size_t vImageGetResamplingFilterSize ( const float *xArray, float *yArray, unsigned long count, void *userData );
The scale factor that you plan to pass to the function vImageNewResamplingFilterForFunctionUsingBuffer.
The function pointer that you plan to pass to the function vImageNewResamplingFilterForFunctionUsingBuffer.
The user data pointer that you plan to pass to the function vImageNewResamplingFilterForFunctionUsingBuffer.
The kernel width that you plan to pass to the function vImageNewResamplingFilterForFunctionUsingBuffer.
The flags that you plan to pass to the function vImageNewResamplingFilterForFunctionUsingBuffer.
The minimum size, in bytes, of the buffer.
Geometry.hReflects an ARGB8888 source image left to right across the center vertical line of the image.
vImage_Error vImageHorizontalReflect_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
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 reflection. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Geometry.hReflects an ARGBFFFF source image left to right across the center vertical line of the image.
vImage_Error vImageHorizontalReflect_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
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 reflection. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Geometry.hReflects a Planar9 source image left to right across the center vertical line of the image.
vImage_Error vImageHorizontalReflect_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
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 reflection. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Geometry.hReflects a PlanarF source image left to right across the center vertical line of the image, placing the result in a destination buffer.
vImage_Error vImageHorizontalReflect_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
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 reflection. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Geometry.hPerforms a horizontal shear operation on a region of interest of an ARGB8888 source image.
vImage_Error vImageHorizontalShear_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_8888 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
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.
This parameter also specifies the size of the region of interest in within the source image. The region of interest has the same height and width as the destination image buffer.
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
A translation value for the horizontal direction.
The slope of the front edge of the sheared image, measured in a clockwise direction.
The resampling filter to be used with this function. You create this object by calling vImageNewResamplingFilter (to use a default resampling filter supplied by vImage) or vImageNewResamplingFilterForFunctionUsingBuffer (to use a custom resampling filter that you supply). When the resampling filter is created, you can also set a scale factor that will be used in the horizontal shear operation.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when performing the shear. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
The kvImageBackgroundColorFill and kvImageEdgeExtend flags are mutually exclusive. You must set exactly one of these flags.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function also translates and scales the image, both in the horizontal direction. The function transforms as much of the source image as it needs in order to attempt to fill the destination buffer, which means it can transform pixels outside the region of interest.
Geometry.hPerforms a horizontal shear operation on a region of interest of an ARGBFFFF source image.
vImage_Error vImageHorizontalShear_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_FFFF backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
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.
This parameter also specifies the size of the region of interest in within the source image. The region of interest has the same height and width as the destination image buffer.
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
A translation value for the horizontal direction.
The slope of the front edge of the sheared image, measured in a clockwise direction.
The resampling filter to be used with this function. You create this object by calling vImageNewResamplingFilter (to use a default resampling filter supplied by vImage) or vImageNewResamplingFilterForFunctionUsingBuffer (to use a custom resampling filter that you supply). When the resampling filter is created, you can also set a scale factor that will be used in the horizontal shear operation.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when performing the shear. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
The kvImageBackgroundColorFill and kvImageEdgeExtend flags are mutually exclusive. You must set exactly one of these flags.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function also translates and scales the image, both in the horizontal direction. The function transforms as much of the source image as it needs in order to attempt to fill the destination buffer, which means it can transform pixels outside the region of interest.
Geometry.hPerforms a horizontal shear operation on a region of interest of a Planar8 source image.
vImage_Error vImageHorizontalShear_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
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.
This parameter also specifies the size of the region of interest in within the source image. The region of interest has the same height and width as the destination image buffer.
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
A translation value for the horizontal direction.
The slope of the front edge of the sheared image, measured in a clockwise direction.
The resampling filter to be used with this function. You create this object by calling vImageNewResamplingFilter (to use a default resampling filter supplied by vImage) or vImageNewResamplingFilterForFunctionUsingBuffer (to use a custom resampling filter that you supply). When the resampling filter is created, you can also set a scale factor that will be used in the horizontal shear operation.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when performing the shear. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
The kvImageBackgroundColorFill and kvImageEdgeExtend flags are mutually exclusive. You must set exactly one of these flags.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function also translates and scales the image, both in the horizontal direction. The function transforms as much of the source image as it needs in order to attempt to fill the destination buffer, which means it can transform pixels outside the region of interest.
Geometry.hPerforms a horizontal shear operation on a region of interest of a PlanarF source image.
vImage_Error vImageHorizontalShear_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float xTranslate, float shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
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.
This parameter also specifies the size of the region of interest in within the source image. The region of interest has the same height and width as the destination image buffer.
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
A translation value for the horizontal direction.
The slope of the front edge of the sheared image, measured in a clockwise direction.
The resampling filter to be used with this function. You create this object by calling vImageNewResamplingFilter (to use a default resampling filter supplied by vImage) or vImageNewResamplingFilterForFunctionUsingBuffer (to use a custom resampling filter that you supply). When the resampling filter is created, you can also set a scale factor that will be used in the horizontal shear operation.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when performing the shear. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
The kvImageBackgroundColorFill and kvImageEdgeExtend flags are mutually exclusive. You must set exactly one of these flags.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function also translates and scales the image, both in the horizontal direction. The function transforms as much of the source image as it needs in order to attempt to fill the destination buffer, which means it can transform pixels outside the region of interest.
Geometry.hCreates a resampling filter object that corresponds to the default kernel supplied by the vImage framework.
ResamplingFilter vImageNewResamplingFilter ( float scale, vImage_Flags flags );
A scale factor to associated with the resampling filter object. Shear functions to which you pass the resampling filter object use this factor when performing a shear operation. The shear function applies the scale factor to the entire image, in a direction appropriate to the shear function, either horizontal or vertical.
The options to use when creating the resampling filter object. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
A pointer to a newly created resampling filter object; otherwise NULL.
This function creates a reusable resampling filter object that you can pass to a shear function. The resampling filter encapsulated by the object is the default kernel for vImage This function allocates the memory needed for the resampling filter object. To deallocate this memory, call the function vImageDestroyResamplingFilter. Do not attempt to deallocate the memory yourself.
Geometry.hCreates a resampling filter object that encapsulates a resampling kernel function that you provide.
vImage_Error vImageNewResamplingFilterForFunctionUsingBuffer ( const float *xArray, float *yArray, unsigned long count, void *userData );
A pointer to a buffer. On return, the buffer contains a resampling filter object. You must allocate the memory for this buffer yourself. Call the function vImageGetResamplingFilterSize to obtain the size of this buffer.
A scale factor to associated with the resampling filter object. Shear functions to which you pass the resampling filter object use this factor when performing a shear operation. The shear function applies the scale factor to the entire image, in a direction appropriate to the shear function, either horizontal or vertical.
A pointer to your custom resampling kernel function. If this pointer is NULL, vImage creates a resampling filter object that corresponds to its default kernel. The kernel function must remain valid for the life of the resampling filter object.
If you need precise control over the memory used for a resampling filter object but want to use the default, pass NULL as the kernelFunc parameter. This causes vImage to create a resampling filter object that corresponds to its default kernel. You can then determine where in memory the resampling filter object is located. You can reuse the buffer to reduce memory allocation, and so on. Note that a resampling filter object created in this way is not necessarily the same as one created by the function vImageNewResamplingFilter. You must still deallocate the object yourself; you can not pass it to the function vImageDestroyResamplingFilter.
A bounding value for the domain of your resampling kernel function. When your function is called, the x-values it will be passed will lie between –kernelWidth and +kernelWidth, inclusive.
A pointer to custom data that you want to use when calculating your resampling kernel function. When vImage invokes your resampling kernel function, this pointer is passed to the function. The data can be anything you want to use in calculating your resampling kernel function—a table, a list of pointers to related functions, or so on. The data must remain valid for the life of the resampling kernel object.
If your resampling kernel function does nor require user data, pass NULL.
The options to use when creating the resampling filter object. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function creates a reusable resampling filter object that you can pass to a shear function. Before calling this function, you must allocate a buffer to contain the resampling filter object returned by this function. You can get the necessary size by calling the function vImageGetResamplingFilterSize. When you no longer need this object, you are responsible for deallocating its memory. (Do not use the function vImageDestroyResamplingFilter to deallocate custom resampling filter objects; it is not designed to deallocate them.)
If you need precise control over the memory used for a resampling filter object but want to use the default, pass NULL as the kernelFunc parameter. This causes vImage to create a resampling filter object that corresponds to its default kernel. You can then determine where in memory the resampling filter object is located. You can reuse the buffer to reduce memory allocation, and so on. Note that a resampling filter object created in this way is not necessarily the same as one created by the function vImageNewResamplingFilter. You must still deallocate the object yourself; you can not pass it to the function vImageDestroyResamplingFilter.
Geometry.hRotates an ARGB8888 source image by the provided factor of 90.
vImage_Error vImageRotate90_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_8888 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
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.
A value specifying the angle of rotation.
A background color.
The options to use when performing the rotation. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps the center point of the source image to the center point of the destination image. It does not scale or resample, instead, the function copies individual pixels unchanged to new locations.
This function places certain restrictions on the pixel height and widths of the source and destination buffers, so that it can map the center of the source to the center of the destination precisely. The restrictions are:
If you are 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; and the width of the source image and the height of the destination image must both be even or both be odd.
If your images do not 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 the background color passed to the function.
Geometry.hRotates an ARGBFFFF source image by the provided factor of 90.
vImage_Error vImageRotate90_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_FFFF backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
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.
A value specifying the angle of rotation.
A background color.
The options to use when performing the rotation. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps the center point of the source image to the center point of the destination image. It does not scale or resample, instead, the function copies individual pixels unchanged to new locations.
This function places certain restrictions on the pixel height and widths of the source and destination buffers, so that it can map the center of the source to the center of the destination precisely. The restrictions are:
If you are 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; and the width of the source image and the height of the destination image must both be even or both be odd.
If your images do not 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 the background color passed to the function.
Geometry.hRotates a Planar8 source image by the provided factor of 90.
vImage_Error vImageRotate90_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_8 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
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.
A value specifying the angle of rotation.
A background color.
The options to use when performing the rotation. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps the center point of the source image to the center point of the destination image. It does not scale or resample, instead, the function copies individual pixels unchanged to new locations.
This function places certain restrictions on the pixel height and widths of the source and destination buffers, so that it can map the center of the source to the center of the destination precisely. The restrictions are:
If you are 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; and the width of the source image and the height of the destination image must both be even or both be odd.
If your images do not 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 the background color passed to the function.
Geometry.hRotates a PlanarF source image by the provided factor of 90.
vImage_Error vImageRotate90_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, uint8_t rotationConstant, Pixel_F backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
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.
A value specifying the angle of rotation.
A background color.
The options to use when performing the rotation. Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps the center point of the source image to the center point of the destination image. It does not scale or resample, instead, the function copies individual pixels unchanged to new locations.
This function places certain restrictions on the pixel height and widths of the source and destination buffers, so that it can map the center of the source to the center of the destination precisely. The restrictions are:
If you are 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; and the width of the source image and the height of the destination image must both be even or both be odd.
If your images do not 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 the background color passed to the function.
Geometry.hRotates an ARGB8888 source image by the provided angle.
vImage_Error vImageRotate_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, Pixel_8888 backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
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.
A pointer to a temporary buffer. If you pass NULL, the function allocates the buffer, then deallocates it before returning. Alternatively, you can allocate the buffer yourself, in which case you are responsible for deallocating it when you is no longer need it.
If you want to allocate the buffer yourself, see the Discussion for information on how to determine the minimum size that you must allocate.
The angle of rotation, in radians.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when applying the rotation. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or kvImageEdgeExtend.
Set the kvImageHighQualityResampling flag if you want vImage to use a higher quality, but slower, resampling filter.
Set the kvImageDoNotTile flag if you plan to perform your own tiling or use multithreading.
This function ignores the kvImageLeaveAlphaUnchanged flag.
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
This function maps the center point of the source image to the center point of the destination image. It does not scale, but it resamples. 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 the background color passed to the function.
If you want to allocate the memory for the tempBuffer parameter yourself, call this function twice, as follows:
To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which should be a positive value. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.
After you allocate enough space for a buffer of the returned size, call the function a second time, passing a valid pointer in the tempBuffer parameter. This time, do not pass the kvImageGetTempBufferSize flag.
Geometry.hRotates an ARGBFFFF source image by the provided angle.
vImage_Error vImageRotate_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, Pixel_FFFF backColor, vImage_Flags flags );
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
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.
A pointer to a temporary buffer. If you pass NULL, the function allocates the buffer, then deallocates it before returning. Alternatively, you can allocate the buffer yourself, in which case you are responsible for deallocating it when you is no longer need it.
If you want to allocate the buffer yourself, see the Discussion for information on how to determine the minimum size that you must allocate.
The angle of rotation, in radians.
A background color. Pass a pixel value only if you also set the kvImageBackgroundColorFill flag.
The options to use when applying the rotation. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image: kvImageBackgroundColorFill or