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

# vImageNewResamplingFilter(_:_:)

Creates a resampling filter object that corresponds to the default kernel supplied by the vImage framework.

```
func vImageNewResamplingFilter(_ scale: Float, _ flags: vImage_Flags) -> ResamplingFilter!
```

## 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:  [`kvImageBackgroundColorFill`](/documentation/Accelerate/kvImageBackgroundColorFill) or [`kvImageEdgeExtend`](/documentation/Accelerate/kvImageEdgeExtend).

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

    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

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(_:)`](/documentation/Accelerate/vImageDestroyResamplingFilter(_:)). Don’t attempt to deallocate the memory yourself.

---

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)