CornerPin

Function
The CornerPin function can be used to push the four corners of an image into four different positions, or to extract four positions and place them into the corners. The first use is ideal for positioning an image in an onscreen television, for example. The second mode is handy for extracting texture maps, among other things. The four coordinate pairs start at the lowerleft corner of the image (x0, y0), and work around in a counterclockwise direction to arrive at the upper-left corner of the image (x3, y3). To perform an “unpin” (push four points on the image to the four corners of the image), switch the Update Mode to Manual, position the four points, enable inverseTransform, and click Update.

If the result is too blurry, drop the anti-aliasing.

You can also use the Move3D function for 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....


Examples

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