---
title: "vImageNewResamplingFilter(_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vimagenewresamplingfilter(_:_:)"
---

# vImageNewResamplingFilter(_:_:)

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

## Declaration

```swift
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: doc://com.apple.accelerate/documentation/Accelerate/kvImageBackgroundColorFill or doc://com.apple.accelerate/documentation/Accelerate/kvImageEdgeExtend. Set the doc://com.apple.accelerate/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 doc://com.apple.accelerate/documentation/Accelerate/kvImageDoNotTile. This function ignores the doc://com.apple.accelerate/documentation/Accelerate/kvImageLeaveAlphaUnchanged flag.

## Return Value

Return Value A pointer to a newly created resampling filter object; otherwise NULL.

## Discussion

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(_:). Don’t attempt to deallocate the memory yourself.

## See Also

### Resampling filters

- [vImageNewResamplingFilterForFunctionUsingBuffer(_:_:_:_:_:_:)](accelerate/vimagenewresamplingfilterforfunctionusingbuffer(_:_:_:_:_:_:).md)
- [vImageGetResamplingFilterExtent(_:_:)](accelerate/vimagegetresamplingfilterextent(_:_:).md)
- [vImageGetResamplingFilterSize(_:_:_:_:)](accelerate/vimagegetresamplingfiltersize(_:_:_:_:).md)
- [vImageDestroyResamplingFilter(_:)](accelerate/vimagedestroyresamplingfilter(_:).md)
