Java Doc for PlanarImage.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.PlanarImage

All known Subclasses:   javax.media.jai.OpImage,  javax.media.jai.remote.PlanarImageServerProxy,  com.sun.media.jai.imageioimpl.PixelReplacementImage,  javax.media.jai.RenderedImageAdapter,  javax.media.jai.TiledImage,  javax.media.jai.RenderedOp,  javax.media.jai.RemoteImage,  ca.forklabs.media.jai.RasterAdapter,
PlanarImage
abstract public class PlanarImage implements ImageJAI,RenderedImage(Code)
A RenderedImage is expressed as a collection of pixels. A pixel is defined as a 1-by-1 square; its origin is the top-left corner of the square (0, 0), and its energy center is located at the center of the square (0.5, 0.5).

This is the fundamental base class of Java Advanced Imaging (JAI) that represents a two-dimensional RenderedImage.

This class provides a home for the information and functionalities common to all the JAI classes that implement the RenderedImage interface, such as the image's layout, sources, properties, etc. The image layout, sources, and properties may be set either at construction or subsequently using one of the mutator methods supplied for the respective attribute. In general this class does not perform sanity checking on the state of its variables so it is very important that subclasses set them correctly. This is of particular importance with respect to the image layout.

The layout of a PlanarImage is specified by variables minX, minY, width, height, tileGridXOffset, tileGridYOffset, tileWidth, tileHeight, sampleModel, and colorModel. These variables do not have any default settings so subclasses must set the appropriate ones at construction via the ImageLayout argument or subsequently using setImageLayout(). Otherwise, unexpected errors may occur. Although these variables have protected access, it is strongly recommended that subclasses not set the values of these variables directly but rather via setImageLayout() which performs a certain few initializations based on the layout values. The variables are defined to have protected access for convenience.

A PlanarImage may have any number of RenderedImage sources or no source at all.

All non-JAI RenderedImage instances must be converted into PlanarImages by means of the RenderedImageAdapter and WritableRenderedImageAdapter classes. The wrapRenderedImage method provides a convenient interface to both add a wrapper and take a snapshot if the image is writable. All of the PlanarImage constructors perform this wrapping automatically. Images that already extend PlanarImage will be returned unchanged by wrapRenderedImage; that is, it is idempotent.

Going in the other direction, existing code that makes use of the RenderedImage interface will be able to use PlanarImages directly, without any changes or recompilation. Therefore, within JAI, two-dimensional images are returned from methods as PlanarImages, even though incoming RenderedImages are accepted as arguments directly.

A PlanarImage may also have any number of properties of any type. If or how a property is used depends on the individual subclass. This class only stores the property information. If any PropertyChangeListeners are registered they will receive a PropertySourceChangeEvent for each change in an image property.

In general, methods in this class are implemented such that they use any class variables directly instead of through their accessors for performance reasons. Subclasses need to be careful when overriding this class' variable accessors that other appropriate methods are overriden as well.

PlanarImage implements a createSnapshot method that produces a new, immutable image with a copy of this image's current contents. In practice, this snapshot is only a virtual copy; it is managed by the SnapshotImage class in such a way as to minimize copying and memory footprint generally. Multiple calls to createSnapshot make use of a single SnapshotImage per PlanarImage in order to centralize version management. These mechanisms are transparent to the API user and are discussed here only for edification.

The source and sink lists have the effect of creating a graph structure between a set of PlanarImages. Note that the practice of making such bidirectional connections between images means that the garbage collector will not inform us when all user references to a node are lost, since there will still be internal references up until the point where the entire graph is detached from user space. A solution is available in the form of Reference Objects; see http://java.sun.com/j2se/1.5.0/docs/guide/refobs/ for more information. These classes include weak references that allow the Garbage Collector (GC) to collect objects they reference, setting the reference to null in the process.

The reference problem requires us to be careful about how we define the reachability of directed acyclic graph (DAG) nodes. If we were to allow nodes to be reached by arbitrary graph traversal, we would be unable to garbage collect any subgraphs of an active graph at all since any node may be reached from any other. Instead, we define the set of reachable nodes as those that may be accessed directly from a reference in user code, or that are the source (not sink) of a reachable node. Reachable nodes are always accessible, whether they are reached by traversing upwards or downwards in the DAG.

A DAG may also contain nodes that are not reachable, that is, they require a downward traversal at some point. For example, assume a node A is reachable, and a call to A.getSinks() yields a Vector containing a reference to a previously unreachable node B. The node B naturally becomes reachable by virtue of the new user reference pointing to it. However, if the user were to relinquish that reference, the node might be garbage collected, and a future call to A.getSinks() might no longer include B in its return value.

Because the set of sinks of a node is inherently unstable, only the getSinks method is provided for external access to the sink vector at a node. A hypothetical method such as getSink or getNumSinks would produce confusing results should a sink be garbage collected between that call and a subsequent call to getSinks.
See Also:   java.awt.image.RenderedImage
See Also:   java.lang.ref.Reference
See Also:   java.lang.ref.WeakReference
See Also:   ImageJAI
See Also:   OpImage
See Also:   RenderedImageAdapter
See Also:   SnapshotImage
See Also:   TiledImage



Field Summary
protected  ColorModelcolorModel
     The image's ColorModel.
protected  PropertyChangeSupportJAIeventManager
     A helper object to manage firing events.
protected  intheight
     The image's height in number of pixels.
protected  intminX
     The X coordinate of the image's top-left pixel.
protected  intminY
     The Y coordinate of the image's top-left pixel.
protected  WritablePropertySourceImplproperties
     A helper object to manage the image properties.
protected  SampleModelsampleModel
     The image's SampleModel.
protected  TileFactorytileFactory
     A TileFactory for use in PlanarImage.createWritableRaster(SampleModel,Point) .
protected  inttileGridXOffset
     The X coordinate of the top-left pixel of tile (0, 0).
protected  inttileGridYOffset
     The Y coordinate of the top-left pixel of tile (0, 0).
protected  inttileHeight
     The height of a tile in number of pixels.
protected  inttileWidth
     The width of a tile in number of pixels.
protected  intwidth
     The image's width in number of pixels.

Constructor Summary
public  PlanarImage()
     The default constructor.
public  PlanarImage(ImageLayout layout, Vector sources, Map properties)
     Constructor.

The image's layout is encapsulated in the layout argument.


Method Summary
public static  intXToTileX(int x, int tileGridXOffset, int tileWidth)
     Converts a pixel's X coordinate into a horizontal tile index relative to a given tile grid layout specified by its X offset and tile width.

If tileWidth < 0, the results of this method are undefined.

