Viewport
Function
This function is exactly like a Crop,
but it keeps the image information outside of the frame so you can do transformations
afterwards.
Example
The following tree has a large input image (scaled down in the illustration)
which is piped into both a Crop and a Viewport, each with the
same values. These are both piped into Move2D's, each with the same xPan
values. The Crop result has black on the right edge after the pan, the
Viewport result does not:
Node tree: | FileIn1: |
![]() |
![]() |
Crop1: | Viewport1: |
![]() |
![]() |
Move2D1: | Move2D2: |
![]() |
![]() |
Parameters
|
Type
|
Defaults
|
Function
|
cropLeft, Bottom, Right, Top |
int
|
0, 0, width, height
|
The cropping window, with 0, 0 being the lower left corner. |
Synopsis
image Viewport( image, int cropLeft, int cropBottom, int cropRight, int cropTop );
Script
image = Viewport( image, cropLeft, cropBottom, cropRight, cropTop );
Command Line
shake -viewport cropLeft cropBottom cropRight cropTop