Performs a horizontal shear operation on a region of interest within a PlanarF source image.
SDKs
- iOS 6.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Accelerate
Declaration
func vImageHorizontalShearD_PlanarF(_ src: Unsafe Pointer<v Image _Buffer>, _ dest: Unsafe Pointer<v Image _Buffer>, _ srcOffsetToROI_X: v Image Pixel Count, _ srcOffsetToROI_Y: v Image Pixel Count, _ xTranslate: Double, _ shearSlope: Double, _ filter: Resampling Filter!, _ backColor: Pixel _F, _ flags: v Image _Flags) -> v Image _Error
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're responsible for filling out the
height
,width
, androw
fields of this structure, and for allocating a data buffer of the appropriate size. On return, the data buffer this structure points to contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.Bytes This parameter also specifies the size of the region of interest 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, from the upper-left pixel of the region of interest within the source image.
srcOffsetToROI_Y
The vertical offset, in pixels, from 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
v
(to use a default resampling filter supplied by vImage) orImage New Resampling Filter(_: _:) v
(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.Image New Resampling Filter For Function Using Buffer backColor
A background color. Pass a pixel value only if you also set the
kv
flag.Image Background Color Fill flags
The options to use when applying the shear.
To specify how vImage handles pixel locations beyond the edge of the source image, you must set exactly one of the following flags:
kv
orImage Background Color Fill kv
.Image Edge Extend If you want vImage to use a higher quality, but slower resampling filter, set the
kv
flag.Image High Quality Resampling If you plan to perform your own tiling or use multithreading, set the
kv
flag.Image Do Not Tile
Return Value
kv
; otherwise, one of the error codes described in Data Types and Constants.
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.