public  intXToTileX(int x)
     Converts a pixel's X coordinate into a horizontal tile index. No attempt is made to detect out-of-range coordinates.

This method is implemented in terms of the static method XToTileX() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.
Parameters:
  x - the X coordinate of a pixel.

public static  intYToTileY(int y, int tileGridYOffset, int tileHeight)
     Converts a pixel's Y coordinate into a vertical tile index relative to a given tile grid layout specified by its Y offset and tile height.

If tileHeight < 0, the results of this method are undefined.

public  intYToTileY(int y)
     Converts a pixel's Y coordinate into a vertical tile index.
public  voidaddPropertyChangeListener(PropertyChangeListener listener)
     Add a PropertyChangeListener to the listener list.
public  voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)
     Add a PropertyChangeListener for a specific property.
public synchronized  booleanaddSink(Object sink)
     Adds an Object sink to the list of sinks.
protected  voidaddSink(PlanarImage sink)
     Adds a PlanarImage sink to the list of sinks.
protected  voidaddSource(Object source)
     Adds an Object source to the list of sources. If the source is a RenderedImage it is wrapped using wrapRenderedImage().
public synchronized  voidaddTileComputationListener(TileComputationListener listener)
     Adds a TileComputationListener to the list of registered TileComputationListeners.
public  voidcancelTiles(TileRequest request, Point[] tileIndices)
     Issue an advisory cancellation request to nullify processing of the indicated tiles.
public  WritableRastercopyData()
     Copies the entire image into a single raster.
public  WritableRastercopyData(WritableRaster raster)
     Copies an arbitrary rectangular region of this image's pixel data into a caller-supplied WritableRaster. The region to be copied is defined as the boundary of the WritableRaster, which can be obtained by calling WritableRaster.getBounds().

The supplied WritableRaster may have a region that extends beyond this image's boundary, in which case only pixels in the part of the region that intersects this image are copied.

public  voidcopyExtendedData(WritableRaster dest, BorderExtender extender)
     Copies an arbitrary rectangular region of the RenderedImage into a caller-supplied WritableRaster.
public static  ColorModelcreateColorModel(SampleModel sm)
     Creates a ColorModel that may be used with the specified SampleModel.
public  PlanarImagecreateSnapshot()
     Creates a snapshot, that is, a virtual copy of the image's current contents.
final protected  WritableRastercreateWritableRaster(SampleModel sampleModel, Point location)
     Creates a WritableRaster with the specified SampleModel and location.
public synchronized  voiddispose()
     Provides a hint that an image will no longer be accessed from a reference in user space.
protected  voidfinalize()
     Performs cleanup prior to garbage collection.
public  BufferedImagegetAsBufferedImage(Rectangle rect, ColorModel cm)
     Returns a copy of this image as a BufferedImage. A subarea of the image may be copied by supplying a Rectangle parameter; if it is set to null, the entire image is copied.
public  BufferedImagegetAsBufferedImage()
     Returns a copy of the entire image as a BufferedImage.
public  RectanglegetBounds()
     Returns the image's bounds as a Rectangle.

The image's bounds are defined by the values returned by getMinX(), getMinY(), getWidth(), and getHeight(). A Rectangle is created based on these four methods and cached in this class.

public  ColorModelgetColorModel()
     Returns the ColorModel of the image.
public  RastergetData()
     Returns the entire image in a single Raster.
public  RastergetData(Rectangle region)
     Returns a specified region of this image in a Raster.

The returned Raster is semantically a copy. This means that subsequent updates to this image will not be reflected in the returned Raster.

public static  ColorModelgetDefaultColorModel(int dataType, int numBands)
     Returns a ComponentColorModel created based on the indicated dataType and numBands.
public  RastergetExtendedData(Rectangle region, BorderExtender extender)
     Returns a copy of an arbitrary rectangular region of this image in a Raster.
public  GraphicsgetGraphics()
     Returns a Graphics object that may be used to draw into this image.
public  intgetHeight()
     Returns the height of the image in number of pixels.
public  ObjectgetImageID()
     Returns a unique identifier (UID) for this PlanarImage.
public  intgetMaxTileX()
     Returns the horizontal index of the right-most column of tiles.
public  intgetMaxTileY()
     Returns the vertical index of the bottom-most row of tiles.
public  intgetMaxX()
     Returns the X coordinate of the column immediately to the right of the right-most column of the image.
public  intgetMaxY()
     Returns the Y coordinate of the row immediately below the bottom-most row of the image.
public  intgetMinTileX()
     Returns the horizontal index of the left-most column of tiles.
public  intgetMinTileY()
     Returns the vertical index of the top-most row of tiles.
public  intgetMinX()
     Returns the X coordinate of the left-most column of the image.
public  intgetMinY()
     Returns the Y coordinate of the top-most row of the image.
public  intgetNumBands()
     Retrieve the number of image bands.
public  intgetNumSources()
     Returns the number of immediate PlanarImage sources this image has.
public  intgetNumXTiles()
     Returns the number of tiles along the tile grid in the horizontal direction.
public  intgetNumYTiles()
     Returns the number of tiles along the tile grid in the vertical direction.
protected  HashtablegetProperties()
     Returns the internal Hashtable containing the image properties by reference.
public  ObjectgetProperty(String name)
     Gets a property from the property set of this image.
public  ClassgetPropertyClass(String name)
     Returns the class expected to be returned by a request for the property with the specified name.
public  String[]getPropertyNames()
     Returns a list of property names that are recognized by this image or null if none are recognized.
public  String[]getPropertyNames(String prefix)
     Returns an array of Strings recognized as names by this property source that begin with the supplied prefix.
public  SampleModelgetSampleModel()
     Returns the SampleModel of the image.
public  VectorgetSinks()
     Returns a Vector containing the currently available PlanarImage sinks of this image (images for which this image is a source), or null if no sinks are present.

Sinks are stored using weak references.

public  PlanarImagegetSource(int index)
     Returns the immediate source indicated by the index.
public  PlanarImagegetSourceImage(int index)
     Returns the immediate source indicated by the index.
public  ObjectgetSourceObject(int index)
     Returns the immediate source indicated by the index.
public  VectorgetSources()
     Returns this image's immediate source(s) in a Vector.
public  voidgetSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)
     Within a given rectangle, store the list of tile seams of both X and Y directions into the corresponding split sequence.
abstract public  RastergetTile(int tileX, int tileY)
     Returns tile (tileX, tileY) as a Raster.
public  TileComputationListener[]getTileComputationListeners()
     Retrieves a snapshot of the set of all registered TileComputationListeners as of the moment this method is invoked.
public  TileFactorygetTileFactory()
     Returns the value of the instance variable tileFactory.
