| java.lang.Object demo.notification.whiteboard.PixelImage
All known Subclasses: demo.notification.whiteboard.BrushSizePixelImage,
PixelImage | public class PixelImage (Code) | | PixelImage.java
A pixel-based image.
author: Nicolas Noffke, Torsten Fink |
Constructor Summary | |
public | PixelImage(int width, int height) The constructor. |
Method Summary | |
public void | clearAll() | public void | drawLine(int x0, int y0, int x1, int y1, int red, int green, int blue) draws a line in the image. | public int[] | getPixelBuffer() gets the pixel buffer of this image. | public ImageProducer | getProducer() gets the ImageProducer for this image. | public void | setPixel(int x, int y, int red, int green, int blue) sets a pixel to a specific color. | public void | setPixel(int x, int y, Color color) sets a pixel to a specific color. | public void | setPixelBuffer(int[] data) |
m_pixels | protected int[] m_pixels(Code) | | |
PixelImage | public PixelImage(int width, int height)(Code) | | The constructor. Set up buffer.
Parameters: height - the images height. Parameters: width - the images width. |
clearAll | public void clearAll()(Code) | | |
drawLine | public void drawLine(int x0, int y0, int x1, int y1, int red, int green, int blue)(Code) | | draws a line in the image. The incremental line scan-conversion
algorithm is used (see "Computer Graphics"; Foley, vanDam,Feiner,Hughes).
(x0,y0) is the starting point, (x1,y1) the ending point.
|
getPixelBuffer | public int[] getPixelBuffer()(Code) | | gets the pixel buffer of this image.
the pixel buffer. |
getProducer | public ImageProducer getProducer()(Code) | | gets the ImageProducer for this image.
the ImageProducer for this image. |
setPixel | public void setPixel(int x, int y, int red, int green, int blue)(Code) | | sets a pixel to a specific color.
Parameters: x - the pixels x value. Parameters: y - the pixels y value. Parameters: red - the pixels red value. Parameters: green - the pixels green value. Parameters: blue - the pixels blue value. |
setPixel | public void setPixel(int x, int y, Color color)(Code) | | sets a pixel to a specific color.
Parameters: x - the pixels x value. Parameters: y - the pixels y value. Parameters: color - the pixels color. |
setPixelBuffer | public void setPixelBuffer(int[] data)(Code) | | |
|
|