Java Doc for ROI.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.jai.ROI

All known Subclasses:   javax.media.jai.ROIShape,
ROI
public class ROI implements Serializable(Code)
The parent class for representations of a region of interest of an image (currently only single band images with integral data types are supported). This class represents region information in image form, and can thus be used as a fallback where a Shape representation is unavailable. Where possible, subclasses such as ROIShape are used since they provide a more compact means of storage for large regions.

The getAsShape() method may be called optimistically on any instance of ROI; however, it may return null to indicate that a Shape representation of the ROI is not available. In this case, getAsImage() should be called as a fallback.

Inclusion and exclusion of pixels is defined by a threshold value. Pixel values greater than or equal to the threshold indicate inclusion.



Field Summary
transient  PlanarImagetheImage
     The PlanarImage representation of the ROI.
 intthreshold
     The inclusion/exclusion threshold of the ROI.

Constructor Summary
protected  ROI()
     The default constructor.
public  ROI(RenderedImage im)
     Constructs an ROI from a RenderedImage.
public  ROI(RenderedImage im, int threshold)
     Constructs an ROI from a RenderedImage.

Method Summary
public  ROIadd(ROI roi)
     Adds another ROI to this one and returns the result as a new ROI.
public  booleancontains(Point p)
     Returns true if the ROI contains a given Point.
Parameters:
  p - A Point identifying the pixel to be queried.
throws:
  IllegalArgumentException - if p is null.
public  booleancontains(Point2D p)
     Returns true if the ROI contains a given Point2D.
Parameters:
  p - A Point2D identifying the pixel to be queried.
throws:
  IllegalArgumentException - if p is null.
public  booleancontains(int x, int y)
     Returns true if the ROI 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  booleancontains(double x, double y)
     Returns true if the ROI contain 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  booleancontains(Rectangle rect)
     Returns true if a given Rectangle is entirely included within the ROI.
Parameters:
  rect - A Rectangle specifying the region to be testedfor inclusion.
throws:
  IllegalArgumentException - if rect is null.
public  booleancontains(Rectangle2D rect)
     Returns true if a given Rectangle2D is entirely included within the ROI.
Parameters:
  rect - A Rectangle2D specifying the region to betested for inclusion.
throws:
  IllegalArgumentException - if rect is null.
public  booleancontains(int x, int y, int w, int h)
     Returns true if a given rectangle (x, y, w, h) is entirely included within the ROI.
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  booleancontains(double x, double y, double w, double h)
     Returns true if a given rectangle (x, y, w, h) is entirely included within the ROI.
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  ROIexclusiveOr(ROI roi)
     Exclusive-ors the ROI with another ROI and returns the result as a new ROI.
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  PlanarImagegetAsImage()
     Returns a PlanarImage representation of the ROI.
public  LinkedListgetAsRectangleList(int x, int y, int width, int height)
     Returns a LinkedList of Rectangles for a given rectangular region of the ROI.
protected  LinkedListgetAsRectangleList(int x, int y, int width, int height, boolean mergeRectangles)
     Returns a LinkedList of Rectangles 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 Rectanglesare to be merged into a minimal set.
public  ShapegetAsShape()
     Returns a Shape representation of the ROI, if possible.
public  RectanglegetBounds()
     Returns the bounds of the ROI as a Rectangle.
public  Rectangle2DgetBounds2D()
     Returns the bounds of the ROI as a Rectangle2D.
public  intgetThreshold()
     Returns the inclusion/exclusion threshold value.
public  ROIintersect(ROI roi)
     Intersects the ROI with another ROI and returns the result as a new ROI.
public  booleanintersects(Rectangle rect)
     Returns true if a given Rectangle intersects the ROI.
Parameters:
  rect - A Rectangle specifying the region to be testedfor inclusion.
throws:
  IllegalArgumentException - if rect is null.
public  booleanintersects(Rectangle2D r)
     Returns true if a given Rectangle2D intersects the ROI.
Parameters:
  r - A Rectangle2D specifying the region to be testedfor inclusion.
throws:
  IllegalArgumentException - if r is null.
public  booleanintersects(int x, int y, int w, int h)
     Returns true if a given rectangular region intersects the ROI.
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  booleanintersects(double x, double y, double w, double h)
     Returns true if a given rectangular region intersects the ROI.
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.
protected static  LinkedListmergeRunLengthList(LinkedList rectList)
     Merge a LinkedList of Rectangles representing run lengths of pixels in the ROI into a minimal list wherein vertically abutting Rectangles are merged.
public  ROIperformImageOp(RenderedImageFactory RIF, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints)
     Transforms an ROI using an imaging operation.
public  ROIperformImageOp(String name, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints)
     Transforms an ROI using an imaging operation.
public  voidsetThreshold(int threshold)
     Sets the inclusion/exclusion threshold value.
