cz.cuni.jagrlib
Class DefaultRasterGraphics

java.lang.Object
  extended by cz.cuni.jagrlib.DefaultProperty
      extended by cz.cuni.jagrlib.Piece
          extended by cz.cuni.jagrlib.DefaultRasterGraphics
All Implemented Interfaces:
Breakable, Property, RasterGraphics, Template
Direct Known Subclasses:
HDRImage, RasterImage

public abstract class DefaultRasterGraphics
extends Piece
implements RasterGraphics

Default implementation of RasterGraphics interface.

Since:
0.25
See Also:
DefaultRasterGraphics.java

Field Summary
protected  double alpha
          Actual drawing alpha (between 0.0 and 1.0).
protected  int alphaOp
          Actual alpha-operation.
protected static int[] BACKGROUND
          Default background color (for getPixel() methods).
protected static double[] BACKGROUND_D
          Default background color (for getPixel() methods).
protected  int bands
          Number of bands (for MODE_BAND).
protected  int binaryOp
          Actual binary set operation.
protected static java.lang.String CATEGORY
          Object category.
protected  int height
          The current bitmap height.
protected static double INV_255
           
protected  int mode
          The current bitmap mode (one of RasterGraphics.MODE_* constants).
protected  int setBands
           
protected  int setColorMode
           
protected  int setHeight
           
protected  int setWidth
           
protected static java.lang.String TEMPLATE_NAME
          Object template identifier.
protected  ValueTransferFunction transferFunction
          Actual value-transfer function.
protected  int width
          The current bitmap width.
 
Fields inherited from class cz.cuni.jagrlib.Piece
channels, info, pl, plugs, reg, TEMPLATE_TYPE, userBreak
 
Fields inherited from interface cz.cuni.jagrlib.iface.RasterGraphics
BANDS, COLORMODE, HEIGHT, MODE_BAND, MODE_COLORMAP, MODE_GRAY, MODE_RGB, MODE_RGBA, WIDTH
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Fields inherited from interface cz.cuni.jagrlib.Template
ALL_PLUGS, C_1D, C_2D, C_3D, C_ALPHA, C_BINARY, C_BREP, C_CAMERA, C_CIRCLE, C_CLIP, C_COMPRESSION, C_CURVE, C_DATA, C_DRAW, C_EDITOR, C_ELLIPSE, C_FILL, C_FILTER, C_FLOAT, C_FUNCTION, C_IMAGE, C_INTEGER, C_IO, C_LIGHT, C_LINE, C_METRIC, C_POLYGON, C_PROJECTION, C_RADIOSITY, C_RASTER, C_RENDER, C_SAMPLE, C_SCENE, C_SET, C_SOLID, C_TEXT, C_TRANSFORM, C_VECTOR, C_VIEWER, C_WORKER, CAT_EMPTY, EMPTY, IFACE, JAGRLIB, JAGRLIB2, MANIPULATOR_COMBO, MANIPULATOR_CUSTOM, MANIPULATOR_DEFAULT, MANIPULATOR_MULTILINE, PL_ALPHAMASK, PL_BITMASK, PL_CAUSTIC, PL_CODEC, PL_COLORMAP, PL_COMPARE, PL_DATA, PL_DIRECT, PL_EDITOR, PL_FILTER, PL_FUNCTION, PL_IMAGE, PL_IMPORT, PL_INPUT, PL_INTERSECTION, PL_LIGHTSOURCE, PL_ORDER, PL_OUTPUT, PL_PALETTE, PL_PHOTON, PL_PROPERTY, PL_QUANTIZER, PL_RASTER, PL_RENDER, PL_SHADOW, PL_STREAM, PL_TRANSFORM, PL_TRIGGER, PL_VOLUME, PL_WINDOW, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_STRING
 
Constructor Summary
DefaultRasterGraphics()
           
 
Method Summary
 void commit()
          Commits all previous changes to the internal object state.
static void drawFrame(RasterGraphics out, double x1d, double y1d, double x2d, double y2d)
          Draws the given line using current color.
