Class Raster

java.lang.Object
   |
   +----Raster

public class Raster
extends Object

Variable Index

 o height
 o pixel
 o width

Constructor Index

 o Raster()
This constructor which takes no arguments allows for future extension.
 o Raster(Image)
This constructor creates an Raster initialized with the contents of an image.
 o Raster(int, int)
This constructor creates an uninitialized Raster Object of a given size (w x h).

Method Index

 o fill(Color)
Fills a Raster with a solid color
 o getColor(int, int)
Gets a color from a Raster
 o getHeight()
 o getPixel(int, int)
Gets a pixel from a Raster
 o getPixels()
 o getWidth()
Access instance variables
 o setColor(Color, int, int)
Sets a pixel to a given color Make sure you don't set something off the edge of the raster.
 o setPixel(int, int, int)
Sets a pixel to a given value Make sure you don't set something off the edge of the raster.
 o size()
Returns the number of pixels in the Raster
 o toImage()
Converts Rasters to Images
 o toString()
toString method.

Variables

 o width
 protected int width
 o height
 protected int height
 o pixel
 public int pixel[]

Constructors

 o Raster
 public Raster()
This constructor which takes no arguments allows for future extension.

 o Raster
 public Raster(int w,
               int h)
This constructor creates an uninitialized Raster Object of a given size (w x h).

 o Raster
 public Raster(Image img)
This constructor creates an Raster initialized with the contents of an image.

Methods

 o size
 public int size()
Returns the number of pixels in the Raster

 o getWidth
 public int getWidth()
Access instance variables

 o getHeight
 public int getHeight()
 o getPixels
 public int[] getPixels()
 o fill
 public void fill(Color c)
Fills a Raster with a solid color

 o toImage
 public Image toImage()
Converts Rasters to Images

 o getPixel
 public int getPixel(int x,
                     int y)
Gets a pixel from a Raster

 o getColor
 public Color getColor(int x,
                       int y)
Gets a color from a Raster

 o setPixel
 public boolean setPixel(int pix,
                         int x,
                         int y)
Sets a pixel to a given value Make sure you don't set something off the edge of the raster.

 o setColor
 public boolean setColor(Color c,
                         int x,
                         int y)
Sets a pixel to a given color Make sure you don't set something off the edge of the raster.

 o toString
 public String toString()
toString method. returns the width and height of the Raster

Overrides:
toString in class Object