imageShear

Shears an image either horizontally or vertically.

imageShear(name, shear [, direction] [, interpolation]) → returns void

Member Function Syntax

someImage.shear(shear [, direction] [, interpolation])

imageShear Argument Reference

name string
Required

The image on which this operation is performed.

shear numeric
Required

Shear value. Coordinates can be integers or real numbers.

direction string
Default: horizontal

Shear direction
Values:
  • horizontal
  • vertical

interpolation string
Default: nearest

Type of interpolation
Values:
  • nearest: Applies the nearest neighbor method of interpolation. Image quality is lower than the other interpolation methods, but processing is fastest.
  • bilinear: Applies the bilinear method of interpolation. The quality of the image is less pixelated than the default, but processing is slower.
  • bicubic: Applies the bicubic method of interpolation. Generally, the quality of image is highest with this method and processing is slowest.

Examples sample code invoking the imageShear function

CF 11+ Shear the image by a factor of 1 on a horizontal axis

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.shear(1);
cfimage(action="writeToBrowser", source=imgObj);

Fork me on GitHub