static void drawLine(RasterGraphics out, double x1d, double y1d, double x2d, double y2d)
          Draws the given line using current color.
 java.lang.Object get(java.lang.String key)
          Gets the given property.
 int getBands()
          Number of color bands of the bitmap.
 java.awt.image.BufferedImage getBufferedImage()
          Copies raster graphics to a BufferedImage object.
 void getColormap(int i0, int length, double[][] _colors)
          Returns the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND").
 void getColormap(int i0, int length, int[][] _colors)
          Returns the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND").
 int getColormapType()
          Colormap mode (valid only for MODE_COLORMAP bitmap mode).
 int getGray(int x, int y)
          Returns the pixel's gray value (for all modes).
 double getGrayDouble(int x, int y)
          Returns the pixel's gray value (for all modes).
 int getHeight()
          Height of the bitmap.
 void getHLine(int x1, int x2, int y, double[] _colors)
          Returns the values for the given horizontal line (for MODE_GRAY).
 void getHLine(int x1, int x2, int y, double[][] _colors)
          Returns the values for the given horizontal line (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void getHLine(int x1, int x2, int y, int[] _colors)
          Returns the values for the given horizontal line (for MODE_GRAY or MODE_COLORMAP).
 void getHLine(int x1, int x2, int y, int[][] _colors)
          Returns the values for the given horizontal line (for MODE_RGB, MODE_RGBA or MODE_BAND).
 int getMaxColormap()
          Maximal ordinal number of colormap entry.
 int getMaxGray()
          Maximal gray value.
 int getMaxRGB()
          Maximal RGB[A] value.
 int getMode()
          Sample (color) model of the bitmap.
 int getPixel(int x, int y)
          Returns the pixel's value (for MODE_GRAY or MODE_COLORMAP).
 void getPixel(int x, int y, double[] _color)
          Returns the pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void getPixel(int x, int y, int[] _color)
          Returns the pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).
 double getPixelDouble(int x, int y)
          Returns the pixel's value (for MODE_GRAY).
 void getRGB(int x, int y, double[] _color)
          Returns the pixel's RGB[A] values (for all graphic modes).
 void getRGB(int x, int y, int[] _color)
          Returns the pixel's RGB[A] values (for all graphic modes).
 int getWidth()
          Width of the bitmap.
 void init()
          RasterImage re-initialization (keeps current bitmap size, mode, and colormap attributes, too).
 void init(int _width, int _height, int _mode, int _bands)
          RasterImage (re-)initialization.
 void putHLine(int x1, int x2, int y, double[] _colors)
          Sets the horizontal line's values (for MODE_GRAY).
 void putHLine(int x1, int x2, int y, double[][] _colors)
          Sets the horizontal line's values (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void putHLine(int x1, int x2, int y, int[] _colors)
          Sets the horizontal line's values (for MODE_GRAY or MODE_COLORMAP).
 void putHLine(int x1, int x2, int y, int[][] _colors)
          Sets the horizontal line's values (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void putPixel(int x, int y, double _color)
          Sets the given pixel's value (for MODE_GRAY).
 void putPixel(int x, int y, double[] _color)
          Sets the given pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void putPixel(int x, int y, int _color)
          Sets the given pixel's value (for MODE_GRAY or MODE_COLORMAP).
 void putPixel(int x, int y, int[] _color)
          Sets the given pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void set(java.lang.String key, java.lang.Object value)
          Sets the given property.
 void setAlpha(double _alpha)
          Sets the current drawing alpha (for MODE_RGB, MODE_RGBA or MODE_GRAY).
 int setAlphaOperation(int _op)
          Sets the alpha-channel operation (used in all set*() methods).
 void setBufferedImage(java.awt.image.BufferedImage bi)
          Initializes raster graphics from a BufferedImage object.
 void setColor(double _color)
          Sets the current drawing color (for MODE_GRAY).
 void setColor(double[] _color)
          Sets the current drawing color (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void setColor(int _color)
          Sets the current drawing color (for MODE_GRAY or MODE_COLORMAP).
 void setColor(int[] _color)
          Sets the current drawing color (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void setColormap(double[][] _colors)
          Sets the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND").
 void setColormap(int[][] _colors)
          Sets the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND").
 void setColormapType(int _mode, int _max)
          Sets the colormap mode (valid only for MODE_COLORMAP bitmap mode).
 void setHLine(int x1, int x2, int y)
          Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y].
 void setHLine(int x1, int x2, int y, double _color)
          Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_GRAY).
 void setHLine(int x1, int x2, int y, double[] _color)
          Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void setHLine(int x1, int x2, int y, int _color)
          Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_GRAY or MODE_COLORMAP).
 void setHLine(int x1, int x2, int y, int[] _color)
          Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_RGB, MODE_RGBA or and MODE_BAND).
 int setOperation(int _op)
          Sets the binary set operation (used in all set*() methods).
 void setPixel(int x, int y)
          Sets the given pixel's value.
 void setRectangle(int x1, int y1, int x2, int y2)
          Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1].
 void setRectangle(int x1, int y1, int x2, int y2, double _color)
          Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_GRAY).
 void setRectangle(int x1, int y1, int x2, int y2, double[] _color)
          Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_RGB, MODE_RGBA or MODE_BAND).
 void setRectangle(int x1, int y1, int x2, int y2, int _color)
          Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_GRAY or MODE_COLORMAP).
 void setRectangle(int x1, int y1, int x2, int y2, int[] _color)
          Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_RGB, MODE_RGBA or MODE_BAND).
 ValueTransferFunction setTransferFunction(ValueTransferFunction _transfer)
          Sets the value-transfer function (used in all set*() methods).
 