public  intgetTileGridXOffset()
     Returns the X coordinate of the top-left pixel of tile (0, 0).
public  intgetTileGridYOffset()
     Returns the Y coordinate of the top-left pixel of tile (0, 0).
public  intgetTileHeight()
     Returns the height of a tile of this image in number of pixels.
public  Point[]getTileIndices(Rectangle region)
     Returns an array containing the indices of all tiles which overlap the specified Rectangle.
public  RectanglegetTileRect(int tileX, int tileY)
     Returns a Rectangle indicating the active area of a given tile.
public  intgetTileWidth()
     Returns the width of a tile of this image in number of pixels.
public  Raster[]getTiles(Point[] tileIndices)
     Returns the Rasters indicated by the tileIndices array.
public  Raster[]getTiles()
     Computes and returns all tiles in the image.
public  intgetWidth()
     Returns the width of the image in number of pixels.
public  booleanoverlapsMultipleTiles(Rectangle rect)
     Returns true if and only if the intersection of the specified Rectangle with the image bounds overlaps more than one tile.
public  voidprefetchTiles(Point[] tileIndices)
     Hints that the given tiles might be needed in the near future. Some implementations may spawn a thread or threads to compute the tiles while others may ignore the hint.

The TileScheduler of the default instance of the JAI class is used to prefetch the tiles.

public  TileRequestqueueTiles(Point[] tileIndices)
     Queues a list of tiles for computation.
public  voidremoveProperty(String name)
     Removes the named property from the PlanarImage.
public  voidremovePropertyChangeListener(PropertyChangeListener listener)
     Remove a PropertyChangeListener from the listener list.
public  voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)
     Remove a PropertyChangeListener for a specific property.
public synchronized  booleanremoveSink(Object sink)
     Removes an Object sink from the list of sinks.
protected  booleanremoveSink(PlanarImage sink)
     Removes a PlanarImage sink from the list of sinks.
Parameters:
  sink - A PlanarImage sink to be removed.
public  voidremoveSinks()
     Removes all the sinks of this image.
protected  booleanremoveSource(Object source)
     Removes an Object source from the list of sources. If the source is a PlanarImage then this image is removed from its list of sinks.
Parameters:
  source - The Object source to be removed.
protected  voidremoveSources()
     Removes all the sources of this image.
public synchronized  voidremoveTileComputationListener(TileComputationListener listener)
     Removes a TileComputationListener from the list of registered TileComputationListeners.
protected  voidsetImageLayout(ImageLayout layout)
     Sets the image bounds, tile grid layout, SampleModel and ColorModel using values from an ImageLayout object.

If either of the tile dimensions is not set in the passed in ImageLayout object, then the tile dimension in question will be set to the corresponding image dimension.

If either of the tile grid offsets is not set in the passed in ImageLayout object, then the tile grid offset in question will be set to 0.

protected  voidsetProperties(Hashtable properties)
     Sets the Hashtable containing the image properties to a given Hashtable.
public  voidsetProperty(String name, Object value)
     Sets a property on a PlanarImage.
protected  voidsetSource(Object source, int index)
     Sets an immediate source of this image.
protected  voidsetSources(List sourceList)
     Sets the list of sources from a given List of PlanarImages.
public static  inttileXToX(int tx, int tileGridXOffset, int tileWidth)
     Converts a horizontal tile index into the X coordinate of its upper left pixel relative to a given tile grid layout specified by its X offset and tile width.
public  inttileXToX(int tx)
     Converts a horizontal tile index into the X coordinate of its upper left pixel.
public static  inttileYToY(int ty, int tileGridYOffset, int tileHeight)
     Converts a vertical tile index into the Y coordinate of its upper left pixel relative to a given tile grid layout specified by its Y offset and tile height.
public  inttileYToY(int ty)
     Converts a vertical tile index into the Y coordinate of its upper left pixel.
public  StringtoString()
     Returns a String which includes the basic information of this image.
public static  PlanarImagewrapRenderedImage(RenderedImage image)
     Wraps an arbitrary RenderedImage to produce a PlanarImage.

Field Detail
colorModel
protected ColorModel colorModel(Code)
The image's ColorModel.



eventManager
protected PropertyChangeSupportJAI eventManager(Code)
A helper object to manage firing events.
since:
   JAI 1.1



height
protected int height(Code)
The image's height in number of pixels.



minX
protected int minX(Code)
The X coordinate of the image's top-left pixel.



minY
protected int minY(Code)
The Y coordinate of the image's top-left pixel.



properties
protected WritablePropertySourceImpl properties(Code)
A helper object to manage the image properties.
since:
   JAI 1.1



sampleModel
protected SampleModel sampleModel(Code)
The image's SampleModel.



tileFactory
protected TileFactory tileFactory(Code)
A TileFactory for use in PlanarImage.createWritableRaster(SampleModel,Point) . This field will be null unless initialized via the configuration properties passed to PlanarImage.PlanarImage(ImageLayout,Vector,Map) .
since:
   JAI 1.1.2



tileGridXOffset
protected int tileGridXOffset(Code)
The X coordinate of the top-left pixel of tile (0, 0).



tileGridYOffset
protected int tileGridYOffset(Code)
The Y coordinate of the top-left pixel of tile (0, 0).



tileHeight
protected int tileHeight(Code)
The height of a tile in number of pixels.



tileWidth
protected int tileWidth(Code)
The width of a tile in number of pixels.



width
protected int width(Code)
The image's width in number of pixels.




Constructor Detail
PlanarImage
public PlanarImage()(Code)
The default constructor.

The eventManager and properties helper fields are initialized by this constructor; no other non-private fields are set.




PlanarImage
public PlanarImage(ImageLayout layout, Vector sources, Map properties)(Code)
Constructor.

The image's layout is encapsulated in the layout argument. Note that no verification is performed to determine whether the image layout has been set either at construction or subsequently.

This constructor does not provide any default settings for the layout variables so all of those that will be used later must be set in the layout argument or subsequently via setImageLayout() before the values are used. Otherwise, unexpected errors may occur.

If the SampleModel is non-null and the supplied tile dimensions are positive, then if the dimensions of the supplied SampleModel differ from the tile dimensions, a new SampleModel will be created for the image from the supplied SampleModel but with dimensions equal to those of a tile.

If both the SampleModel and the ColorModel in the supplied ImageLayout are non-null they will be tested for compatibility. If the test fails an exception will be thrown. The test is that

  • ColorModel.isCompatibleSampleModel() invoked on the SampleModel must return true, and
  • if the ColorModel is a ComponentColorModel then:
    • the number of bands of the SampleModel must equal the number of components of the ColorModel, and
    • SampleModel.getSampleSize(b) >= ColorModel.getComponentSize(b) for all bands b.