public  ROIsubtract(ROI roi)
     Subtracts another ROI from this one and returns the result as a new ROI.
public  ROItransform(AffineTransform at, Interpolation interp)
     Performs an affine transformation and returns the result as a new ROI.
public  ROItransform(AffineTransform at)
     Performs an affine transformation and returns the result as a new ROI.

Field Detail
theImage
transient PlanarImage theImage(Code)
The PlanarImage representation of the ROI.



threshold
int threshold(Code)
The inclusion/exclusion threshold of the ROI.




Constructor Detail
ROI
protected ROI()(Code)
The default constructor. Using this constructor means that the subclass must override all methods that reference theImage.



ROI
public ROI(RenderedImage im)(Code)
Constructs an ROI from a RenderedImage. The inclusion threshold is taken to be halfway between the minimum and maximum sample values specified by the image's SampleModel.
Parameters:
  im - A single-banded RenderedImage.
throws:
  IllegalArgumentException - if im is null.
throws:
  IllegalArgumentException - if im does not have exactly one band



ROI
public ROI(RenderedImage im, int threshold)(Code)
Constructs an ROI from a RenderedImage. The inclusion threshold is specified explicitly.
Parameters:
  im - A single-banded RenderedImage.
Parameters:
  threshold - The desired inclusion threshold.
throws:
  IllegalArgumentException - if im is null.
throws:
  IllegalArgumentException - if im does not have exactly one band




Method Detail
add
public ROI add(ROI roi)(Code)
Adds another ROI to this one and returns the result as a new ROI. The supplied ROI will be converted to a rendered form if necessary. The bounds of the resultant ROI will be the union of the bounds of the two ROIs being merged.
Parameters:
  roi - An ROI.
throws:
  IllegalArgumentException - if roi is null. A new ROI containing the new ROI data.



contains
public boolean contains(Point p)(Code)
Returns true if the ROI contains a given Point.
Parameters:
  p - A Point identifying the pixel to be queried.
throws:
  IllegalArgumentException - if p is null. true if the pixel lies within the ROI.



contains
public boolean contains(Point2D p)(Code)
Returns true if the ROI contains a given Point2D.
Parameters:
  p - A Point2D identifying the pixel to be queried.
throws:
  IllegalArgumentException - if p is null. true if the pixel lies within the ROI.



contains
public boolean contains(int x, int y)(Code)
Returns true if the ROI 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 ROI.



contains
public boolean contains(double x, double y)(Code)
Returns true if the ROI contain 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 ROI.



contains
public boolean contains(Rectangle rect)(Code)
Returns true if a given Rectangle is entirely included within the ROI.
Parameters:
  rect - A Rectangle specifying the region to be testedfor inclusion.
throws:
  IllegalArgumentException - if rect is null. true if the rectangle is entirelycontained within the ROI.



contains
public boolean contains(Rectangle2D rect)(Code)
Returns true if a given Rectangle2D is entirely included within the ROI.
Parameters:
  rect - A Rectangle2D specifying the region to betested for inclusion.
throws:
  IllegalArgumentException - if rect is null. true if the rectangle is entirely containedwithin the ROI.



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 ROI.
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 entirely containedwithin the ROI.



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 ROI.
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 entirelycontained within the ROI.



exclusiveOr
public ROI exclusiveOr(ROI roi)(Code)
Exclusive-ors the ROI with another ROI and returns the result as a new ROI. The supplied ROI will be converted to a rendered form if necessary. The bounds of the resultant ROI will be the union of the bounds of the two ROIs being merged.
Parameters:
  roi - An ROI.
throws:
  IllegalArgumentException - if roi is null. A new ROI containing the new ROI data.



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. If the specified rectangle doesintersect with the image bounds then a nullis returned.




getAsImage
public PlanarImage getAsImage()(Code)
Returns a PlanarImage representation of the ROI. This method will always succeed. This method returns a (bilevel) image whose SampleModel is an instance of MultiPixelPackedSampleModel. The ROI as a PlanarImage.



getAsRectangleList
public LinkedList getAsRectangleList(int x, int y, int width, int height)(Code)
Returns a LinkedList of Rectangles for a given rectangular region of the ROI. The Rectangles 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 Rectangles.If the specified rectangle does intersect with the imagebounds then a null is returned.



getAsRectangleList
protected LinkedList getAsRectangleList(int x, int y, int width, int height, boolean mergeRectangles)(Code)
Returns a LinkedList of Rectangles 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 Rectanglesare to be merged into a minimal set. A LinkedList of Rectangles.If the specified rectangle does intersect with the imagebounds then a null is returned.



getAsShape
public Shape getAsShape()(Code)
Returns a Shape representation of the ROI, if possible. If none is available, null is returned. A proper instance of ROI (one that is not an instance of any subclass of ROI) will always return null. The ROI as a Shape.



getBounds
public Rectangle getBounds()(Code)
Returns the bounds of the ROI as a Rectangle.