Methods inherited from class cz.cuni.jagrlib.Piece
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplate, setTemplateDynamic, stop
 
Methods inherited from class cz.cuni.jagrlib.DefaultProperty
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKGROUND

protected static final int[] BACKGROUND
Default background color (for getPixel() methods).


BACKGROUND_D

protected static final double[] BACKGROUND_D
Default background color (for getPixel() methods).


INV_255

protected static final double INV_255
See Also:
Constant Field Values

width

protected int width
The current bitmap width.


height

protected int height
The current bitmap height.


mode

protected int mode
The current bitmap mode (one of RasterGraphics.MODE_* constants).


bands

protected int bands
Number of bands (for MODE_BAND).


binaryOp

protected int binaryOp
Actual binary set operation.


alphaOp

protected int alphaOp
Actual alpha-operation.


alpha

protected double alpha
Actual drawing alpha (between 0.0 and 1.0).


transferFunction

protected ValueTransferFunction transferFunction
Actual value-transfer function.


setWidth

protected int setWidth

setHeight

protected int setHeight

setColorMode

protected int setColorMode

setBands

protected int setBands

TEMPLATE_NAME

protected static final java.lang.String TEMPLATE_NAME
Object template identifier.

See Also:
Constant Field Values

CATEGORY

protected static final java.lang.String CATEGORY
Object category.

See Also:
Constant Field Values
Constructor Detail

DefaultRasterGraphics

public DefaultRasterGraphics()
Method Detail

drawLine

public static final void drawLine(RasterGraphics out,
                                  double x1d,
                                  double y1d,
                                  double x2d,
                                  double y2d)
Draws the given line using current color.


drawFrame

public static final void drawFrame(RasterGraphics out,
                                   double x1d,
                                   double y1d,
                                   double x2d,
                                   double y2d)
Draws the given line using current color.


init

public void init(int _width,
                 int _height,
                 int _mode,
                 int _bands)
RasterImage (re-)initialization.

Specified by:
init in interface RasterGraphics
Parameters:
_width - Width of a new bitmap.
_height - Height of a new bitmap.
_mode - Pixel value type (RasterGraphics.MODE_* constant).
_bands - Number of bands (for MODE_BAND).
See Also:
setColormapType(int, int)

init

public void init()
RasterImage re-initialization (keeps current bitmap size, mode, and colormap attributes, too).

Specified by:
init in interface RasterGraphics

getWidth

public int getWidth()
Width of the bitmap.

Specified by:
getWidth in interface RasterGraphics
Returns:
Current bitmap width in pixels.

getHeight

public int getHeight()
Height of the bitmap.

Specified by:
getHeight in interface RasterGraphics
Returns:
Current bitmap height in pixels.

