cz.cuni.jagrlib.iface
Interface AlphaMask

All Superinterfaces:
BitMask, BitMaskCore, Property
All Known Implementing Classes:
AlphaMatrix

public interface AlphaMask
extends BitMask

Bit-mask interface with alpha-channel capability (representation of pixel set in 2D plane).

Since:
0.01
See Also:
AlphaMask.java

Field Summary
 
Fields inherited from interface cz.cuni.jagrlib.iface.BitMask
HEIGHT, WIDTH
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 double getAlpha(int x, int y)
          Returns the pixel's value.
 void getHLine(int x1, int x2, int y, double[] alpha)
          Returns the pixels' values for the given horizontal line.
 void getRectangle(int x1, int y1, int x2, int y2, double[][] alpha)
          Returns the pixels' values for the given rectangle.
 void putHLine(int x1, int x2, int y, double[] alpha)
          Sets the horizontal line's values.
 void putPixel(int x, int y, double alpha)
          Sets the given pixel's value to alpha.
 void putRectangle(int x1, int y1, int x2, int y2, double[][] alpha)
          Sets the rectangle's values.
 void setAlpha(double alpha)
          Sets the current default alpha - for inherited methods.
 int setAlphaOperation(int _op)
          Sets the alpha-channel operation (used in all set*() methods).
 void setHLine(int x1, int x2, int y, double alpha)
          Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y-1].
 void setRectangle(int x1, int y1, int x2, int y2, double alpha)
          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.BitMask
bitBlt, getHLine, getRectangle, putHLine, putPixel, putRectangle, setOperation, setRectangle
 
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
 

Method Detail

setAlphaOperation

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

Parameters:
_op - Alpha-channel operation (AlphaOperation.ALPHA_* constant).
Returns:
The old alpha-channel operation.
See Also:
Alpha-channel operations

setAlpha

void setAlpha(double alpha)
Sets the current default alpha - for inherited methods.

Parameters:
alpha - Opacity factor (between 0.0 and 1.0).

putPixel

void putPixel(int x,
              int y,
              double alpha)
Sets the given pixel's value to alpha.

Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
alpha - Opacity factor (between 0.0 and 1.0).

getAlpha

double getAlpha(int x,
                int y)
Returns the pixel's value.

Parameters:
x - X coordinate of a pixel.
y - Y coordinate of a pixel.
Returns:
Pixel opacity (0.0 for off-canvas access).

setHLine

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

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.
alpha - Opacity factor (between 0.0 and 1.0).

putHLine

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

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.
alpha - Opacity factors (between 0.0 and 1.0).

getHLine

void getHLine(int x1,
              int x2,
              int y,
              double[] alpha)
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.
alpha - Returned values in double[] array (0.0 for off-canvas access).

setRectangle

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

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).
alpha - Opacity factor (between 0.0 and 1.0).

putRectangle

void putRectangle(int x1,
                  int y1,
                  int x2,
                  int y2,
                  double[][] alpha)
Sets the rectangle's values.

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).
alpha - Opacity factors (between 0.0 and 1.0).

getRectangle

void getRectangle(int x1,
                  int y1,
                  int x2,
                  int y2,
                  double[][] alpha)
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).
alpha - Returned values in double[][] array (0.0 for off-canvas access).