image
Class RasterImage

java.lang.Object
  extended by image.Image
      extended by image.RasterImage
Direct Known Subclasses:
FromFile

public class RasterImage
extends Image

Represents a raster Image drawn into a Buffer. Because rotating and scaling arbitrary shapes/images is difficult, we can rasterize, then apply effects. It also allows us to merge images (i.e., overlays) into a single image to make drawing more efficient.


Constructor Summary
RasterImage(int w, int h)
          Construct a RasterImage with the given width/height
 
Method Summary
 java.awt.Graphics2D getGraphics()
          Get the Graphics2D associated with this RasterImage
 java.awt.Color getPixel(int x, int y)
          Get the java.awt.Color of the pixel at the given x/y
 java.lang.String getPixelAsString(int x, int y)
          Get a String of the Color pixel at the given x/y.
 int height()
          Return the height of this Image
 void paint(java.awt.Graphics g, int xx, int yy)
          Draw this image into a Graphics
 void setPixel(int x, int y, java.awt.Color color)
          Set the pixel at the given x/y to the given Color
 void setPixel(int x, int y, double red, double green, double blue)
          Set the pixel at the given x/y to the given RGB intensities.
 void setPixel(int x, int y, double alpha, double red, double green, double blue)
          Set the pixel at the given x/y to the given ARGB intensities.
 void setPixel(int x, int y, int argb)
          Set the pixel at the given x/y to the given ARGB integer.
 void setPixel(int x, int y, int red, int green, int blue)
          Set the pixel at the given x/y to the given RGB intensities.
 void setPixel(int x, int y, int alpha, int red, int green, int blue)
          Set the pixel at the given x/y to the given ARGB intensities.
 void setPixel(int x, int y, java.lang.String color)
          Set the pixel at the given x/y to the given String Color
 int width()
          Return the width of this Image
 
Methods inherited from class image.Image
flipHorizontal, flipVertical, overlay, overlay, overlayxy, overlayxy, overlayxy, overlayxy, overlayxy, overlayxy, rasterize, rotate, rotate, toFile, toScene, toWhiteFile, toWhiteScene
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RasterImage

public RasterImage(int w,
                   int h)
Construct a RasterImage with the given width/height

Method Detail

paint

public void paint(java.awt.Graphics g,
                  int xx,
                  int yy)
Draw this image into a Graphics

Specified by:
paint in class Image

width

public int width()
Return the width of this Image

Specified by:
width in class Image

height

public int height()
Return the height of this Image

Specified by:
height in class Image

getGraphics

public java.awt.Graphics2D getGraphics()
Get the Graphics2D associated with this RasterImage


getPixel

public java.awt.Color getPixel(int x,
                               int y)
Get the java.awt.Color of the pixel at the given x/y


getPixelAsString

public java.lang.String getPixelAsString(int x,
                                         int y)
Get a String of the Color pixel at the given x/y. E.g., "#00FF00" would be returned if the color of the pixel at the given x/y is blue.


setPixel

public void setPixel(int x,
                     int y,
                     java.lang.String color)
Set the pixel at the given x/y to the given String Color


setPixel

public void setPixel(int x,
                     int y,
                     java.awt.Color color)
Set the pixel at the given x/y to the given Color


setPixel

public void setPixel(int x,
                     int y,
                     int argb)
Set the pixel at the given x/y to the given ARGB integer.


setPixel

public void setPixel(int x,
                     int y,
                     int red,
                     int green,
                     int blue)
Set the pixel at the given x/y to the given RGB intensities. Intensities must be between 0 and 255, inclusive.


setPixel

public void setPixel(int x,
                     int y,
                     int alpha,
                     int red,
                     int green,
                     int blue)
Set the pixel at the given x/y to the given ARGB intensities. Intensities must be between 0 and 255, inclusive.


setPixel

public void setPixel(int x,
                     int y,
                     double red,
                     double green,
                     double blue)
Set the pixel at the given x/y to the given RGB intensities. Intensities must be between 0 and 1.0, inclusive.


setPixel

public void setPixel(int x,
                     int y,
                     double alpha,
                     double red,
                     double green,
                     double blue)
Set the pixel at the given x/y to the given ARGB intensities. Intensities must be between 0 and 1.0, inclusive.