getMode

public int getMode()
Sample (color) model of the bitmap.

Specified by:
getMode in interface RasterGraphics
Returns:
Current bitmap mode (RasterGraphics.MODE_* constants).

getBands

public int getBands()
Number of color bands of the bitmap.

Specified by:
getBands in interface RasterGraphics
Returns:
Number of color bands.

getMaxGray

public int getMaxGray()
Maximal gray value.

Specified by:
getMaxGray in interface RasterGraphics
Returns:
Maximal acceptable gray value.

getMaxColormap

public int getMaxColormap()
Maximal ordinal number of colormap entry.

Default: colormap mode is not implemented!

Specified by:
getMaxColormap in interface RasterGraphics
Returns:
Maximal colormap's entry number.

getMaxRGB

public int getMaxRGB()
Maximal RGB[A] value. Also used in multi-band mode.

Specified by:
getMaxRGB in interface RasterGraphics
Returns:
Maximal value for R,G,B,A and other bands.

getBufferedImage

public java.awt.image.BufferedImage getBufferedImage()
Copies raster graphics to a BufferedImage object.

Default: BufferedImage is not used..

Specified by:
getBufferedImage in interface RasterGraphics
Returns:
BufferedImage object.
See Also:
setBufferedImage(java.awt.image.BufferedImage)

setBufferedImage

public void setBufferedImage(java.awt.image.BufferedImage bi)
Initializes raster graphics from a BufferedImage object.

Default: BufferedImage is not used..

Specified by:
setBufferedImage in interface RasterGraphics
Parameters:
bi - Raster data.
See Also:
getBufferedImage()

getColormapType

public int getColormapType()
Colormap mode (valid only for MODE_COLORMAP bitmap mode).

