---
title: "sourceTileRect(_:sourceImageIndex:sourceImages:destinationTileRect:destinationImage:pluginState:at:)"
framework: Professional Video Applications
role: symbol
role_heading: Instance Method
platforms: [fxplug 4.0+]
path: "professional_video_applications/fxtileableeffect/sourcetilerect(_:sourceimageindex:sourceimages:destinationtilerect:destinationimage:pluginstate:at:)"
---

# sourceTileRect(_:sourceImageIndex:sourceImages:destinationTileRect:destinationImage:pluginState:at:)

Calculate the input rectangle needed for the given image input and the output tile to be rendered.

## Declaration

```swift
func sourceTileRect(_ sourceTileRect: UnsafeMutablePointer<FxRect>, sourceImageIndex: Int, sourceImages: [FxImageTile], destinationTileRect: FxRect, destinationImage: FxImageTile, pluginState: Data?, at renderTime: CMTime) throws
```

## Parameters

- `sourceTileRect`: The bounds of input tile for this input that will be needed to render the output tile. This method must calculate this value.
- `sourceImageIndex`: The index of the input image for which the tile bounds have been requested. This index matches the order of images in the inputImages array below.
- `sourceImages`: An NSArray of image tiles representing the input images. This image will not yet contain any pixel data, just the image bounds, pixel transforms, and other data describing the image.
- `destinationTileRect`: The bounds of the output tile, given to you by the host application.
- `destinationImage`: The output image. This image will not yet contain any pixel data, just the image bounds and other data about the output image.
- `pluginState`: The NSData returned from your plug-in’s doc://com.apple.professionalvideoapplications/documentation/professional_video_applications/FxTileableEffect/pluginState(_:at:quality:) method.
- `renderTime`: The rational time at which the output will be rendered.

## Mentioned in

Working with tiled images

## Discussion

Discussion This method is called for each image input your plug-in has requested. Use the passed-in information to calculate the portion of the current input image that you’ll need to render the output tile that will be rendered next.

## See Also

### Determining input and output bounds

- [destinationImageRect(_:sourceImages:destinationImage:pluginState:at:)](professional_video_applications/fxtileableeffect/destinationimagerect(_:sourceimages:destinationimage:pluginstate:at:).md)
- [FxRectsAreEqual(_:_:)](professional_video_applications/fxrectsareequal(_:_:).md)
