All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.JPM.Filters.Shear

java.lang.Object
   |
   +----java.awt.image.ImageFilter
           |
           +----Acme.JPM.Filters.ImageFilterPlus
                   |
                   +----Acme.JPM.Filters.RGBAllFilter
                           |
                           +----Acme.JPM.Filters.Shear

public class Shear
extends RGBAllFilter
Shear an image by some angle.

Shears an image by the specified angle. The angle is in degrees (floating point), and measures this:


 +-------+  +-------+
 |       |  |\       \
 |  OLD  |  | \  NEW  \
 |       |  |an\       \
 +-------+  |gle+-------+
 
If the angle is negative, it shears the other way:

 +-------+  |-an+-------+
 |       |  |gl/       /
 |  OLD  |  |e/  NEW  /
 |       |  |/       /
 +-------+  +-------+
 
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.

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.


Constructor Index

 o Shear(ImageProducer, double)
Constructor.

Method Index

 o filterRGBAll(int, int, int[][])
This is the routine that subclasses must implement.
 o main(String[])

Constructors

 o Shear
 public Shear(ImageProducer producer,
              double angle)
Constructor.

Methods

 o filterRGBAll
 public void filterRGBAll(int width,
                          int height,
                          int rgbPixels[][])
This is the routine that subclasses must implement.

Overrides:
filterRGBAll in class RGBAllFilter
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs