|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.AlphaMatrix
public class AlphaMatrix
Alpha-mask represented by simple rectangular matrix.
| Nested Class Summary | |
|---|---|
class |
AlphaMatrix.AlphaMatrixEnumerator
Special Enumerator for AlphaMatrix. |
| Field Summary | |
|---|---|
protected byte |
ALPHA_MAX
Maximum alpha-value (total opaqueness). |
protected int |
ALPHA_RANGE
Alpha-value range. |
protected byte |
ALPHA_ZERO
Minimum alpha-value (total transparency). |
protected int |
alphaOp
Actual alpha-channel operation (not used yet). |
protected int |
binaryOp
Actual binary set operation (not used yet). |
protected static java.lang.String |
CATEGORY
Object category. |
protected byte |
currentAlpha
Current alpha-value (for BitMask-inherited routines. |
protected byte[][] |
data
2D array of alpha-values. |
static RegPiece |
reg
Static registration instance for this class. |
protected int |
setHeight
Height of the domain in pixels. |
protected int |
setWidth
Width of the domain in pixels. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
protected int |
xMax
Maximum x-coordinate + 1. |
protected int |
xMin
Minimum x-coordinate. |
protected int |
yMax
Maximum scanline coordinate + 1. |
protected int |
yMin
Minimum scanline coordinate. |
| Fields inherited from class cz.cuni.jagrlib.Piece |
|---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
| Fields inherited from interface cz.cuni.jagrlib.iface.BitMask |
|---|
HEIGHT, WIDTH |
| Fields inherited from interface cz.cuni.jagrlib.iface.Property |
|---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
| Constructor Summary | |
|---|---|
AlphaMatrix()
|
|
| Method Summary | |
|---|---|
protected void |
assertXY(int x,
int y)
Asserts that the given point [x,y] is included in the set. |
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 |
commit()
Commits all previous changes to the internal object state. |
protected byte |
composeAlpha(int A,
int B)
Realizes the alpha-channel composition. |
BitMaskEnumerator |
enumerator()
BitMask enumeration. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
double |
getAlpha(int x,
int y)
Returns the pixel's value. |
void |
getHLine(int x1,
int x2,
int y,
boolean[] values)
Returns the pixels' values for the given horizontal line. |
void |
getHLine(int x1,
int x2,
int y,
double[] alpha)
Returns the pixels' values for the given horizontal line. |
boolean |
getPixel(int x,
int y)
Returns the pixel's value. |
void |
getRectangle(int x1,
int y1,
int x2,
int y2,
boolean[][] values)
Returns the pixels' values for the given rectangle. |
void |
getRectangle(int x1,
int y1,
int x2,
int y2,
double[][] alpha)
Returns the pixels' values for the given rectangle. |
void |
init()
AlphaMatrix re-initialization (keeps current bitmask size - if the size is relevant). |
void |
init(int x,
int y)
AlphaMatrix (re-)initialization. |
protected void |
initMatrix()
(Re-)initializes the whole "data" matrix. |
void |
putHLine(int x1,
int x2,
int y,
boolean[] values)
Sets the horizontal line'a values. |
void |
putHLine(int x1,
int x2,
int y,
double[] alpha)
Sets the horizontal line's values. |
void |
putPixel(int x,
int y,
boolean value)
Sets the given pixel's value. |
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,
boolean[][] values)
Sets the rectangle's values. |
void |
putRectangle(int x1,
int y1,
int x2,
int y2,
double[][] alpha)
Sets the rectangle's values. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
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)
Sets the horizontal line from [min(x1,x2),y] to [max(x1,x2)-1,y]. |
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]. |
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 to true = "painted". |
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 alpha)
Sets the rectangle from [min(x1,x2),min(y1,y2)] to [max(x1,x2)-1,max(y1,y2)-1]. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
| 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, 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 |
|---|
protected final byte ALPHA_ZERO
protected final byte ALPHA_MAX
protected final int ALPHA_RANGE
protected int setWidth
protected int setHeight
protected int xMin
protected int xMax
protected int yMin
protected int yMax
protected byte[][] data
protected byte currentAlpha
protected int binaryOp
protected int alphaOp
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
| Constructor Detail |
|---|
public AlphaMatrix()
| Method Detail |
|---|
protected void initMatrix()
protected void assertXY(int x,
int y)
x - X coordinate to be included.y - Y coordinate to be included.
protected final byte composeAlpha(int A,
int B)
A - Original (old) alpha-value.B - Assigned (new) alpha-value.
public void init(int x,
int y)
init in interface BitMaskCorex - Width of a new bitmask.y - Height of a new bitmask.public void init()
init in interface BitMaskCorepublic int setOperation(int _op)
setOperation in interface BitMask_op - Binary set operation (BinaryOperation.BIN_OP_* constant).
Binary operationspublic int setAlphaOperation(int _op)
setAlphaOperation in interface AlphaMask_op - Alpha-channel operation (AlphaOperation.ALPHA_* constant).
Alpha-channel operations
public void setPixel(int x,
int y)
setPixel in interface BitMaskCorex - X coordinate of a pixel.y - Y coordinate of a pixel.
public void putPixel(int x,
int y,
boolean value)
putPixel in interface BitMaskx - X coordinate of a pixel.y - Y coordinate of a pixel.value - New pixel's value.
public boolean getPixel(int x,
int y)
getPixel in interface BitMaskCorex - X coordinate of a pixel.y - Y coordinate of a pixel.
public void setHLine(int x1,
int x2,
int y)
setHLine in interface BitMaskCorex1 - X coordinate of the starting pixel.x2 - X coordinate of the first pixel after the line.y - Common Y coordinate of the line.
public void putHLine(int x1,
int x2,
int y,
boolean[] values)
putHLine in interface BitMaskx1 - 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.
public void getHLine(int x1,
int x2,
int y,
boolean[] values)
getHLine in interface BitMaskx1 - 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).
public void setRectangle(int x1,
int y1,
int x2,
int y2)
setRectangle in interface BitMaskx1 - 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).
public void putRectangle(int x1,
int y1,
int x2,
int y2,
boolean[][] values)
putRectangle in interface BitMaskx1 - 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.
public void getRectangle(int x1,
int y1,
int x2,
int y2,
boolean[][] values)
getRectangle in interface BitMaskx1 - 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).
public void bitBlt(int dx,
int dy,
int sx,
int sy,
int width,
int height)
bitBlt in interface BitMaskdx - 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.public BitMaskEnumerator enumerator()
BitMask enumeration.
enumerator in interface BitMaskCorepublic void setAlpha(double alpha)
setAlpha in interface AlphaMaskalpha - Opacity factor (between 0.0 and 1.0).
public void putPixel(int x,
int y,
double alpha)
putPixel in interface AlphaMaskx - X coordinate of a pixel.y - Y coordinate of a pixel.alpha - Opacity factor (between 0.0 and 1.0).
public double getAlpha(int x,
int y)
getAlpha in interface AlphaMaskx - X coordinate of a pixel.y - Y coordinate of a pixel.
public void setHLine(int x1,
int x2,
int y,
double alpha)
setHLine in interface AlphaMaskx1 - 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).
public void putHLine(int x1,
int x2,
int y,
double[] alpha)
putHLine in interface AlphaMaskx1 - 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).
public void getHLine(int x1,
int x2,
int y,
double[] alpha)
getHLine in interface AlphaMaskx1 - 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).
public void setRectangle(int x1,
int y1,
int x2,
int y2,
double alpha)
setRectangle in interface AlphaMaskx1 - 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).
public void putRectangle(int x1,
int y1,
int x2,
int y2,
double[][] alpha)
putRectangle in interface AlphaMaskx1 - 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).
public void getRectangle(int x1,
int y1,
int x2,
int y2,
double[][] alpha)
getRectangle in interface AlphaMaskx1 - 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).
public void set(java.lang.String key,
java.lang.Object value)
set in interface Propertyset in class DefaultPropertykey - Key string.value - The new value.Property.commit()public java.lang.Object get(java.lang.String key)
get in interface Propertyget in class DefaultPropertykey - Key string.
public void commit()
commit in interface Propertycommit in class DefaultProperty
public static int setTemplate(Template t,
int ord)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||