| java.lang.Object javax.media.jai.ROI javax.media.jai.ROIShape
ROIShape | public class ROIShape extends ROI (Code) | | A class representing a region of interest within an image as a
Shape . Such regions are binary by definition. Using
a Shape representation allows boolean operations to be
performed quickly and with compact storage. If a
PropertyGenerator responsible for generating the
ROI property of a particular
OperationDescriptor (e.g., a warp) cannot reasonably
produce an ROIShape representing the region, it should
call getAsImage() on its sources and produce its
output ROI in image form.
|
Field Summary | |
transient Shape | theShape The internal Shape that defines this mask. |
Constructor Summary | |
public | ROIShape(Shape s) Constructs an ROIShape from a Shape. | public | ROIShape(Area a) Constructs an ROIShape from an Area. |
Method Summary | |
public ROI | add(ROI roi) Adds another mask to this one. | public boolean | contains(Point p) Returns true if the mask contains a given Point.
Parameters: p - a Point specifying the coordinates of the pixel to be queried. | public boolean | contains(Point2D p) Returns true if the mask contains a given Point2D.
Parameters: p - A Point2D specifying the coordinates of the pixelto be queried. throws: IllegalArgumentException - is p is null. | public boolean | contains(int x, int y) Returns true if the mask contains the point (x, y).
Parameters: x - An int specifying the X coordinate of the pixel to be queried. Parameters: y - An int specifying the Y coordinate of the pixel to be queried. | public boolean | contains(double x, double y) Returns true if the mask contains the point (x, y).
Parameters: x - A double specifying the X coordinate of the pixelto be queried. Parameters: y - A double specifying the Y coordinate of the pixelto be queried. | public boolean | contains(Rectangle rect) Returns true if a given Rectangle is
entirely included within the mask.
Parameters: rect - A Rectangle specifying the region tobe tested for inclusion. | public boolean | contains(Rectangle2D rect) Returns true if a given Rectangle2D
is entirely included within the mask.
Parameters: rect - A Rectangle2D specifying the region tobe tested for inclusion. | public boolean | contains(int x, int y, int w, int h) Returns true if a given rectangle (x, y, w, h) is entirely
included within the mask.
Parameters: x - The int X coordinate of the upper left corner of the region. Parameters: y - The int Y coordinate of the upper left corner of the region. Parameters: w - The int width of the region. Parameters: h - The int height of the region. | public boolean | contains(double x, double y, double w, double h) Returns true if a given rectangle (x, y, w, h) is entirely
included within the mask.
Parameters: x - The double X coordinate of the upper left corner of the region. Parameters: y - The double Y coordinate of the upper left corner of the region. Parameters: w - The double width of the region. Parameters: h - The double height of the region. | public ROI | exclusiveOr(ROI roi) Sets the mask to its exclusive-or with another mask. | public int[][] | getAsBitmask(int x, int y, int width, int height, int[][] mask) Returns a bitmask for a given rectangular region of the ROI
indicating whether the pixel is included in the region of
interest. | public PlanarImage | getAsImage() Returns the shape as a PlanarImage . | public LinkedList | getAsRectangleList(int x, int y, int width, int height) Returns a LinkedList of Rectangle s
for a given rectangular region of the ROI. | protected LinkedList | getAsRectangleList(int x, int y, int width, int height, boolean mergeRectangles) Returns a LinkedList of Rectangle s for
a given rectangular region of the ROI.
Parameters: x - The X coordinate of the upper left corner of the rectangle. Parameters: y - The Y coordinate of the upper left corner of the rectangle. Parameters: width - The width of the rectangle. Parameters: height - The height of the rectangle. Parameters: mergeRectangles - true if the Rectangle sare to be merged into a minimal set. | public Shape | getAsShape() Returns the internal Shape representation or null if a shape
representation is not possible. | public Rectangle | getBounds() Returns the bounds of the mask as a Rectangle . | public Rectangle2D | getBounds2D() Returns the bounds of the mask as a Rectangle2D . | public ROI | intersect(ROI roi) Sets the mask to its intersection with another mask. | public boolean | intersects(Rectangle r) Returns true if a given Rectangle
intersects the mask.
Parameters: r - A Rectangle specifying the region to be tested forinclusion. | public boolean | intersects(Rectangle2D r) Returns true if a given Rectangle2D
intersects the mask.
Parameters: r - A Rectangle2D specifying the region to betested for inclusion. | public boolean | intersects(int x, int y, int w, int h) Returns true if a given rectangle (x, y, w, h)
intersects the mask.
Parameters: x - The int X coordinate of the upper left corner of the region. Parameters: y - The int Y coordinate of the upper left corner of the region. Parameters: w - The int width of the region. Parameters: h - The int height of the region. | public boolean | intersects(double x, double y, double w, double h) Returns true if a given rectangle (x, y, w, h)
intersects the mask.
Parameters: x - The double X coordinate of the upper left corner of the region. Parameters: y - The double Y coordinate of the upper left corner of the region. Parameters: w - The double width of the region. Parameters: h - The double height of the region. | public ROI | subtract(ROI roi) Subtracts another mask from this one. | public ROI | transform(AffineTransform at) Transforms the current contents of the ROI by a
given AffineTransform . |
theShape | transient Shape theShape(Code) | | The internal Shape that defines this mask.
|
ROIShape | public ROIShape(Area a)(Code) | | Constructs an ROIShape from an Area.
Parameters: a - An Area. |
add | public ROI add(ROI roi)(Code) | | Adds another mask to this one.
This operation may force this mask to be rendered.
Parameters: roi - A ROI. throws: IllegalArgumentException - is roi is null. |
contains | public boolean contains(Point p)(Code) | | Returns true if the mask contains a given Point.
Parameters: p - a Point specifying the coordinates of the pixel to be queried. true if the pixel lies within the mask. throws: IllegalArgumentException - is p is null. |
contains | public boolean contains(Point2D p)(Code) | | Returns true if the mask contains a given Point2D.
Parameters: p - A Point2D specifying the coordinates of the pixelto be queried. throws: IllegalArgumentException - is p is null. true if the pixel lies within the mask. |
contains | public boolean contains(int x, int y)(Code) | | Returns true if the mask contains the point (x, y).
Parameters: x - An int specifying the X coordinate of the pixel to be queried. Parameters: y - An int specifying the Y coordinate of the pixel to be queried. true if the pixel lies within the mask. |
contains | public boolean contains(double x, double y)(Code) | | Returns true if the mask contains the point (x, y).
Parameters: x - A double specifying the X coordinate of the pixelto be queried. Parameters: y - A double specifying the Y coordinate of the pixelto be queried. true if the pixel lies within the mask. |
contains | public boolean contains(Rectangle rect)(Code) | | Returns true if a given Rectangle is
entirely included within the mask.
Parameters: rect - A Rectangle specifying the region tobe tested for inclusion. true if the rectangle isentirely contained within the mask. throws: IllegalArgumentException - is rect is null. |
contains | public boolean contains(Rectangle2D rect)(Code) | | Returns true if a given Rectangle2D
is entirely included within the mask.
Parameters: rect - A Rectangle2D specifying the region tobe tested for inclusion. true if the rectangle is entirelycontained within the mask. throws: IllegalArgumentException - is rect is null. |
contains | public boolean contains(int x, int y, int w, int h)(Code) | | Returns true if a given rectangle (x, y, w, h) is entirely
included within the mask.
Parameters: x - The int X coordinate of the upper left corner of the region. Parameters: y - The int Y coordinate of the upper left corner of the region. Parameters: w - The int width of the region. Parameters: h - The int height of the region. true if the rectangle is entirelycontained within the mask. |
contains | public boolean contains(double x, double y, double w, double h)(Code) | | Returns true if a given rectangle (x, y, w, h) is entirely
included within the mask.
Parameters: x - The double X coordinate of the upper left corner of the region. Parameters: y - The double Y coordinate of the upper left corner of the region. Parameters: w - The double width of the region. Parameters: h - The double height of the region. true if the rectangle is entirely containedwithin the mask. |
exclusiveOr | public ROI exclusiveOr(ROI roi)(Code) | | Sets the mask to its exclusive-or with another mask.
This operation may force this mask to be rendered.
Parameters: roi - A ROI. throws: IllegalArgumentException - is roi is null. |
getAsBitmask | public int[][] getAsBitmask(int x, int y, int width, int height, int[][] mask)(Code) | | Returns a bitmask for a given rectangular region of the ROI
indicating whether the pixel is included in the region of
interest. The results are packed into 32-bit integers, with
the MSB considered to lie on the left. The last entry in each
row of the result may have bits that lie outside of the
requested rectangle. These bits are guaranteed to be zeroed.
The mask array, if supplied, must be of length
equal to or greater than height and each of its
subarrays must have length equal to or greater than (width +
31)/32. If null is passed in, a suitable array
will be constructed. If the mask is non-null but has
insufficient size, an exception will be thrown.
Parameters: x - The X coordinate of the upper left corner of the rectangle. Parameters: y - The Y coordinate of the upper left corner of the rectangle. Parameters: width - The width of the rectangle. Parameters: height - The height of the rectangle. Parameters: mask - A two-dimensional array of ints at least(width + 31)/32 entries wide and (height) entries tall,or null. A reference to the mask parameter, orto a newly constructed array if mask isnull . |
getAsImage | public PlanarImage getAsImage()(Code) | | Returns the shape as a PlanarImage . This requires
performing an antialiased rendering of the internal Shape.
If the upper-left corner of the bounds of thisROIShape is (0, 0), the returned image is aBufferedImage of type TYPE_BYTE_BINARY wrapped asa PlanarImage . Otherwise, the returned image is a(bilevel) TiledImage whose SampleModel is an instance of MultiPixelPackedSampleModel . |
getAsRectangleList | public LinkedList getAsRectangleList(int x, int y, int width, int height)(Code) | | Returns a LinkedList of Rectangle s
for a given rectangular region of the ROI. The
Rectangle s in the list are merged into a minimal
set.
Parameters: x - The X coordinate of the upper left corner of the rectangle. Parameters: y - The Y coordinate of the upper left corner of the rectangle. Parameters: width - The width of the rectangle. Parameters: height - The height of the rectangle. A LinkedList of Rectangle s. |
getAsRectangleList | protected LinkedList getAsRectangleList(int x, int y, int width, int height, boolean mergeRectangles)(Code) | | Returns a LinkedList of Rectangle s for
a given rectangular region of the ROI.
Parameters: x - The X coordinate of the upper left corner of the rectangle. Parameters: y - The Y coordinate of the upper left corner of the rectangle. Parameters: width - The width of the rectangle. Parameters: height - The height of the rectangle. Parameters: mergeRectangles - true if the Rectangle sare to be merged into a minimal set. A LinkedList of Rectangle s. |
getAsShape | public Shape getAsShape()(Code) | | Returns the internal Shape representation or null if a shape
representation is not possible.
|
getBounds | public Rectangle getBounds()(Code) | | Returns the bounds of the mask as a Rectangle .
|
getBounds2D | public Rectangle2D getBounds2D()(Code) | | Returns the bounds of the mask as a Rectangle2D .
|
intersect | public ROI intersect(ROI roi)(Code) | | Sets the mask to its intersection with another mask.
This operation may force this mask to be rendered.
Parameters: roi - A ROI. throws: IllegalArgumentException - is roi is null. |
intersects | public boolean intersects(Rectangle r)(Code) | | Returns true if a given Rectangle
intersects the mask.
Parameters: r - A Rectangle specifying the region to be tested forinclusion. true if the rectangle intersects the mask. throws: IllegalArgumentException - is r is null. |
intersects | public boolean intersects(Rectangle2D r)(Code) | | Returns true if a given Rectangle2D
intersects the mask.
Parameters: r - A Rectangle2D specifying the region to betested for inclusion. true if the rectangle intersects the mask. throws: IllegalArgumentException - is r is null. |
intersects | public boolean intersects(int x, int y, int w, int h)(Code) | | Returns true if a given rectangle (x, y, w, h)
intersects the mask.
Parameters: x - The int X coordinate of the upper left corner of the region. Parameters: y - The int Y coordinate of the upper left corner of the region. Parameters: w - The int width of the region. Parameters: h - The int height of the region. true if the rectangle intersects the mask. |
intersects | public boolean intersects(double x, double y, double w, double h)(Code) | | Returns true if a given rectangle (x, y, w, h)
intersects the mask.
Parameters: x - The double X coordinate of the upper left corner of the region. Parameters: y - The double Y coordinate of the upper left corner of the region. Parameters: w - The double width of the region. Parameters: h - The double height of the region. true if the rectangle intersects the mask. |
subtract | public ROI subtract(ROI roi)(Code) | | Subtracts another mask from this one.
This operation may force this mask to be rendered.
Parameters: roi - A ROI. throws: IllegalArgumentException - is roi is null. |
Methods inherited from javax.media.jai.ROI | public ROI add(ROI roi)(Code)(Java Doc) public boolean contains(Point p)(Code)(Java Doc) public boolean contains(Point2D p)(Code)(Java Doc) public boolean contains(int x, int y)(Code)(Java Doc) public boolean contains(double x, double y)(Code)(Java Doc) public boolean contains(Rectangle rect)(Code)(Java Doc) public boolean contains(Rectangle2D rect)(Code)(Java Doc) public boolean contains(int x, int y, int w, int h)(Code)(Java Doc) public boolean contains(double x, double y, double w, double h)(Code)(Java Doc) public ROI exclusiveOr(ROI roi)(Code)(Java Doc) public int[][] getAsBitmask(int x, int y, int width, int height, int[][] mask)(Code)(Java Doc) public PlanarImage getAsImage()(Code)(Java Doc) public LinkedList getAsRectangleList(int x, int y, int width, int height)(Code)(Java Doc) protected LinkedList getAsRectangleList(int x, int y, int width, int height, boolean mergeRectangles)(Code)(Java Doc) public Shape getAsShape()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public Rectangle2D getBounds2D()(Code)(Java Doc) public int getThreshold()(Code)(Java Doc) public ROI intersect(ROI roi)(Code)(Java Doc) public boolean intersects(Rectangle rect)(Code)(Java Doc) public boolean intersects(Rectangle2D r)(Code)(Java Doc) public boolean intersects(int x, int y, int w, int h)(Code)(Java Doc) public boolean intersects(double x, double y, double w, double h)(Code)(Java Doc) protected static LinkedList mergeRunLengthList(LinkedList rectList)(Code)(Java Doc) public ROI performImageOp(RenderedImageFactory RIF, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints)(Code)(Java Doc) public ROI performImageOp(String name, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints)(Code)(Java Doc) public void setThreshold(int threshold)(Code)(Java Doc) public ROI subtract(ROI roi)(Code)(Java Doc) public ROI transform(AffineTransform at, Interpolation interp)(Code)(Java Doc) public ROI transform(AffineTransform at)(Code)(Java Doc)
|
|
|