The sources parameter contains a list of immediate sources of this image none of which may be null. All RenderedImages in the list are automatically converted into PlanarImages when necessary. If this image has no source, this argument should be null.

The properties parameter contains a mapping of image properties. All map entries which have a key which is either a String or a CaselessStringKey are interpreted as image properties and will be copied to the property database of this image. This parameter may be null.

If a TileFactory -valued mapping of the key JAI.KEY_TILE_FACTORY is present in properties, then set the instance variable tileFactory to the specified TileFactory. This TileFactory will be used by PlanarImage.createWritableRaster(SampleModel,Point) to create Rasters, notably in PlanarImage.getData(Rectangle) , PlanarImage.copyData(WritableRaster) , and PlanarImage.getExtendedData(Rectangle,BorderExtender) .

The event and property helper fields are initialized by this constructor.
Parameters:
  layout - The layout of this image or null.
Parameters:
  sources - The immediate sources of this image ornull.
Parameters:
  properties - A Map containing the properties ofthis image or null.
throws:
  IllegalArgumentException - if aColorModel is specified in the layout and it isincompatible with the SampleModel
throws:
  IllegalArgumentException - If sourcesis non-null and any object insources is null.
since:
   JAI 1.1





Method Detail
XToTileX
public static int XToTileX(int x, int tileGridXOffset, int tileWidth)(Code)
Converts a pixel's X coordinate into a horizontal tile index relative to a given tile grid layout specified by its X offset and tile width.

If tileWidth < 0, the results of this method are undefined. If tileWidth == 0, an ArithmeticException will be thrown.
throws:
  ArithmeticException - If tileWidth == 0.




XToTileX
public int XToTileX(int x)(Code)
Converts a pixel's X coordinate into a horizontal tile index. No attempt is made to detect out-of-range coordinates.

This method is implemented in terms of the static method XToTileX() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.
Parameters:
  x - the X coordinate of a pixel. the X index of the tile containing the pixel.
throws:
  ArithmeticException - If the tile width of this image is 0.




YToTileY
public static int YToTileY(int y, int tileGridYOffset, int tileHeight)(Code)
Converts a pixel's Y coordinate into a vertical tile index relative to a given tile grid layout specified by its Y offset and tile height.

If tileHeight < 0, the results of this method are undefined. If tileHeight == 0, an ArithmeticException will be thrown.
throws:
  ArithmeticException - If tileHeight == 0.




YToTileY
public int YToTileY(int y)(Code)
Converts a pixel's Y coordinate into a vertical tile index. No attempt is made to detect out-of-range coordinates.

This method is implemented in terms of the static method YToTileY() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.
Parameters:
  y - the Y coordinate of a pixel. the Y index of the tile containing the pixel.
throws:
  ArithmeticException - If the tile height of this image is 0.




addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)(Code)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.
since:
   JAI 1.1



addPropertyChangeListener
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The case of the name is ignored.
since:
   JAI 1.1



addSink
public synchronized boolean addSink(Object sink)(Code)
Adds an Object sink to the list of sinks. true if the element was added,false otherwise.
throws:
  IllegalArgumentException - ifsink is null.
since:
   JAI 1.1



addSink
protected void addSink(PlanarImage sink)(Code)
Adds a PlanarImage sink to the list of sinks.
Parameters:
  sink - A PlanarImage to be added as a sink.
throws:
  IllegalArgumentException - If sink isnull.



addSource
protected void addSource(Object source)(Code)
Adds an Object source to the list of sources. If the source is a RenderedImage it is wrapped using wrapRenderedImage(). If the unwrapped source is a PlanarImage then this image is added to its list of sinks.
Parameters:
  source - An Object to be added as animmediate source of this image.
throws:
  IllegalArgumentException - If source isnull.
since:
   JAI 1.1



addTileComputationListener
public synchronized void addTileComputationListener(TileComputationListener listener)(Code)
Adds a TileComputationListener to the list of registered TileComputationListeners. This listener will be notified when tiles requested via queueTiles() have been computed.
Parameters:
  listener - The TileComputationListener to register.
throws:
  IllegalArgumentException - if listener isnull.
since:
   JAI 1.1



cancelTiles
public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)
Issue an advisory cancellation request to nullify processing of the indicated tiles. It is legal to implement this method as a no-op.

The cancellation request is forwarded to the TileScheduler of the default instance of the JAI class.
Parameters:
  request - The request for which tiles are to be cancelled.
Parameters:
  tileIndices - The tiles to be cancelled; may be null.Any tiles not actually in the TileRequest will beignored.
throws:
  IllegalArgumentException - If request isnull.
since:
   JAI 1.1




copyData
public WritableRaster copyData()(Code)
Copies the entire image into a single raster.



copyData
public WritableRaster copyData(WritableRaster raster)(Code)
Copies an arbitrary rectangular region of this image's pixel data into a caller-supplied WritableRaster. The region to be copied is defined as the boundary of the WritableRaster, which can be obtained by calling WritableRaster.getBounds().

The supplied WritableRaster may have a region that extends beyond this image's boundary, in which case only pixels in the part of the region that intersects this image are copied. The areas outside of this image's boundary are left untouched.

The supplied WritableRaster may also be null, in which case the entire image is copied into a newly-created WritableRaster with a SampleModel that is compatible with that of this image.
Parameters:
  raster - A WritableRaster to hold the copiedpixel data of this image. A reference to the supplied WritableRaster,or to a new WritableRaster if the suppliedone was null.




copyExtendedData
public void copyExtendedData(WritableRaster dest, BorderExtender extender)(Code)
Copies an arbitrary rectangular region of the RenderedImage into a caller-supplied WritableRaster. The portion of the supplied WritableRaster that lies outside of the bounds of the image is computed by calling the given BorderExtender. The supplied WritableRaster must have a SampleModel that is compatible with that of the image.
Parameters:
  dest - a WritableRaster to hold the returnedportion of the image.
Parameters:
  extender - an instance of BorderExtender.
throws:
  IllegalArgumentException - If dest orextender is null.



createColorModel
public static ColorModel createColorModel(SampleModel sm)(Code)
Creates a ColorModel that may be used with the specified SampleModel. If a suitable ColorModel cannot be found, this method returns null.

Suitable ColorModels are guaranteed to exist for all instances of ComponentSampleModel whose dataType is not DataBuffer.TYPE_SHORT and with no more than 4 bands. A ComponentColorModel of either type CS_GRAY or CS_sRGB is returned.

For 1- and 3- banded SampleModels, the returned ColorModel will be opaque. For 2- and 4-banded SampleModels, the output will use alpha transparency.

