image
Class Image

java.lang.Object
  extended by image.Image
Direct Known Subclasses:
Line, Overlay, RasterImage, Rectangle, RegularPolygon, Scene, Text, Triangle, Widget

public abstract class Image
extends java.lang.Object

An abstract class representing an Image. See subclasses for specific implementations.


Method Summary
 RasterImage flipHorizontal()
          Return a version of this Image flipped horizontally (left to right).
 RasterImage flipVertical()
          Return a version of this Image flipped vertically (top to bottom).
abstract  int height()
          Calculate the height of this Image
 Image overlay(Image top)
          Overlay the given Image over this Image
 Image overlay(Image top, Image next, Image... imgs)
          Overlay the given Images over this Image
 Image overlayxy(double x, double y, Image top)
          Overlay the given Image over this Image offset (x,y)
 Image overlayxy(Image top, double x, double y)
          Overlay the given Image over this Image offset (x,y)
 Image overlayxy(Image top, int x, int y)
          Overlay the given Image over this Image offset (x,y)
 Image overlayxy(Image top, Posn p)
          Overlay the given Image over this Image offset Posn
 Image overlayxy(int x, int y, Image top)
          Overlay the given Image over this Image offset (x,y)
 Image overlayxy(Posn p, Image top)
          Overlay the given Image over this Image offset Posn
abstract  void paint(java.awt.Graphics g, int x, int y)
          Draw this image into a Graphics
 RasterImage rasterize()
          Return a raster (buffered) version of this Image
 RasterImage rotate(double ang)
          Return a rotated version of this image by the given angle in degrees.
 Image rotate(int ang)
          Return a rotated version of this image by the given angle in degrees.
 boolean toFile(java.lang.String name)
          Save this image to a file
 Scene toScene()
          Convert this image into a Scene containing the image without a background
 boolean toWhiteFile(java.lang.String name)
          Save this image to a file
 Scene toWhiteScene()
          Convert this image into a Scene containing the image with a white background
abstract  int width()
          Calculate the width of this Image
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

overlay

public Image overlay(Image top)
Overlay the given Image over this Image


overlay

public Image overlay(Image top,
                     Image next,
                     Image... imgs)
Overlay the given Images over this Image


overlayxy

public Image overlayxy(Image top,
                       int x,
                       int y)
Overlay the given Image over this Image offset (x,y)


overlayxy

public Image overlayxy(Image top,
                       double x,
                       double y)
Overlay the given Image over this Image offset (x,y)


overlayxy

public Image overlayxy(Image top,
                       Posn p)
Overlay the given Image over this Image offset Posn


overlayxy

public Image overlayxy(int x,
                       int y,
                       Image top)
Overlay the given Image over this Image offset (x,y)


overlayxy

public Image overlayxy(double x,
                       double y,
                       Image top)
Overlay the given Image over this Image offset (x,y)


overlayxy

public Image overlayxy(Posn p,
                       Image top)
Overlay the given Image over this Image offset Posn


paint

public abstract void paint(java.awt.Graphics g,
                           int x,
                           int y)
Draw this image into a Graphics


width

public abstract int width()
Calculate the width of this Image


height

public abstract int height()
Calculate the height of this Image


toScene

public Scene toScene()
Convert this image into a Scene containing the image without a background


toWhiteScene

public Scene toWhiteScene()
Convert this image into a Scene containing the image with a white background


toFile

public boolean toFile(java.lang.String name)
Save this image to a file


toWhiteFile

public boolean toWhiteFile(java.lang.String name)
Save this image to a file


rasterize

public RasterImage rasterize()
Return a raster (buffered) version of this Image


rotate

public Image rotate(int ang)
Return a rotated version of this image by the given angle in degrees.


rotate

public RasterImage rotate(double ang)
Return a rotated version of this image by the given angle in degrees.

Any Image may be rotated several times, though for efficiency (when possible) the rotated image should be saved, rather than recreated.


flipHorizontal

public RasterImage flipHorizontal()
Return a version of this Image flipped horizontally (left to right).


flipVertical

public RasterImage flipVertical()
Return a version of this Image flipped vertically (top to bottom).