Specified by:
getColormapType in interface RasterGraphics
Returns:
Colormap mode (one of (RasterGraphics.MODE_* constants).
See Also:
RasterGraphics

setColormapType

public void setColormapType(int _mode,
                            int _max)
Sets the colormap mode (valid only for MODE_COLORMAP bitmap mode).

Default: colormap mode is not implemented!

Specified by:
setColormapType in interface RasterGraphics
Parameters:
_mode - Colormap mode (one of (RasterGraphics.MODE_* constants).
_max - Maximal index of colormap entry.
See Also:
RasterGraphics

getColormap

public void getColormap(int i0,
                        int length,
                        double[][] _colors)
Returns the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND").

Default: colormap mode is not implemented!

Specified by:
getColormap in interface RasterGraphics
Parameters:
i0 - The first colormap index.
length - Length of colormap segment.
_colors - Returned color levels (each band: from 0.0 to 1.0).
See Also:
RasterGraphics

getColormap

public void getColormap(int i0,
                        int length,
                        int[][] _colors)
Returns the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND").

Default: colormap mode is not implemented!

Specified by:
getColormap in interface RasterGraphics
Parameters:
i0 - The first colormap index.
length - Length of colormap segment.
_colors - Returned color levels (each band: from 0 to #getMaxRGB()).

setColormap

public void setColormap(double[][] _colors)
Sets the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND"). Colormap size & mode has to be set before using setColormapType(int, int).

Default: colormap mode is not implemented!

Specified by:
setColormap in interface RasterGraphics
Parameters:
_colors - Color levels to be set (each band: from 0.0 to 1.0).

setColormap

public void setColormap(int[][] _colors)
Sets the colormap segment (for color modes: "getColormapType() == MODE_RGB || getColormapType() == MODE_RGBA || getColormapType() == MODE_BAND"). Colormap size & mode has to be set before using #setColormapType.

Default: colormap mode is not implemented!

Specified by:
setColormap in interface RasterGraphics
Parameters:
_colors - Color levels to be set (each band: from 0 to getMaxRGB()).

setOperation

public int setOperation(int _op)
Sets the binary set operation (used in all set*() methods).

Specified by:
setOperation in interface RasterGraphics
Parameters:
_op - Binary set operation (BinaryOperation.BIN_OP_* constant).
Returns:
The old binary set operation.
See Also:
Binary operations, RasterGraphics

setAlphaOperation

public int setAlphaOperation(int _op)
Sets the alpha-channel operation (used in all set*() methods).

Specified by:
setAlphaOperation in interface RasterGraphics
Parameters:
_op - Alpha-channel operation (AlphaOperation.ALPHA_* constant).
Returns:
The old alpha-channel operation.
See Also:
Alpha-channel operations

setTransferFunction

public ValueTransferFunction setTransferFunction(ValueTransferFunction _transfer)
Sets the value-transfer function (used in all set*() methods).

Specified by:
setTransferFunction in interface RasterGraphics
Parameters:
_transfer - New value-transfer function or null.
Returns:
The old Value-transfer function or null.
See Also:
Value-transfor function prototype, RasterGraphics

setColor

public void setColor(int _color)
Sets the current drawing color (for MODE_GRAY or MODE_COLORMAP).

Specified by:
setColor in interface RasterGraphics
Parameters:
_color - Current drawing color (0 to getMaxGray() or getMaxColormap()).
See Also:
RasterGraphics

setColor

public void setColor(double _color)
Sets the current drawing color (for MODE_GRAY).

Specified by:
setColor in interface RasterGraphics
Parameters:
_color - Current drawing color (0.0 to 1.0).
See Also:
RasterGraphics

setColor

public void setColor(int[] _color)
Sets the current drawing color (for MODE_RGB, MODE_RGBA or MODE_BAND).

Specified by:
setColor in interface RasterGraphics
Parameters:
_color - Current drawing color (channel values between 0 and getMaxRGB()).
See Also:
RasterGraphics

setColor

public void setColor(double[] _color)
Sets the current drawing color (for MODE_RGB, MODE_RGBA or MODE_BAND).

Specified by:
setColor in interface RasterGraphics
Parameters:
_color - Current drawing color (channel values between 0.0 and 1.0).
See Also:
RasterGraphics

setAlpha

public void setAlpha(double _alpha)
Sets the current drawing alpha (for MODE_RGB, MODE_RGBA or MODE_GRAY).

Specified by:
setAlpha in interface RasterGraphics
Parameters:
_alpha - Current drawing alpha (values between 0.0 and 1.0).

setPixel

public void setPixel(int x,
                     int y)
Sets the given pixel's value.

Ignores any off-canvas access.

Specified by:
setPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
See Also:
setColor(int), setColor(double), setColor(int[]), setColor(double[]), RasterGraphics

getPixel

public int getPixel(int x,
                    int y)
Returns the pixel's value (for MODE_GRAY or MODE_COLORMAP).

Specified by:
getPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
Returns:
Pixel value (0 for off-canvas access).
See Also:
RasterGraphics

getPixelDouble

public double getPixelDouble(int x,
                             int y)
Returns the pixel's value (for MODE_GRAY).

Specified by:
getPixelDouble in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
Returns:
Pixel value (0.0 for off-canvas access).
See Also:
RasterGraphics

getPixel

public void getPixel(int x,
                     int y,
                     int[] _color)
Returns the pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).

Specified by:
getPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Current pixel RGB[A] value.
See Also:
RasterGraphics

getPixel

public void getPixel(int x,
                     int y,
                     double[] _color)
Returns the pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).

Specified by:
getPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Current pixel RGB[A] value.
See Also:
RasterGraphics

getRGB

public void getRGB(int x,
                   int y,
                   int[] _color)
Returns the pixel's RGB[A] values (for all graphic modes).

Specified by:
getRGB in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Current pixel RGB[A] value (if the array's length is at least 4, alpha will be returned).

getRGB

public void getRGB(int x,
                   int y,
                   double[] _color)
Returns the pixel's RGB[A] values (for all graphic modes).

Specified by:
getRGB in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Current pixel RGB[A] value (if the array's length is at least 4, alpha will be returned).

getGray

public int getGray(int x,
                   int y)
Returns the pixel's gray value (for all modes).

Specified by:
getGray in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
Returns:
Pixel value (0 for off-canvas access).

getGrayDouble

public double getGrayDouble(int x,
                            int y)
Returns the pixel's gray value (for all modes).

Specified by:
getGrayDouble in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
Returns:
Pixel value (0.0 for off-canvas access).

putPixel

public void putPixel(int x,
                     int y,
                     int _color)
Sets the given pixel's value (for MODE_GRAY or MODE_COLORMAP).

Ignores any off-canvas access.

Specified by:
putPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Pixel color (between 0 and getMaxGray() or getMaxColormap()).

putPixel

public void putPixel(int x,
                     int y,
                     double _color)
Sets the given pixel's value (for MODE_GRAY).

Ignores any off-canvas access.

Specified by:
putPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Pixel color (between 0.0 and 1.0).

putPixel

public void putPixel(int x,
                     int y,
                     int[] _color)
Sets the given pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
putPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Pixel color (between 0 and getMaxRGB()).

putPixel

public void putPixel(int x,
                     int y,
                     double[] _color)
Sets the given pixel's value (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
putPixel in interface RasterGraphics
Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
_color - Pixel color (between 0.0 and 1.0).

setHLine

public void setHLine(int x1,
                     int x2,
                     int y)
Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y].

Ignores any off-canvas access.

Specified by:
setHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
See Also:
setColor(int), setColor(double), setColor(int[]), setColor(double[]), RasterGraphics

setHLine

public void setHLine(int x1,
                     int x2,
                     int y,
                     int _color)
Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_GRAY or MODE_COLORMAP).

Ignores any off-canvas access.

Specified by:
setHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_color - Drawing color (0 to getMaxGray() or getMaxColormap()).
See Also:
RasterGraphics

setHLine

public void setHLine(int x1,
                     int x2,
                     int y,
                     double _color)
Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_GRAY).

