org.jaitools.imageutils
Class FillResult

java.lang.Object
  extended by org.jaitools.imageutils.FillResult

public class FillResult
extends Object

This class is used by the RegionalizeOpImage and FloodFiller to record data describing an image region that has just been flood-filled.

Although public, it is not intended for general use unless you are modifying or sub-classing the flood fill classes.

Since:
1.0
Version:
$Id$
Author:
Michael Bedward

Constructor Summary
FillResult(int id, double value, List<FloodFiller.ScanSegment> segments)
          Constructor.
 
Method Summary
 boolean contains(int x, int y)
          Checks if this region contains the given location.
 void expand(FillResult other)
          Merges the given region into this region.
 Rectangle getBounds()
          Gets the bounds of this region.
 int getID()
          Gets the ID of this region.
 int getNumPixels()
          Gets the number of pixels within this region.
 double getValue()
          Gets the reference value of this region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FillResult

public FillResult(int id,
                  double value,
                  List<FloodFiller.ScanSegment> segments)
Constructor. Takes ownership of the list of segments.

Parameters:
id - unique ID assigned to this region
value - representative value of pixels in this region
segments - list of line segments making up this region
Method Detail

contains

public boolean contains(int x,
                        int y)
Checks if this region contains the given location.

Parameters:
x - X ordinate
y - Y ordinate
Returns:
true if the region contains the location; false otherwise

expand

public void expand(FillResult other)
Merges the given region into this region.

At present, this method doesn't bother about merging scan segments, it just adds the other region's segments and updates the index and bounds as necessary.

Parameters:
other - other region

getID

public int getID()
Gets the ID of this region.

Returns:
integer ID

getBounds

public Rectangle getBounds()
Gets the bounds of this region.

Returns:
a new rectangle

getNumPixels

public int getNumPixels()
Gets the number of pixels within this region.

Returns:
number of pixels

getValue

public double getValue()
Gets the reference value of this region. This is the value of the start pixel used in the regionalize operation.

Returns:
reference value


Copyright © 2009-2013. All Rights Reserved.