getBounds2D
public Rectangle2D getBounds2D()(Code)
Returns the bounds of the ROI as a Rectangle2D.



getThreshold
public int getThreshold()(Code)
Returns the inclusion/exclusion threshold value.



intersect
public ROI intersect(ROI roi)(Code)
Intersects the ROI with another ROI and returns the result as a new ROI. The supplied ROI will be converted to a rendered form if necessary. The bounds of the resultant ROI will be the intersection of the bounds of the two ROIs being merged.
Parameters:
  roi - An ROI.
throws:
  IllegalArgumentException - if roi is null. A new ROI containing the new ROI data.



intersects
public boolean intersects(Rectangle rect)(Code)
Returns true if a given Rectangle intersects the ROI.
Parameters:
  rect - A Rectangle specifying the region to be testedfor inclusion.
throws:
  IllegalArgumentException - if rect is null. true if the rectangle intersects the ROI.



intersects
public boolean intersects(Rectangle2D r)(Code)
Returns true if a given Rectangle2D intersects the ROI.
Parameters:
  r - A Rectangle2D specifying the region to be testedfor inclusion.
throws:
  IllegalArgumentException - if r is null. true if the rectangle intersects the ROI.



intersects
public boolean intersects(int x, int y, int w, int h)(Code)
Returns true if a given rectangular region intersects the ROI.
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 ROI.



intersects
public boolean intersects(double x, double y, double w, double h)(Code)
Returns true if a given rectangular region intersects the ROI.
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 ROI.



mergeRunLengthList
protected static LinkedList mergeRunLengthList(LinkedList rectList)(Code)
Merge a LinkedList of Rectangles representing run lengths of pixels in the ROI into a minimal list wherein vertically abutting Rectangles are merged. The operation is effected in place.
Parameters:
  rectList - The list of run length Rectangles.
throws:
  IllegalArgumentException - if rectList is null. The merged list.



performImageOp
public ROI performImageOp(RenderedImageFactory RIF, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints)(Code)
Transforms an ROI using an imaging operation. The operation is specified by a RenderedImageFactory. The operation's ParameterBlock, minus the image source itself is supplied, along with an index indicating where to insert the ROI image. The renderHints argument allows rendering hints to be passed in.
Parameters:
  RIF - A RenderedImageFactory that will be usedto create the op.
Parameters:
  paramBlock - A ParameterBlock containing allsources and parameters for the op except for the ROI itself.
Parameters:
  sourceIndex - The index of the ParameterBlock'ssources where the ROI is to be inserted.
Parameters:
  renderHints - A RenderingHints object containingrendering hints, or null.
throws:
  IllegalArgumentException - if RIF is null.
throws:
  IllegalArgumentException - if paramBlock is null.



performImageOp
public ROI performImageOp(String name, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints)(Code)
Transforms an ROI using an imaging operation. The operation is specified by name; the default JAI registry is used to resolve this into a RIF. The operation's ParameterBlock, minus the image source itself is supplied, along with an index indicating where to insert the ROI image. The renderHints argument allows rendering hints to be passed in.
Parameters:
  name - The name of the operation to perform.
Parameters:
  paramBlock - A ParameterBlock containing allsources and parameters for the op except for the ROI itself.
Parameters:
  sourceIndex - The index of the ParameterBlock'ssources where the ROI is to be inserted.
Parameters:
  renderHints - A RenderingHints object containingrendering hints, or null.
throws:
  IllegalArgumentException - if name is null.
throws:
  IllegalArgumentException - if paramBlock is null.



setThreshold
public void setThreshold(int threshold)(Code)
Sets the inclusion/exclusion threshold value.



subtract
public ROI subtract(ROI roi)(Code)
Subtracts another ROI from this one and returns the result as a new ROI. The supplied ROI will be converted to a rendered form if necessary. The bounds of the resultant ROI will be the same as this ROI.
Parameters:
  roi - An ROI.
throws:
  IllegalArgumentException - if roi is null. A new ROI containing the new ROI data.



transform
public ROI transform(AffineTransform at, Interpolation interp)(Code)
Performs an affine transformation and returns the result as a new ROI. The transformation is performed by an "Affine" RIF using the indicated interpolation method.
Parameters:
  at - an AffineTransform specifying the transformation.
Parameters:
  interp - the Interpolation to be used.
throws:
  IllegalArgumentException - if at is null.
throws:
  IllegalArgumentException - if interp is null. a new ROI containing the transformed ROI data.



transform
public ROI transform(AffineTransform at)(Code)
Performs an affine transformation and returns the result as a new ROI. The transformation is performed by an "Affine" RIF using nearest neighbor interpolation.
Parameters:
  at - an AffineTransform specifying the transformation.
throws:
  IllegalArgumentException - if at is null. a new ROI containing the transformed ROI data.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.