Ignores any off-canvas access.

Specified by:
setHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_color - Drawing color (0.0 to 1.0).
See Also:
RasterGraphics

setHLine

public void setHLine(int x1,
                     int x2,
                     int y,
                     int[] _color)
Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_RGB, MODE_RGBA or and MODE_BAND).

Ignores any off-canvas access.

Specified by:
setHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_color - Drawing color (channel values between 0 and getMaxRGB()).
See Also:
RasterGraphics

setHLine

public void setHLine(int x1,
                     int x2,
                     int y,
                     double[] _color)
Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y] (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
setHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_color - Drawing color (channel values between 0.0 and 1.0).
See Also:
RasterGraphics

putHLine

public void putHLine(int x1,
                     int x2,
                     int y,
                     int[] _colors)
Sets the horizontal line's values (for MODE_GRAY or MODE_COLORMAP).

Ignores any off-canvas access.

Specified by:
putHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Line colors (between 0 and getMaxGray() or getMaxColormap()).
See Also:
RasterGraphics

putHLine

public void putHLine(int x1,
                     int x2,
                     int y,
                     double[] _colors)
Sets the horizontal line's values (for MODE_GRAY).

Ignores any off-canvas access.

Specified by:
putHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Line colors (between 0.0 and 1.0).
See Also:
RasterGraphics

putHLine

public void putHLine(int x1,
                     int x2,
                     int y,
                     int[][] _colors)
Sets the horizontal line's values (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
putHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Line colors (between 0 and getMaxGray()).
See Also:
RasterGraphics

putHLine

public void putHLine(int x1,
                     int x2,
                     int y,
                     double[][] _colors)
Sets the horizontal line's values (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
putHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Line colors (between 0.0 and 1.0).
See Also:
RasterGraphics

getHLine

public void getHLine(int x1,
                     int x2,
                     int y,
                     int[] _colors)
Returns the values for the given horizontal line (for MODE_GRAY or MODE_COLORMAP).

Specified by:
getHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Returned colors (0 to getMaxGray() or getMaxColormap(), 0 for off-canvas access).
See Also:
RasterGraphics

getHLine

public void getHLine(int x1,
                     int x2,
                     int y,
                     double[] _colors)
Returns the values for the given horizontal line (for MODE_GRAY).

Specified by:
getHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Returned colors (0.0 to 1.0, 0.0 for off-canvas access).
See Also:
RasterGraphics

getHLine

public void getHLine(int x1,
                     int x2,
                     int y,
                     int[][] _colors)
Returns the values for the given horizontal line (for MODE_RGB, MODE_RGBA or MODE_BAND).

Specified by:
getHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Returned colors (channel values between 0 and getMaxRGB(), 0 for off-canvas access).
See Also:
RasterGraphics

getHLine

public void getHLine(int x1,
                     int x2,
                     int y,
                     double[][] _colors)
Returns the values for the given horizontal line (for MODE_RGB, MODE_RGBA or MODE_BAND).

Specified by:
getHLine in interface RasterGraphics
Parameters:
x1 - X coordinate of the starting pixel.
x2 - X coordinate of the first pixel after the line.
y - Common Y coordinate of the line.
_colors - Returned colors (channel values between 0.0 and 1.0, 0.0 for off-canvas access).
See Also:
RasterGraphics

setRectangle

public void setRectangle(int x1,
                         int y1,
                         int x2,
                         int y2)
Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1].