Additionally, an instance of DirectColorModel will be created for instances of SinglePixelPackedSampleModel with no more than 4 bands.

Finally, an instance of IndexColorModel will be created for instances of MultiPixelPackedSampleModel with a single band and a pixel bit stride of unity. This represents the case of binary data.

This method is intended as an useful utility for the creation of simple ColorModels for some common cases. In more complex situations, it may be necessary to instantiate the appropriate ColorModels directly. An instance of ColorModel that is suitable forthe supplied SampleModel, or null.
throws:
  IllegalArgumentException - If sm isnull.




createSnapshot
public PlanarImage createSnapshot()(Code)
Creates a snapshot, that is, a virtual copy of the image's current contents. If the image is not a WritableRenderedImage, it is returned unchanged. Otherwise, a SnapshotImage is created and the result of calling its createSnapshot() is returned. A PlanarImage with immutable contents.



createWritableRaster
final protected WritableRaster createWritableRaster(SampleModel sampleModel, Point location)(Code)
Creates a WritableRaster with the specified SampleModel and location. If tileFactory is non-null, it will be used to create the WritableRaster; otherwise RasterFactory.createWritableRaster(SampleModelPoint) will be used.
Parameters:
  sampleModel - The SampleModel to use.
Parameters:
  location - The origin of the WritableRaster; ifnull, (0, 0) will be used.
throws:
  IllegalArgumentException - if sampleModel isnull.
since:
   JAI 1.1.2



dispose
public synchronized void dispose()(Code)
Provides a hint that an image will no longer be accessed from a reference in user space. The results are equivalent to those that occur when the program loses its last reference to this image, the garbage collector discovers this, and finalize is called. This can be used as a hint in situations where waiting for garbage collection would be overly conservative.

PlanarImage defines this method to remove the image being disposed from the list of sinks in all of its source images. Subclasses should call super.dispose() in their dispose methods, if any.

The results of referencing an image after a call to dispose() are undefined.




finalize
protected void finalize() throws Throwable(Code)
Performs cleanup prior to garbage collection.

PlanarImage defines this method to invoke the dispose() method.

Throwable if an error occurs in thegarbage collector.



getAsBufferedImage
public BufferedImage getAsBufferedImage(Rectangle rect, ColorModel cm)(Code)
Returns a copy of this image as a BufferedImage. A subarea of the image may be copied by supplying a Rectangle parameter; if it is set to null, the entire image is copied. The supplied Rectangle will be clipped to the image bounds. The image's ColorModel may be overridden by supplying a non-null second argument. The resulting ColorModel must be non-null and appropriate for the image's SampleModel.

The resulting BufferedImage will contain the full requested area, but will always have its top-left corner translated (0, 0) as required by the BufferedImage interface.
Parameters:
  rect - The Rectangle of the image to becopied, or null to indicate that theentire image is to be copied.
Parameters:
  cm - A ColorModel used to overridethis image's ColorModel, or null.The caller is responsible for supplying aColorModel that is compatible with the image'sSampleModel.
throws:
  IllegalArgumentException - If an incompatible, non-nullColorModel is supplied.
throws:
  IllegalArgumentException - If no ColorModel issupplied, and the image ColorModel isnull.




getAsBufferedImage
public BufferedImage getAsBufferedImage()(Code)
Returns a copy of the entire image as a BufferedImage. The image's ColorModel must be non-null, and appropriate for the image's SampleModel.
See Also:   java.awt.image.BufferedImage



getBounds
public Rectangle getBounds()(Code)
Returns the image's bounds as a Rectangle.

The image's bounds are defined by the values returned by getMinX(), getMinY(), getWidth(), and getHeight(). A Rectangle is created based on these four methods and cached in this class. Each time that this method is invoked, the bounds of this Rectangle are updated with the values returned by the four aforementioned accessors.

Because this method returns the bounds variable by reference, the caller should not change the settings of the Rectangle. Otherwise, unexpected errors may occur. Likewise, if the caller expects this variable to be immutable it should clone the returned Rectangle if there is any possibility that it might be changed by the PlanarImage. This may generally occur only for instances of RenderedOp.




getColorModel
public ColorModel getColorModel()(Code)
Returns the ColorModel of the image. The default implementation returns the corresponding instance variable.



getData
public Raster getData()(Code)
Returns the entire image in a single Raster. For images with multiple tiles this will require creating a new Raster and copying data from multiple tiles into it ("cobbling").

The returned Raster is semantically a copy. This means that subsequent updates to this image will not be reflected in the returned Raster. For non-writable (immutable) images, the returned value may be a reference to the image's internal data. The returned Raster should be considered non-writable; any attempt to alter its pixel data (such as by casting it to a WritableRaster or obtaining and modifying its DataBuffer) may result in undefined behavior. The copyData method should be used if the returned Raster is to be modified.

For a very large image, more than Integer.MAX_VALUE entries could be required in the returned Raster's underlying data array. Since the Java language does not permit such an array, an IllegalArgumentException will be thrown. A Raster containing the entire image data.
throws:
  IllegalArgumentException - If the size of the returned datais too large to be stored in a single Raster.




getData
public Raster getData(Rectangle region)(Code)
Returns a specified region of this image in a Raster.

The returned Raster is semantically a copy. This means that subsequent updates to this image will not be reflected in the returned Raster. For non-writable (immutable) images, the returned value may be a reference to the image's internal data. The returned Raster should be considered non-writable; any attempt to alter its pixel data (such as by casting it to a WritableRaster or obtaining and modifying its DataBuffer) may result in undefined behavior. The copyData method should be used if the returned Raster is to be modified.

The region of the image to be returned is specified by a Rectangle. This region may go beyond this image's boundary. If so, the pixels in the areas outside this image's boundary are left unset. Use getExtendedData if a specific extension policy is required.

The region parameter may also be null, in which case the entire image data is returned in the Raster.

If region is non-null but does not intersect the image bounds at all, an IllegalArgumentException will be thrown.

It is possible to request a region of an image that would require more than Integer.MAX_VALUE entries in the returned Raster's underlying data array. Since the Java language does not permit such an array, an IllegalArgumentException will be thrown.
Parameters:
  region - The rectangular region of this image to bereturned, or null. A Raster containing the specified image data.
throws:
  IllegalArgumentException - If the region does notintersect the image bounds.
throws:
  IllegalArgumentException - If the size of the returned datais too large to be stored in a single Raster.




getDefaultColorModel
public static ColorModel getDefaultColorModel(int dataType, int numBands)(Code)
Returns a ComponentColorModel created based on the indicated dataType and numBands.

The dataType must be one of DataBuffer's TYPE_BYTE, TYPE_USHORT, TYPE_INT, TYPE_FLOAT, or TYPE_DOUBLE.

