cz.cuni.jagrlib.iface
Interface BitMask

All Superinterfaces:
BitMaskCore, Property
All Known Subinterfaces:
AlphaMask
All Known Implementing Classes:
AlphaMatrix, OverwriteClassificator, XTransitionList

public interface BitMask
extends BitMaskCore, Property

Bit-mask interface (representation of pixel set in 2D plane).

Since:
0.01
See Also:
BitMask.java

Field Summary
static java.lang.String HEIGHT
           
static java.lang.String WIDTH
           
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 void bitBlt(int dx, int dy, int sx, int sy, int width, int height)
          Bit-block-transfer routine: copies the source rectangle [sx,sy,width,height] to the new location [dx,dy].
 void getHLine(int x1, int x2, int y, boolean[] values)
          Returns the pixels' values for the given horizontal line.
 void getRectangle(int x1, int y1, int x2, int y2, boolean[][] values)
          Returns the pixels' values for the given rectangle.
 void putHLine(int x1, int x2, int y, boolean[] values)
          Sets the horizontal line's values (ignores current binary set operation).
 void putPixel(int x, int y, boolean value)
          Sets the given pixel's value (ignores current binary set operation).
 void putRectangle(int x1, int y1, int x2, int y2, boolean[][] values)
          Sets the rectangle's values (ignores current binary set operation).
 int setOperation(int _op)
          Sets the binary set operation (used in all set*() methods).
 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].
 
Methods inherited from interface cz.cuni.jagrlib.iface.BitMaskCore
enumerator, getPixel, init, init, setHLine, setPixel
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Field Detail

WIDTH

static final java.lang.String WIDTH
See Also:
Constant Field Values

HEIGHT

static final java.lang.String HEIGHT
See Also:
Constant Field Values
Method Detail

setOperation

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

Parameters:
_op - Binary set operation (BinaryOperation.BIN_OP_* constant).
Returns:
The old binary set operation.
See Also:
Binary operations

putPixel

void putPixel(int x,
              int y,
              boolean value)
Sets the given pixel's value (ignores current binary set operation).

Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
value - New pixel's value.

putHLine

void putHLine(int x1,
              int x2,
              int y,
              boolean[] values)
Sets the horizontal line's values (ignores current binary set operation).

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.
values - New pixels' values.

getHLine

void getHLine(int x1,
              int x2,
              int y,
              boolean[] values)
Returns the pixels' values for the given horizontal line.

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.
values - Returned values in boolean[] array (false for off-canvas access).

setRectangle

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]. Accepts current binary set operation.

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).

putRectangle

void putRectangle(int x1,
                  int y1,
                  int x2,
                  int y2,
                  boolean[][] values)
Sets the rectangle's values (ignores current binary set operation).

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).
values - New pixels' values.

getRectangle

void getRectangle(int x1,
                  int y1,
                  int x2,
                  int y2,
                  boolean[][] values)
Returns the pixels' values for the given rectangle.

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).
values - Returned values in boolean[][] array (false for off-canvas access).

bitBlt

void bitBlt(int dx,
            int dy,
            int sx,
            int sy,
            int width,
            int height)
Bit-block-transfer routine: copies the source rectangle [sx,sy,width,height] to the new location [dx,dy]. Binary set operation is ignored.

Parameters:
dx - X coordinate of the upper left destination corner.
dy - Y coordinate of the upper left destination corner.
sx - X coordinate of the upper left source corner.
sy - Y coordinate of the upper left source corner.
width - Rectangle width.
height - Rectangle height.