Ignores any off-canvas access.

Specified by:
setRectangle in interface RasterGraphics
Parameters:
x1 - X coordinate of the upper left corner.
y1 - Y coordinate of the upper left corner.
x2 - X coordinate of the lower right corner (outside pixel).
y2 - Y coordinate of the upper left corner (outside pixel).
See Also:
RasterGraphics

setRectangle

public void setRectangle(int x1,
                         int y1,
                         int x2,
                         int y2,
                         int _color)
Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_GRAY or MODE_COLORMAP).

Ignores any off-canvas access.

Specified by:
setRectangle in interface RasterGraphics
Parameters:
x1 - X coordinate of the upper left corner.
y1 - Y coordinate of the upper left corner.
x2 - X coordinate of the lower right corner (outside pixel).
y2 - Y coordinate of the upper left corner (outside pixel).
_color - Drawing color (0 to getMaxGray() or getMaxColormap()).
See Also:
RasterGraphics

setRectangle

public void setRectangle(int x1,
                         int y1,
                         int x2,
                         int y2,
                         double _color)
Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_GRAY).

Ignores any off-canvas access.

Specified by:
setRectangle in interface RasterGraphics
Parameters:
x1 - X coordinate of the upper left corner.
y1 - Y coordinate of the upper left corner.
x2 - X coordinate of the lower right corner (outside pixel).
y2 - Y coordinate of the upper left corner (outside pixel).
_color - Drawing color (0.0 to 1.0).
See Also:
RasterGraphics

setRectangle

public void setRectangle(int x1,
                         int y1,
                         int x2,
                         int y2,
                         int[] _color)
Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
setRectangle in interface RasterGraphics
Parameters:
x1 - X coordinate of the upper left corner.
y1 - Y coordinate of the upper left corner.
x2 - X coordinate of the lower right corner (outside pixel).
y2 - Y coordinate of the upper left corner (outside pixel).
_color - Drawing color (0 to getMaxRGB()).
See Also:
RasterGraphics

setRectangle

public void setRectangle(int x1,
                         int y1,
                         int x2,
                         int y2,
                         double[] _color)
Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1] (for MODE_RGB, MODE_RGBA or MODE_BAND).

Ignores any off-canvas access.

Specified by:
setRectangle in interface RasterGraphics
Parameters:
x1 - X coordinate of the upper left corner.
y1 - Y coordinate of the upper left corner.
x2 - X coordinate of the lower right corner (outside pixel).
y2 - Y coordinate of the upper left corner (outside pixel).
_color - Drawing color (0.0 to 1.0).
See Also:
RasterGraphics

set

public void set(java.lang.String key,
                java.lang.Object value)
Sets the given property.

Specified by:
set in interface Property
Overrides:
set in class DefaultProperty
Parameters:
key - Key string.
value - The new value.
See Also:
Property.commit()

get

public java.lang.Object get(java.lang.String key)
Gets the given property.

Specified by:
get in interface Property
Overrides:
get in class DefaultProperty
Parameters:
key - Key string.
Returns:
The actual value or null.

commit

public void commit()
Commits all previous changes to the internal object state. Non-mandatory.

Specified by:
commit in interface Property
Overrides:
commit in class DefaultProperty