The numBands may range from 1 to 4, with the following ColorSpace and alpha settings:

  • numBands = 1: CS_GRAY without alpha;
  • numBands = 2: CS_GRAY with alpha;
  • numBands = 3: CS_sRGB without alpha;
  • numBands = 4: CS_sRGB with alpha.
The transparency is set to Transparency.TRANSLUCENT if alpha is used and to Transparency.OPAQUE otherwise.

All other inputs result in a null return value.
Parameters:
  dataType - The data type of the ColorModel.
Parameters:
  numBands - The number of bands of the pixels the createdColorModel is going to work with.
since:
   JAI 1.1




getExtendedData
public Raster getExtendedData(Rectangle region, BorderExtender extender)(Code)
Returns a copy of an arbitrary rectangular region of this image in a Raster. The portion of the rectangle of interest ouside the bounds of the image will be computed by calling the given BorderExtender. If the region falls entirely within the image, extender will not be used in any way. Thus it is possible to use a null value for extender when it is known that no actual extension will be required.

The returned Raster should be considered non-writable; any attempt to alter its pixel data (such as by casting it to a WritableRaster or obtaining and modifying its DataBuffer) may result in undefined behavior. The copyExtendedData method should be used if the returned Raster is to be modified.
Parameters:
  region - the region of the image to be returned.
Parameters:
  extender - an instance of BorderExtender,used only if the region exceeds the image bounds,or null. a Raster containing the extended data.
throws:
  IllegalArgumentException - If region isnull.
throws:
  IllegalArgumentException - If the region exceeds the imagebounds and extender is null.




getGraphics
public Graphics getGraphics()(Code)
Returns a Graphics object that may be used to draw into this image. By default, an IllegalAccessError is thrown. Subclasses that support such drawing, such as TiledImage, may override this method to return a suitable Graphics object.



getHeight
public int getHeight()(Code)
Returns the height of the image in number of pixels. The default implementation returns the corresponding instance variable.



getImageID
public Object getImageID()(Code)
Returns a unique identifier (UID) for this PlanarImage. This UID may be used when the potential redundancy of the value returned by the hashCode() method is unacceptable. An example of this is in generating a key for storing image tiles in a cache.



getMaxTileX
public int getMaxTileX()(Code)
Returns the horizontal index of the right-most column of tiles.

This method is implemented in terms of the static method XToTileX() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.




getMaxTileY
public int getMaxTileY()(Code)
Returns the vertical index of the bottom-most row of tiles.

This method is implemented in terms of the static method YToTileY() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.




getMaxX
public int getMaxX()(Code)
Returns the X coordinate of the column immediately to the right of the right-most column of the image.

This method is implemented in terms of getMinX() and getWidth() so that subclasses which override those methods do not need to override this one.




getMaxY
public int getMaxY()(Code)
Returns the Y coordinate of the row immediately below the bottom-most row of the image.

This method is implemented in terms of getMinY() and getHeight() so that subclasses which override those methods do not need to override this one.




getMinTileX
public int getMinTileX()(Code)
Returns the horizontal index of the left-most column of tiles.

This method is implemented in terms of the static method XToTileX() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.




getMinTileY
public int getMinTileY()(Code)
Returns the vertical index of the top-most row of tiles.

This method is implemented in terms of the static method YToTileY() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.




getMinX
public int getMinX()(Code)
Returns the X coordinate of the left-most column of the image. The default implementation returns the corresponding instance variable.



getMinY
public int getMinY()(Code)
Returns the Y coordinate of the top-most row of the image. The default implementation returns the corresponding instance variable.



getNumBands
public int getNumBands()(Code)
Retrieve the number of image bands. Note that this will not equal the number of color components if the image has an IndexColorModel. This is equivalent to calling getSampleModel().getNumBands().
since:
   JAI 1.1



getNumSources
public int getNumSources()(Code)
Returns the number of immediate PlanarImage sources this image has. If this image has no source, this method returns 0.



getNumXTiles
public int getNumXTiles()(Code)
Returns the number of tiles along the tile grid in the horizontal direction.

This method is implemented in terms of the static method XToTileX() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.




getNumYTiles
public int getNumYTiles()(Code)
Returns the number of tiles along the tile grid in the vertical direction.

This method is implemented in terms of the static method YToTileY() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.




getProperties
protected Hashtable getProperties()(Code)
Returns the internal Hashtable containing the image properties by reference.



getProperty
public Object getProperty(String name)(Code)
Gets a property from the property set of this image. If the property name is not recognized, java.awt.Image.UndefinedProperty will be returned.
Parameters:
  name - the name of the property to get, as a String. A reference to the property Object, or the valuejava.awt.Image.UndefinedProperty.
exception:
  IllegalArgumentException - if propertyNameis null.



getPropertyClass
public Class getPropertyClass(String name)(Code)
Returns the class expected to be returned by a request for the property with the specified name. If this information is unavailable, null will be returned.
exception:
  IllegalArgumentException - if nameis null. The Class expected to be return by arequest for the value of this property or null.
since:
   JAI 1.1



getPropertyNames
public String[] getPropertyNames()(Code)
Returns a list of property names that are recognized by this image or null if none are recognized. an array of Strings containing validproperty names or null.



getPropertyNames
public String[] getPropertyNames(String prefix)(Code)
Returns an array of Strings recognized as names by this property source that begin with the supplied prefix. If no property names match, null will be returned. The comparison is done in a case-independent manner.

The default implementation calls getPropertyNames() and searches the list of names for matches. an array of Strings giving the validproperty names.
throws:
  IllegalArgumentException - If prefix isnull.




getSampleModel
public SampleModel getSampleModel()(Code)
Returns the SampleModel of the image. The default implementation returns the corresponding instance variable.



getSinks
public Vector getSinks()(Code)
Returns a Vector containing the currently available PlanarImage sinks of this image (images for which this image is a source), or null if no sinks are present.

Sinks are stored using weak references. This means that the set of sinks may change between calls to getSinks() if the garbage collector happens to identify a sink as not otherwise reachable (reachability is discussed in the class comments for this class).

Since the pool of sinks may change as garbage collection occurs, PlanarImage does not implement either a getSink(int index) or a getNumSinks() method. Instead, the caller must call getSinks(), which returns a Vector of normal references. As long as the returned Vector is referenced from user code, the images it references are reachable and may be reliably accessed.




getSource
public PlanarImage getSource(int index)(Code)
Returns the immediate source indicated by the index. If there is no source corresponding to the specified index, this method throws an exception.
Parameters:
  index - The index of the desired source. A PlanarImage source.
throws:
  ArrayIndexOutOfBoundsException - If this image has noimmediate source, or if the index is negative or greaterthan the maximum source index.
