All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.image.ImageFilter | +----Acme.JPM.Filters.ImageFilterPlus | +----Acme.JPM.Filters.RGBAllFilter | +----Acme.JPM.Filters.Shear
Shears an image by the specified angle. The angle is in degrees (floating point), and measures this:
If the angle is negative, it shears the other way:+-------+ +-------+ | | |\ \ | OLD | | \ NEW \ | | |an\ \ +-------+ |gle+-------+
The angle should not get too close to 90 or -90, or the resulting image will be unreasonably wide. Staying between -45 and 45 is best.+-------+ |-an+-------+ | | |gl/ / | OLD | |e/ NEW / | | |/ / +-------+ +-------+
The shearing is implemented by looping over the source pixels and distributing fractions to each of the destination pixels. This has an "anti-aliasing" effect - it avoids jagged edges and similar artifacts.
This filter is fast.
Fetch the software.
Fetch the entire Acme package.
public Shear(ImageProducer producer, double angle)
public void filterRGBAll(int width, int height, int rgbPixels[][])
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs