<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImageHorizontalShear_CbCr8(_:_:_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vImageHorizontalShear_CbCr8"
  },
  "title" : "vImageHorizontalShear_CbCr8(_:_:_:_:_:_:_:_:_:)"
}
-->

# vImageHorizontalShear_CbCr8(_:_:_:_:_:_:_:_:_:)

Performs a single-precision horizontal shear on a region of interest within an 8-bit-per-channel, 2-channel interleaved image.

```
func vImageHorizontalShear_CbCr8(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ srcOffsetToROI_X: vImagePixelCount, _ srcOffsetToROI_Y: vImagePixelCount, _ xTranslate: Float, _ shearSlope: Float, _ filter: ResamplingFilter!, _ backColor: UnsafePointer<UInt8>!, _ flags: vImage_Flags) -> vImage_Error
```

## Parameters

`src`

A pointer to a vImage buffer structure that contains the source image.

`dest`

A pointer to the destination vImage buffer structure. You’re responsible for filling out the `height`, `width`, and `rowBytes` fields of this structure and for allocating a data buffer of the appropriate size. On return, the data buffer this structure points to contains the destination image data. When you no longer need the data buffer, deallocate the memory to prevent memory leaks.

    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 that the function uses. For more information, see <doc://com.apple.documentation/documentation/Accelerate/reducing-artifacts-with-custom-resampling-filters>.

`backColor`

A background color. If you set the `kvImageBackgroundColorFill` flag, pass a pixel value.

`flags`

The options to use when applying the transform.

    To specify how vImage handles pixel locations beyond the edge of the source image, set one of the following flags: [`kvImageBackgroundColorFill`](/documentation/Accelerate/kvImageBackgroundColorFill)     or [`kvImageEdgeExtend`](/documentation/Accelerate/kvImageEdgeExtend)    .

    If you want vImage to use a higher quality but a slower resampling filter, set the [`kvImageHighQualityResampling`](/documentation/Accelerate/kvImageHighQualityResampling)     flag.

    If your code implements its own tiling or its own multithreading, pass [`kvImageDoNotTile`](/documentation/Accelerate/kvImageDoNotTile)    .

    This function ignores the [`kvImageLeaveAlphaUnchanged`](/documentation/Accelerate/kvImageLeaveAlphaUnchanged)     flag.

## Return Value

[`kvImageNoError`](/documentation/Accelerate/kvImageNoError); otherwise, one of the error codes that <doc://com.apple.documentation/documentation/Accelerate/data-types-and-constants> describes.

## Discussion

This function uses a resampling filter that you specify to shear, resize, and translate an image in one dimension. Use the resampling filter’s scale property to resize the image and the translate parameter to adjust the position of the destination image. The function transforms as much of the source image as it needs to fill the destination buffer. Therefore, it can transform pixels outside the region of interest.

This function doesn’t work in place — that is, the source and destination buffers need to point to different memory.

## See Also

  <doc://com.apple.accelerate/documentation/Accelerate/applying-geometric-transforms-to-images>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)