See Also:   PlanarImage.getSourceImage(int)



getSourceImage
public PlanarImage getSourceImage(int index)(Code)
Returns the immediate source indicated by the index. If there is no source corresponding to the specified index, this method throws an exception.
Parameters:
  index - The index of the desired source. A PlanarImage source.
throws:
  ArrayIndexOutOfBoundsException - If this image has noimmediate source, or if the index is negative or greaterthan the maximum source index.
since:
   JAI 1.1



getSourceObject
public Object getSourceObject(int index)(Code)
Returns the immediate source indicated by the index. If there is no source corresponding to the specified index, this method throws an exception.
Parameters:
  index - The index of the desired source. An Object source.
throws:
  ArrayIndexOutOfBoundsException - If this image has noimmediate source, or if the index is negative or greaterthan the maximum source index.
since:
   JAI 1.1



getSources
public Vector getSources()(Code)
Returns this image's immediate source(s) in a Vector. If this image has no source, this method returns null.



getSplits
public void getSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)(Code)
Within a given rectangle, store the list of tile seams of both X and Y directions into the corresponding split sequence.
Parameters:
  xSplits - An IntegerSequence to which thetile seams in the X direction are to be added.
Parameters:
  ySplits - An IntegerSequence to which thetile seams in the Y direction are to be added.
Parameters:
  rect - The rectangular region of interest.
throws:
  IllegalArgumentException - If xSplits,ySplits, or rectis null.



getTile
abstract public Raster getTile(int tileX, int tileY)(Code)
Returns tile (tileX, tileY) as a Raster. Note that tileX and tileY are indices into the tile array, not pixel locations.

Subclasses must override this method to return a non-null value for all tile indices between getMinTile{X,Y} and getMaxTile{X,Y}, inclusive. Tile indices outside of this region should result in a return value of null.
Parameters:
  tileX - The X index of the requested tile in the tile array.
Parameters:
  tileY - The Y index of the requested tile in the tile array.




getTileComputationListeners
public TileComputationListener[] getTileComputationListeners()(Code)
Retrieves a snapshot of the set of all registered TileComputationListeners as of the moment this method is invoked. All TileComputationListeners ornull if there are none.
since:
   JAI 1.1



getTileFactory
public TileFactory getTileFactory()(Code)
Returns the value of the instance variable tileFactory.
since:
   JAI 1.1.2



getTileGridXOffset
public int getTileGridXOffset()(Code)
Returns the X coordinate of the top-left pixel of tile (0, 0). The default implementation returns the corresponding instance variable.



getTileGridYOffset
public int getTileGridYOffset()(Code)
Returns the Y coordinate of the top-left pixel of tile (0, 0). The default implementation returns the corresponding instance variable.



getTileHeight
public int getTileHeight()(Code)
Returns the height of a tile of this image in number of pixels. The default implementation returns the corresponding instance variable.



getTileIndices
public Point[] getTileIndices(Rectangle region)(Code)
Returns an array containing the indices of all tiles which overlap the specified Rectangle. If the Rectangle does not intersect the image bounds then null will be returned. If an array is returned, it will be ordered in terms of the row major ordering of its contained tile indices. If the specified Rectangle is null, the tile indicies for the entire image will be returned.
Parameters:
  region - The Rectangle of interest. An array of the indices of overlapping tiles ornull if region does not intersectthe image bounds.
since:
   JAI 1.1



getTileRect
public Rectangle getTileRect(int tileX, int tileY)(Code)
Returns a Rectangle indicating the active area of a given tile. The Rectangle is defined as the intersection of the tile area and the image bounds. No attempt is made to detect out-of-range indices; tile indices lying completely outside of the image will result in returning an empty Rectangle (width and/or height less than or equal to 0).

This method is implemented in terms of the primitive layout accessors and so does not need to be implemented by subclasses.
Parameters:
  tileX - The X index of the tile.
Parameters:
  tileY - The Y index of the tile. A Rectangle




getTileWidth
public int getTileWidth()(Code)
Returns the width of a tile of this image in number of pixels. The default implementation returns the corresponding instance variable.



getTiles
public Raster[] getTiles(Point[] tileIndices)(Code)
Returns the Rasters indicated by the tileIndices array. This call allows certain PlanarImage subclasses such as OpImage to take advantage of the knowledge that multiple tiles are requested at once.
Parameters:
  tileIndices - An array of Points representing tile indices. An array of Raster containing the tilescorresponding to the given tile indices.
throws:
  IllegalArgumentException - If tileIndices isnull.



getTiles
public Raster[] getTiles()(Code)
Computes and returns all tiles in the image. The tiles are returned in a sequence corresponding to the row-major order of their respective tile indices. The returned array may of course be ignored, e.g., in the case of a subclass which caches the tiles and the intent is to force their computation.



getWidth
public int getWidth()(Code)
Returns the width of the image in number of pixels. The default implementation returns the corresponding instance variable.



overlapsMultipleTiles
public boolean overlapsMultipleTiles(Rectangle rect)(Code)
Returns true if and only if the intersection of the specified Rectangle with the image bounds overlaps more than one tile.
throws:
  IllegalArgumentException - if rect isnull.



prefetchTiles
public void prefetchTiles(Point[] tileIndices)(Code)
Hints that the given tiles might be needed in the near future. Some implementations may spawn a thread or threads to compute the tiles while others may ignore the hint.

The TileScheduler of the default instance of the JAI class is used to prefetch the tiles. If this TileScheduler has a positive prefetch parallelism this method will be non-blocking.
Parameters:
  tileIndices - A list of tile indices indicating which tilesto prefetch.
throws:
  IllegalArgumentException - If tileIndices isnull.




queueTiles
public TileRequest queueTiles(Point[] tileIndices)(Code)
Queues a list of tiles for computation. Registered listeners will be notified after each tile has been computed.

The TileScheduler of the default instance of the JAI class is used to process the tiles. If this TileScheduler has a positive parallelism this method will be non-blocking. The event source parameter passed to such listeners will be the TileScheduler and the image parameter will be this image.
Parameters:
  tileIndices - A list of tile indices indicating which tilesto schedule for computation.
throws:
  IllegalArgumentException - If tileIndices isnull.
since:
   JAI 1.1




removeProperty
public void removeProperty(String name)(Code)
Removes the named property from the PlanarImage. Some PlanarImage subclasses may ignore attempts to remove properties.
exception:
  IllegalArgumentException - if nameis null.
since:
   JAI 1.1



removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)(Code)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.
since:
   JAI 1.1



removePropertyChangeListener
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)
Remove a PropertyChangeListener for a specific property. The case of the name is ignored.
since:
   JAI 1.1



