cz.cuni.jagrlib.piece
Class AlphaMatrix.AlphaMatrixEnumerator

java.lang.Object
  extended by cz.cuni.jagrlib.piece.AlphaMatrix.AlphaMatrixEnumerator
All Implemented Interfaces:
BitMaskEnumerator
Enclosing class:
AlphaMatrix

public class AlphaMatrix.AlphaMatrixEnumerator
extends java.lang.Object
implements BitMaskEnumerator

Special Enumerator for AlphaMatrix.

Since:
0.06

Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.jagrlib.BitMaskEnumerator
BitMaskEnumerator.HLine, BitMaskEnumerator.Pixel
 
Field Summary
protected  int x
          Actual X coordinate.
protected  int y
          Actual Y coordinate.
 
Fields inherited from interface cz.cuni.jagrlib.BitMaskEnumerator
MINUS_INFINITY, PLUS_INFINITY
 
Method Summary
protected  boolean findNext()
          Finds the next non-transparent pixel.
 BitMaskEnumerator.HLine nextHLine(BitMaskEnumerator.HLine pre)
          Returns the next BitMask (AlphaMask) H-line.
 BitMaskEnumerator.Pixel nextPixel(BitMaskEnumerator.Pixel pre)
          Returns the next BitMask (AlphaMask) pixel.
 void reset()
          (re-)initialization of the enumerator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected int x
Actual X coordinate.


y

protected int y
Actual Y coordinate.

Method Detail

reset

public void reset()
(re-)initialization of the enumerator.

Specified by:
reset in interface BitMaskEnumerator

findNext

protected boolean findNext()
Finds the next non-transparent pixel. Updates x and y.

Returns:
true if there are no more opaque pixels.

nextPixel

public BitMaskEnumerator.Pixel nextPixel(BitMaskEnumerator.Pixel pre)
Returns the next BitMask (AlphaMask) pixel.

Specified by:
nextPixel in interface BitMaskEnumerator
Parameters:
pre - Pre-allocated BitMaskEnumerator.Pixel instance (non-mandatory).
Returns:
The next opaque BitMaskEnumerator.Pixel or null.
See Also:
nextHLine(cz.cuni.jagrlib.BitMaskEnumerator.HLine)

nextHLine

public BitMaskEnumerator.HLine nextHLine(BitMaskEnumerator.HLine pre)
Returns the next BitMask (AlphaMask) H-line.

Specified by:
nextHLine in interface BitMaskEnumerator
Parameters:
pre - Pre-allocated BitMaskEnumerator.HLine instance (non-mandatory).
Returns:
The next opaque BitMaskEnumerator.HLine or null.
See Also:
nextPixel(cz.cuni.jagrlib.BitMaskEnumerator.Pixel)