---
title: CIWarpKernel
framework: coreimage
role: symbol
role_heading: Class
path: coreimage/ciwarpkernel
---

# CIWarpKernel

A GPU-based image-processing routine that processes only the geometry information in an image, used to create custom Core Image filters.

## Declaration

```swift
class CIWarpKernel
```

## Overview

Overview The kernel language routine for a warp kernel has the following characteristics: It uses exactly one input image. Its return type is vec2 (Core Image Kernel Language) or float2 (Metal Shading Language), specifying a position in source image coordinates. A warp kernel routine requires no input parameters (but can use additional custom parameters you declare). Typically, a warp kernel uses the destination coordinate function to look up the coordinates of the destination pixel currently being rendered, then computes a corresponding position in source image coordinates (output using the return keyword). Core Image then samples from the source image at the returned coordinates to produce a pixel color for the output image. For example, the Metal Shading Language source below implements a filter that passes through its input image unchanged. #include <CoreImage/CoreImage.h>   extern "C" {     namespace coreimage {         float2 do_nothing(destination dest) {             return dest.coord();         }     } } The equivalent code in Core Image Kernel Language is: kernel vec2 do_nothing() {     return destCoord(); } The Core Image Kernel Language is a dialect of the OpenGL Shading Language. See Core Image Kernel Language Reference and Core Image Programming Guide for more details.

## Topics

### Creating a Kernel

- [init(source:)](coreimage/ciwarpkernel/init(source:).md)

### Applying a Kernel to Filter an Image

- [apply(extent:roiCallback:image:arguments:)](coreimage/ciwarpkernel/apply(extent:roicallback:image:arguments:).md)

## Relationships

### Inherits From

- [CIKernel](coreimage/cikernel.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Custom Filters

- [Writing Custom Kernels](coreimage/writing-custom-kernels.md)
- [CIKernel](coreimage/cikernel.md)
- [CIColorKernel](coreimage/cicolorkernel.md)
- [CIBlendKernel](coreimage/ciblendkernel.md)
- [CISampler](coreimage/cisampler.md)
- [CIFilterShape](coreimage/cifiltershape.md)
- [CIFormat](coreimage/ciformat.md)