removeSink
public synchronized boolean removeSink(Object sink)(Code)
Removes an Object sink from the list of sinks. true if the element was present,false otherwise.
throws:
  IllegalArgumentException - ifsink is null.
since:
   JAI 1.1



removeSink
protected boolean removeSink(PlanarImage sink)(Code)
Removes a PlanarImage sink from the list of sinks.
Parameters:
  sink - A PlanarImage sink to be removed. true if the element was present,false otherwise.
throws:
  IllegalArgumentException - If sink isnull.
throws:
  IndexOutOfBoundsException - If sink is notin the sink list.



removeSinks
public void removeSinks()(Code)
Removes all the sinks of this image.



removeSource
protected boolean removeSource(Object source)(Code)
Removes an Object source from the list of sources. If the source is a PlanarImage then this image is removed from its list of sinks.
Parameters:
  source - The Object source to be removed. true if the element was present,false otherwise.
throws:
  IllegalArgumentException - If source isnull.
since:
   JAI 1.1



removeSources
protected void removeSources()(Code)
Removes all the sources of this image. This image is removed from the list of sinks of any prior PlanarImages sources.



removeTileComputationListener
public synchronized void removeTileComputationListener(TileComputationListener listener)(Code)
Removes a TileComputationListener from the list of registered TileComputationListeners.
Parameters:
  listener - The TileComputationListener to unregister.
throws:
  IllegalArgumentException - if listener isnull.
since:
   JAI 1.1



setImageLayout
protected void setImageLayout(ImageLayout layout)(Code)
Sets the image bounds, tile grid layout, SampleModel and ColorModel using values from an ImageLayout object.

If either of the tile dimensions is not set in the passed in ImageLayout object, then the tile dimension in question will be set to the corresponding image dimension.

If either of the tile grid offsets is not set in the passed in ImageLayout object, then the tile grid offset in question will be set to 0. The same is true for the minX , minY, width and height fields, if no value is set in the passed in ImageLayout object, they will be set to 0.

If the SampleModel is non-null and the supplied tile dimensions are positive, then if the dimensions of the supplied SampleModel differ from the tile dimensions, a new SampleModel will be created for the image from the supplied SampleModel but with dimensions equal to those of a tile.

If both the SampleModel and the ColorModel in the supplied ImageLayout are non-null they will be tested for compatibility. If the test fails an exception will be thrown. The test is that

  • ColorModel.isCompatibleSampleModel() invoked on the SampleModel must return true, and
  • if the ColorModel is a ComponentColorModel then:
    • the number of bands of the SampleModel must equal the number of components of the ColorModel, and
    • SampleModel.getSampleSize(b) >= ColorModel.getComponentSize(b) for all bands b.

Parameters:
  layout - an ImageLayout that is used to selectivelyoverride the image's layout, SampleModel,and ColorModel. Only valid fields, i.e.,those for which ImageLayout.isValid() returnstrue for the appropriate mask, are used. IllegalArgumentException if layoutis null. IllegalArgumentException if aColorModel is specified in the layout and it isincompatible with the SampleModel
since:
   JAI 1.1



setProperties
protected void setProperties(Hashtable properties)(Code)
Sets the Hashtable containing the image properties to a given Hashtable. The Hashtable is incorporated by reference and must not be altered by other classes after this method is called.



setProperty
public void setProperty(String name, Object value)(Code)
Sets a property on a PlanarImage. Some PlanarImage subclasses may ignore attempts to set properties.
Parameters:
  name - a String containing the property's name.
Parameters:
  value - the property, as a general Object.
throws:
  IllegalArgumentException - If name orvalue is null.



setSource
protected void setSource(Object source, int index)(Code)
Sets an immediate source of this image. The source to be replaced with the new input Object is referred to by its index. This image must already have a source corresponding to the specified index. If the source is a RenderedImage it is wrapped using wrapRenderedImage(). If the unwrapped source is a PlanarImage then this image is added to its list of sinks. If a PlanarImage source previously existed at this index, this image is removed from its list of sinks.
Parameters:
  source - A Object source to be set.
Parameters:
  index - The index of the source to be set.
throws:
  ArrayIndexOutOfBoundsException - If this image has noimmediate source, or if there is no source correspondingto the index value.
throws:
  IllegalArgumentException - If source isnull.
since:
   JAI 1.1



setSources
protected void setSources(List sourceList)(Code)
Sets the list of sources from a given List of PlanarImages. All of the existing sources are discarded. Any RenderedImage sources in the supplied list are wrapped using wrapRenderedImage(). The list of sinks of each prior PlanarImage source and of each current unwrapped PlanarImage source is adjusted as necessary such that this image is a sink of all such current sources but is removed as a sink of all such prior sources which are not also current.
Parameters:
  sourceList - a List of PlanarImages.
throws:
  IllegalArgumentException - If sourceList isnull or contains any null elements.



tileXToX
public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)(Code)
Converts a horizontal tile index into the X coordinate of its upper left pixel relative to a given tile grid layout specified by its X offset and tile width.



tileXToX
public int tileXToX(int tx)(Code)
Converts a horizontal tile index into the X coordinate of its upper left pixel. No attempt is made to detect out-of-range indices.

This method is implemented in terms of the static method tileXToX() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.
Parameters:
  tx - the horizontal index of a tile. the X coordinate of the tile's upper left pixel.




tileYToY
public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)(Code)
Converts a vertical tile index into the Y coordinate of its upper left pixel relative to a given tile grid layout specified by its Y offset and tile height.



tileYToY
public int tileYToY(int ty)(Code)
Converts a vertical tile index into the Y coordinate of its upper left pixel. No attempt is made to detect out-of-range indices.

This method is implemented in terms of the static method tileYToY() applied to the values returned by primitive layout accessors and so does not need to be implemented by subclasses.
Parameters:
  ty - the vertical index of a tile. the Y coordinate of the tile's upper left pixel.




toString
public String toString()(Code)
Returns a String which includes the basic information of this image.
since:
   JAI 1.1



wrapRenderedImage
public static PlanarImage wrapRenderedImage(RenderedImage image)(Code)
Wraps an arbitrary RenderedImage to produce a PlanarImage. PlanarImage adds various properties to an image, such as source and sink vectors and the ability to produce snapshots, that are necessary for JAI.

If the image is already a PlanarImage, it is simply returned unchanged. Otherwise, the image is wrapped in a RenderedImageAdapter or WritableRenderedImageAdapter as appropriate.
Parameters:
  image - The RenderedImage to be converted intoa PlanarImage. A PlanarImage containing image'spixel data.
throws:
  IllegalArgumentException - If image isnull.




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.