CornerPin
Function
This function either pushes the four corners of an image into 4 different positions
(formerly called Pin in 1.1), or extracts 4 positions and puts them into
the corners (formerly called UnPin in 1.1). The first use is handy for
putting an image into an on-screen television, for example. The second mode
is handy for extracting texture maps, among other things. The four coordinate
pairs start at the lower-left corner of the image (x0, y0), and work their way
around counter-clockwise to arrive at the upper-left corner of the image (x3,
y3).
If you are doing a unpin, i.e., pushing four points on the image to the four
corners of the image, switch the Update Mode to Manual ,
position your four points, then turn on inverseTransform and hit Update.
If the result is too blurry, drop the anti-aliasing.
You can also use the Move3D function to do perspective shifts
Parameters
|
Type
|
Defaults
|
Function
|
x0,y0, x1, y1, x2, y2, x3, y3 |
float
|
0,0, width, 0, width,height, 0, height |
Toggles between foreground (0) and background resolution (1) |
x/yFilter |
string
|
"default" | The filtering type to be used. |
inverseTransform |
int
|
0 |
This inverts the transform. In this case, it puts the four corners into the four coordinates (0, or Pinning), or pulls the four coordinates to the corners (1, or Unpinning). |
antialiasing |
float
|
1 | individual antialiasing. A value of zero brings out more clarity. |
motionBlur |
float
|
0 | Motion Blur quality level. 0 means no blur, whereas 1 represents standard filtering. For more speed, use less than 1. This value gets multiplied by the Global Parameter motionBlur. |
shutterTiming | float | .5 | Shutter length. 0 means no blur, whereas 1 represent a whole frame of blur. Note that standard camera blur is 180 degrees, or a value of .5. This value gets multiplied by the Global Parameter shutterTiming. |
shutterOffset | float | 0 | This is the offset from the current frame at which the blur is calculated. Default is 0, previous frames are less than 0. |
useReference | int | 0 | This is to be used to apply motion blur to previously-animated elements. See the Fan Tutorial on how to use this. |
Synopsis
image CornerPin( image, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, const char * xFilter, const char * yFilter, int inverseTransform, float antialiasing, float motionBlur, float shutterTiming, float shutterOffset, int useReference );
Script
image = CornerPin( image, x0, y0, x1, y1, x2, y2, x3, y3, "xFilter", "yFilter", inverseTransform, antialiasing, motionBlur, shutterTiming, shutterOffset. useReference );
Command Line
shake -cornerpin x0 y0 x1 y1 etc....
shake lisa.iff -corner 228 283 275 284 341 426 154 422
shake lisa.iff -corner 228 283 275 284 341 426 154 422 default default 1
See Also
PinCushion, Move2D,
Shear, Move3D