---
title: "roi(forInput:arguments:outputRect:)"
framework: coreimage
role: symbol
role_heading: Type Method
path: "coreimage/ciimageprocessorkernel/roi(forinput:arguments:outputrect:)"
---

# roi(forInput:arguments:outputRect:)

Override this class method to implement your processor’s ROI callback.

## Declaration

```swift
class func roi(forInput inputIndex: Int32, arguments: [String : Any]?, outputRect: CGRect) -> CGRect
```

## Parameters

- `inputIndex`: The index that tells you which processor input for which to return the ROI rectangle.
- `arguments`: The arguments dictionary that was passed to doc://com.apple.coreimage/documentation/CoreImage/CIImageProcessorKernel/apply(withExtent:inputs:arguments:).
- `outputRect`: The output CGRect that processor will be asked to output.

## Return Value

Return Value  The CGRect of the inputIndexth input that is required for the above outputRect

## Discussion

Discussion This will be called one or more times per render to determine what portion of the input images are needed to render a given ‘outputRect’ of the output. This will not be called if processor has no input images. The default implementation would return outputRect. important: This is a class method so that you cannot use or capture any state by accident. All the parameters that affect the output results must be passed to apply(withExtent:inputs:arguments:).

## See Also

### Type Methods

- [apply(withExtent:inputs:arguments:)](coreimage/ciimageprocessorkernel/apply(withextent:inputs:arguments:).md)
- [formatForInput(at:)](coreimage/ciimageprocessorkernel/formatforinput(at:).md)
- [process(with:arguments:output:)](coreimage/ciimageprocessorkernel/process(with:arguments:output:).md)
- [roiTileArray(forInput:arguments:outputRect:)](coreimage/ciimageprocessorkernel/roitilearray(forinput:arguments:outputrect:).md)
