vImage Geometry Reference
| Framework | Accelerate/vImage |
| Companion guide | |
| Declared in | Geometry.h |
Overview
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.
Functions by Task
Applying Affine Transforms
-
vImageAffineWarp_ARGBFFFF -
vImageAffineWarp_ARGB8888 -
vImageAffineWarp_PlanarF -
vImageAffineWarp_Planar8 -
vImageAffineWarpCG_ARGB8888 -
vImageAffineWarpCG_ARGBFFFF -
vImageAffineWarpCG_Planar8 -
vImageAffineWarpCG_PlanarF -
vImageAffineWarpD_ARGB8888 -
vImageAffineWarpD_ARGBFFFF -
vImageAffineWarpD_Planar8 -
vImageAffineWarpD_PlanarF
Reflecting Horizontally
-
vImageHorizontalReflect_ARGBFFFF -
vImageHorizontalReflect_PlanarF -
vImageHorizontalReflect_Planar8 -
vImageHorizontalReflect_ARGB8888
Reflecting Vertically
The vertical reflect functions are provided primarily for out-of-place vertical reflect operations on images or for in-place reflection of image sub-regions. In-place vertical reflection of entire images can be slower. However, such operations can be performed far more quickly by adjusting the vImage_Buffer.data and .rowBytes fields in the vImage_buffer struct as in the following example:
Listing 1 Performing vertical reflection by adjusting image buffer data and row bytes
// The following function is image-format agnostic |
void MyFastVerticalReflect( vImage_Buffer *buf ) |
{ |
// Point to the last scanline |
buf->data += |
(buf->height - 1) * buf->rowBytes; |
// Make rowBytes negative |
buf->rowBytes = -buf->rowBytes; |
} |
-
vImageVerticalReflect_ARGBFFFF -
vImageVerticalReflect_ARGB8888 -
vImageVerticalReflect_PlanarF -
vImageVerticalReflect_Planar8
Shearing
-
vImageHorizontalShear_ARGBFFFF -
vImageHorizontalShear_ARGB8888 -
vImageHorizontalShear_PlanarF -
vImageHorizontalShear_Planar8 -
vImageVerticalShear_ARGBFFFF -
vImageVerticalShear_ARGB8888 -
vImageVerticalShear_PlanarF -
vImageVerticalShear_Planar8 -
vImageHorizontalShearD_ARGB8888 -
vImageHorizontalShearD_ARGBFFFF -
vImageHorizontalShearD_Planar8 -
vImageHorizontalShearD_PlanarF -
vImageVerticalShearD_ARGB8888 -
vImageVerticalShearD_ARGBFFFF -
vImageVerticalShearD_Planar8 -
vImageVerticalShearD_PlanarF
Rotating
-
vImageRotate90_ARGBFFFF -
vImageRotate90_ARGB8888 -
vImageRotate90_PlanarF -
vImageRotate90_Planar8 -
vImageRotate_ARGBFFFF -
vImageRotate_ARGB8888 -
vImageRotate_PlanarF -
vImageRotate_Planar8
Scaling
Resampling
Functions
vImageAffineWarpCG_ARGB8888
Applies an affine transform to an ARGB8888 source image.
vImage_Error vImageAffineWarpCG_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, Pixel_8888 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
Core Graphics types use float values in 32-bit and double values in 64-bit. This convenience method takes the Core Graphics affine transform type directly so that you don’t have to use a different function for 64-bit applications.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 6.0 and later.
Declared In
Geometry.hvImageAffineWarpCG_ARGBFFFF
Applies an affine transform to an ARGBFFFF source image.
vImage_Error vImageAffineWarpCG_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, Pixel_FFFF backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
Core Graphics types use float values in 32-bit and double values in 64-bit. This convenience method takes the Core Graphics affine transform type directly so that you don’t have to use a different function for 64-bit applications.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 6.0 and later.
Declared In
Geometry.hvImageAffineWarpCG_Planar8
Applies a Core Graphics affine transform to a Planar8 source image.
vImage_Error vImageAffineWarpCG_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, Pixel_8 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
Core Graphics types use float values in 32-bit and double values in 64-bit. This convenience method takes the Core Graphics affine transform type directly so that you don’t have to use a different function for 64-bit applications.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 6.0 and later.
Declared In
Geometry.hvImageAffineWarpCG_PlanarF
Applies an affine transform to a PlanarF source image.
vImage_Error vImageAffineWarpCG_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_CGAffineTransform *transform, Pixel_F backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
Core Graphics types use float values in 32-bit and double values in 64-bit. This convenience method takes the Core Graphics affine transform type directly so that you don’t have to use a different function for 64-bit applications.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 6.0 and later.
Declared In
Geometry.hvImageAffineWarpD_ARGB8888
Applies a double-precision affine transform to an ARGB8888 source image.
vImage_Error vImageAffineWarpD_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, Pixel_8888 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarpD_ARGBFFFF
Applies a double-precision affine transform to an ARGBFFFF source image.
vImage_Error vImageAffineWarpD_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, Pixel_FFFF backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarpD_Planar8
Applies a double-precision affine transform to a Planar8 source image.
vImage_Error vImageAffineWarpD_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, Pixel_8 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarpD_PlanarF
Applies a double-precision affine transform to a PlanarF source image.
vImage_Error vImageAffineWarpD_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, const vImage_AffineTransform_Double *transform, Pixel_F backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarp_ARGB8888
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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarp_ARGBFFFF
Applies 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarp_Planar8
Applies 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageAffineWarp_PlanarF
Applies 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to transform.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- transform
The affine transformation matrix to apply to the source image.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageDestroyResamplingFilter
Disposes of a resampling filter object.
void vImageDestroyResamplingFilter ( ResamplingFilter filter );
Parameters
- filter
The resampling filter object to dispose of.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageGetResamplingFilterSize
Returns the minimum size, in bytes, for the buffer needed by the function vImageNewResamplingFilterForFunctionUsingBuffer.
size_t vImageGetResamplingFilterSize ( float scale, void (*kernelFunc)( const float *xArray, float *yArray, unsigned long count, void *userData ), float kernelWidth, vImage_Flags flags );
Parameters
- scale
The scale factor that you plan to pass to the function
vImageNewResamplingFilterForFunctionUsingBuffer.- kernelFunc
The function pointer that you plan to pass to the function
vImageNewResamplingFilterForFunctionUsingBuffer.- userData
The user data pointer that you plan to pass to the function
vImageNewResamplingFilterForFunctionUsingBuffer.- kernelWidth
The kernel width that you plan to pass to the function
vImageNewResamplingFilterForFunctionUsingBuffer.- flags
The flags that you plan to pass to the function
vImageNewResamplingFilterForFunctionUsingBuffer.
Return Value
The minimum size, in bytes, of the buffer.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalReflect_ARGB8888
Reflects 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalReflect_ARGBFFFF
Reflects 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalReflect_Planar8
Reflects 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalReflect_PlanarF
Reflects 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShearD_ARGB8888
Performs a double-precision horizontal shear operation on a region of interest of an ARGB8888 source image.
vImage_Error vImageHorizontalShearD_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, Pixel_8888 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShearD_ARGBFFFF
Performs a double-precision horizontal shear operation on a region of interest of an ARGBFFFF source image.
vImage_Error vImageHorizontalShearD_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, Pixel_FFFF backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShearD_Planar8
Performs a double-precision horizontal shear operation on a region of interest of a Planar8 source image.
vImage_Error vImageHorizontalShearD_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShearD_PlanarF
Performs a double-precision horizontal shear operation on a region of interest of a PlanarF source image.
vImage_Error vImageHorizontalShearD_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double xTranslate, double shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShear_ARGB8888
Performs 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShear_ARGBFFFF
Performs 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShear_Planar8
Performs 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageHorizontalShear_PlanarF
Performs 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- xTranslate
A translation value for the horizontal direction.
- shearSlope
The slope of the front edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageNewResamplingFilter
Creates a resampling filter object that corresponds to the default kernel supplied by the vImage framework.
ResamplingFilter vImageNewResamplingFilter ( float scale, vImage_Flags flags );
Parameters
- scale
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.
- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
A pointer to a newly created resampling filter object; otherwise NULL.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageNewResamplingFilterForFunctionUsingBuffer
Creates a resampling filter object that encapsulates a resampling kernel function that you provide.
vImage_Error vImageNewResamplingFilterForFunctionUsingBuffer ( ResamplingFilter filter, float scale, void (*kernelFunc)( const float *xArray, float *yArray, unsigned long count, void *userData ), float kernelWidth, void *userData, vImage_Flags flags );
Parameters
- filter
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
vImageGetResamplingFilterSizeto obtain the size of this buffer.- scale
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.
- kernelFunc
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
NULLas thekernelFuncparameter. 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 functionvImageNewResamplingFilter. You must still deallocate the object yourself; you can not pass it to the functionvImageDestroyResamplingFilter.- kernelWidth
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.
- userData
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.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate90_ARGB8888
Rotates 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- rotationConstant
A value specifying the angle of rotation.
- backgroundColor
A background color.
- flags
The options to use when performing the rotation. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate90_ARGBFFFF
Rotates 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- rotationConstant
A value specifying the angle of rotation.
- backgroundColor
A background color.
- flags
The options to use when performing the rotation. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate90_Planar8
Rotates 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- rotationConstant
A value specifying the angle of rotation.
- backgroundColor
A background color.
- flags
The options to use when performing the rotation. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate90_PlanarF
Rotates 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- rotationConstant
A value specifying the angle of rotation.
- backgroundColor
A background color.
- flags
The options to use when performing the rotation. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate_ARGB8888
Rotates 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- angleInRadians
The angle of rotation, in radians.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate_ARGBFFFF
Rotates 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 );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- angleInRadians
The angle of rotation, in radians.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate_Planar8
Rotates a Planar8 source image by the provided angle.
vImage_Error vImageRotate_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, Pixel_8 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- angleInRadians
The angle of rotation, in radians.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageRotate_PlanarF
Rotates a PlanarF source image by the provided angle.
vImage_Error vImageRotate_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, float angleInRadians, Pixel_F backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to rotate.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- angleInRadians
The angle of rotation, in radians.
- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageScale_ARGB8888
Scales an ARGB8888 source image to fit a destination buffer.
vImage_Error vImageScale_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to scale.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- flags
The options to use when applying the scaling. Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag. The function uses edge extend (seekvImageEdgeExtend) to assign values to pixels that are outside the source buffer. Edge extend prevents a background color from impinging on the edges of the scaled image.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The relative size of the source image and the destination buffer determine the scaling factors, which may be different in the X and Y directions.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageScale_ARGBFFFF
Scales an ARGBFFFF source image to fit a destination buffer.
vImage_Error vImageScale_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to scale.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- flags
The options to use when applying the scaling. You must set exactly one of the following flags to specify how vImage handles pixel locations beyond the edge of the source image:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The relative size of the source image and the destination buffer determine the scaling factors, which may be different in the X and Y directions.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageScale_Planar8
Scales a Planar8 source image to fit a destination buffer.
vImage_Error vImageScale_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to scale.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- flags
The options to use when applying the scaling. Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag. The function uses edge extend (seekvImageEdgeExtend) to assign values to pixels that are outside the source buffer. Edge extend prevents a background color from impinging on the edges of the scaled image.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The relative size of the source image and the destination buffer determine the scaling factors, which may be different in the X and Y directions.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageScale_PlanarF
Scales a PlanarF source image to fit a destination buffer.
vImage_Error vImageScale_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, void *tempBuffer, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to scale.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- tempBuffer
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.
- flags
The options to use when applying the scaling. Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.This function ignores the
kvImageLeaveAlphaUnchangedflag. The function uses edge extend (seekvImageEdgeExtend) to assign values to pixels that are outside the source buffer. Edge extend prevents a background color from impinging on the edges of the scaled image.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The relative size of the source image and the destination buffer determine the scaling factors, which may be different in the X and Y directions.
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
kvImageGetTempBufferSizeflag. 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.) ThekvImageGetTempBufferSizeflag 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
tempBufferparameter. This time, do not pass thekvImageGetTempBufferSizeflag.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalReflect_ARGB8888
Reflects an ARGBFFFF source image top to bottom across the center vertical line of the image.
vImage_Error vImageVerticalReflect_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The resulting image appears upside down, as if seen from the back of the image.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalReflect_ARGBFFFF
Reflects an ARGBFFFF source image top to bottom across the center vertical line of the image.
vImage_Error vImageVerticalReflect_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The resulting image appears upside down, as if seen from the back of the image.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalReflect_Planar8
Reflects a Planar 8 source image top to bottom across the center vertical line of the image.
vImage_Error vImageVerticalReflect_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to reflect.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The resulting image appears upside down, as if seen from the back of the image.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalReflect_PlanarF
Reflects a PlanarF source image top to bottom across the center vertical line of the image.
vImage_Error vImageVerticalReflect_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImage_Flags flags );
Parameters
- src
A pointer to a structure of type
vImage_Buffercontaining the source image.- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.- flags
The options to use when performing the reflection. Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
The resulting image appears upside down, as if seen from the back of the image.
This function does not scale or resample. The source and destination buffers must have the same height and the same width.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShearD_ARGB8888
Performs a double-precision vertical shear operation on a region of interest of an ARGB8888 source image.
vImage_Error vImageVerticalShearD_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, Pixel_8888 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShearD_ARGBFFFF
Performs a double-precision vertical shear operation on a region of interest of an ARGBFFFF source image.
vImage_Error vImageVerticalShearD_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, Pixel_FFFF backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShearD_Planar8
Performs a double-precision vertical shear operation on a region of interest of a Planar8 source image.
vImage_Error vImageVerticalShearD_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShearD_PlanarF
Performs a double-precision vertical shear operation on a region of interest of a PlanarF source image.
vImage_Error vImageVerticalShearD_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, double yTranslate, double shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShear_ARGB8888
Performs a vertical shear operation on a region of interest of an ARGB8888 source image.
vImage_Error vImageVerticalShear_ARGB8888 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_8888 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShear_ARGBFFFF
Performs a vertical shear operation on a region of interest of an ARGBFFFF source image.
vImage_Error vImageVerticalShear_ARGBFFFF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_FFFF backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShear_Planar8
Performs a vertical shear operation on a region of interest of a Planar8 source image.
vImage_Error vImageVerticalShear_Planar8 ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_8 backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hvImageVerticalShear_PlanarF
Performs a vertical shear operation on a region of interest of a PlanarF source image.
vImage_Error vImageVerticalShear_PlanarF ( const vImage_Buffer *src, const vImage_Buffer *dest, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float yTranslate, float shearSlope, ResamplingFilter filter, Pixel_F backColor, vImage_Flags flags );
Parameters
- src
A pointer to a vImage buffer structure that contains the source image whose data you want to shear.
- dest
A pointer to a vImage buffer data structure. You are responsible for filling out the
height,width, androwBytesfields 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.
- srcOffsetToROI_X
The horizontal offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- srcOffsetToROI_Y
The vertical offset, in pixels, to the upper-left pixel of the region of interest within the source image.
- yTranslate
A translation value for the vertical direction.
- shearSlope
The slope of the top edge of the sheared image, measured in a clockwise direction.
- filter
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) orvImageNewResamplingFilterForFunctionUsingBuffer(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.- backgroundColor
A background color. Pass a pixel value only if you also set the
kvImageBackgroundColorFillflag.- flags
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:
kvImageBackgroundColorFillorkvImageEdgeExtend.Set the
kvImageHighQualityResamplingflag if you want vImage to use a higher quality, but slower, resampling filter.Set the
kvImageDoNotTileflag if you plan to perform your own tiling or use multithreading.The
kvImageBackgroundColorFillandkvImageEdgeExtendflags are mutually exclusive. You must set exactly one of these flags.
Return Value
kvImageNoError, otherwise it returns one of the error codes described in vImage Data Types and Constants Reference.
Discussion
This function also translates and scales the image, both in the vertical 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.
Availability
- Available in iOS 5.0 and later.
Declared In
Geometry.hConstants
Rotation Constants
The number of degrees in the clockwise direction.
enum
{
kRotate0DegreesClockwise = 0,
kRotate90DegreesClockwise = 3,
kRotate180DegreesClockwise = 2,
kRotate270DegreesClockwise = 1
kRotate0DegreesCounterClockwise = 0,
kRotate90DegreesCounterClockwise= 1,
kRotate180DegreesCounterClockwise= 2,
kRotate270DegreesCounterClockwise= 3
};
Constants
kRotate0DegreesClockwiseRotate 0 degrees (that is, copy without rotating).
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate90DegreesClockwiseRotate 90 degrees clockwise.
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate180DegreesClockwiseRotate 180 degrees clockwise.
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate270DegreesClockwiseRotate 270 degrees clockwise.
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate0DegreesCounterClockwiseRotate 0 degrees (that is, copy without rotating).
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate90DegreesCounterClockwiseRotate 90 degrees counter-clockwise.
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate180DegreesCounterClockwiseRotate 180 degrees counter-clockwise.
Available in iOS 5.0 and later.
Declared in
Geometry.h.kRotate270DegreesCounterClockwiseRotate 270 degrees counter-clockwise.
Available in iOS 5.0 and later.
Declared in
Geometry.h.
Declared In
Geometry.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-12-13)