Class Raster
java.lang.Object
|
+----Raster
- public class Raster
- extends Object
-
height
-
-
pixel
-
-
width
-
-
Raster()
- This constructor which takes no arguments
allows for future extension.
-
Raster(Image)
- This constructor creates an Raster initialized
with the contents of an image.
-
Raster(int, int)
- This constructor creates an uninitialized
Raster Object of a given size (w x h).
-
fill(Color)
- Fills a Raster with a solid color
-
getColor(int, int)
- Gets a color from a Raster
-
getHeight()
-
-
getPixel(int, int)
- Gets a pixel from a Raster
-
getPixels()
-
-
getWidth()
- Access instance variables
-
setColor(Color, int, int)
- Sets a pixel to a given color
Make sure you don't set something off the
edge of the raster.
-
setPixel(int, int, int)
- Sets a pixel to a given value
Make sure you don't set something off the
edge of the raster.
-
size()
- Returns the number of pixels in the Raster
-
toImage()
- Converts Rasters to Images
-
toString()
- toString method.
width
protected int width
height
protected int height
pixel
public int pixel[]
Raster
public Raster()
- This constructor which takes no arguments
allows for future extension.
Raster
public Raster(int w,
int h)
- This constructor creates an uninitialized
Raster Object of a given size (w x h).
Raster
public Raster(Image img)
- This constructor creates an Raster initialized
with the contents of an image.
size
public int size()
- Returns the number of pixels in the Raster
getWidth
public int getWidth()
- Access instance variables
getHeight
public int getHeight()
getPixels
public int[] getPixels()
fill
public void fill(Color c)
- Fills a Raster with a solid color
toImage
public Image toImage()
- Converts Rasters to Images
getPixel
public int getPixel(int x,
int y)
- Gets a pixel from a Raster
getColor
public Color getColor(int x,
int y)
- Gets a color from a Raster
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.
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.
toString
public String toString()
- toString method.
returns the width and height of the Raster
- Overrides:
- toString in class Object