Java Doc for MediaLibAccessor.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » jai » mlib » 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 » com.sun.media.jai.mlib 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.media.jai.mlib.MediaLibAccessor

MediaLibAccessor
public class MediaLibAccessor (Code)
An adapter class for presenting image data in a mediaLibImage format, even if the data isn't stored that way. MediaLibAccessor is meant to make the common case (ComponentRasters) and allow them to be accelerated via medialib. Note that unlike RasterAccessor, MediaLibAccessor does not work with all cases. In the event that MediaLibAccessor can not deal with a give collection of Rasters, findCompatibleTag will return the value MediaLibAccessor.TAG_INCOMPATIBLE. OpImages that use MediaLibAccessor should be paired with RIF's which check that findCompatibleTag returns a valid tag before actually constructing the Mlib OpImage.


Field Summary
final public static  intBINARY
     Flag indicating data are binary.
final public static  intBINARY_MASK
     The bits of a FormatTag associated with binary data.
final public static  intCOPIED
     Flag indicating data is a copy of the raster's data.
final public static  intCOPY_MASK
     The bits of a FormatTag associated with how dataArrays are obtained.
final public static  intDATATYPE_MASK
     The bits of a FormatTag associated with pixel datatype.
final public static  intNONBINARY
     Flag indicating data are not binary.
final public static  intTAG_BYTE_COPIED
     FormatTag indicating data in byte arrays and uncopied.
final public static  intTAG_BYTE_UNCOPIED
     FormatTag indicating data in byte arrays and uncopied.
final public static  intTAG_DOUBLE_COPIED
     FormatTag indicating data in double arrays and copied.
final public static  intTAG_DOUBLE_UNCOPIED
     FormatTag indicating data in double arrays and uncopied.
final public static  intTAG_FLOAT_COPIED
     FormatTag indicating data in float arrays and copied.
final public static  intTAG_FLOAT_UNCOPIED
     FormatTag indicating data in float arrays and uncopied.
final public static  intTAG_INT_COPIED
     FormatTag indicating data in short arrays and copied.
final public static  intTAG_INT_UNCOPIED
     FormatTag indicating data in integer arrays and uncopied.
final public static  intTAG_SHORT_COPIED
     FormatTag indicating data in short arrays and copied.
final public static  intTAG_SHORT_UNCOPIED
     FormatTag indicating data in short arrays and uncopied.
final public static  intTAG_USHORT_COPIED
     FormatTag indicating data in unsigned short arrays and copied.
final public static  intTAG_USHORT_UNCOPIED
     FormatTag indicating data in unsigned short arrays and uncopied.
final public static  intUNCOPIED
     Flag indicating data is raster's data.
protected  intbandOffsets
    
protected  intformatTag
    
protected  mediaLibImagemlimages
    
protected  intnumBands
     The number of bands per pixel in the data array.
protected  Rasterraster
     The raster that is the source of pixel data.
protected  Rectanglerect
     The rectangle of the raster that MediaLibAccessor addresses.

Constructor Summary
public  MediaLibAccessor(Raster raster, Rectangle rect, int formatTag, boolean preferPacked)
     Constructs a MediaLibAccessor object out of a Raster, Rectangle and formatTag returned from MediaLibAccessor.findCompatibleTag(). In the case of binary data the copy mask bits of the formatTag will be reset within the constructor according to whether the data are in fact copied.
public  MediaLibAccessor(Raster raster, Rectangle rect, int formatTag)
     Constructs a MediaLibAccessor object out of a Raster, Rectangle and formatTag returned from MediaLibAccessor.findCompatibleTag().

Method Summary
public  voidclampDataArrays()
     Clamps data array values to a range that the underlying raster can deal with.
public  voidcopyDataToRaster()
     Copies data back into the MediaLibAccessor's raster.
public static  intfindCompatibleTag(Raster srcs, Raster dst)
     Returns the most efficient FormatTag that is compatible with the destination raster and all source rasters.
public  int[]getBandOffsets()
     Returns the bandOffsets.
public  intgetDataType()
     Returns the data type of the RasterAccessor object.
public  double[]getDoubleParameters(int band, double params)
    
public  int[][]getIntArrayParameters(int band, int[][] params)
    
public  int[]getIntParameters(int band, int params)
    
public static  intgetMediaLibDataType(int formatTag)
    
public  mediaLibImage[]getMediaLibImages()
     Returns an array of mediaLibImages which represents the input raster.
public static  booleanhasMatchingBandOffsets(ComponentSampleModel dst, ComponentSampleModel src)
     Determines if the src ComponentSampleModel and dst ComponentSampleModel have matching band offsets.
public static  booleanhasSameNumBands(ParameterBlock args, ImageLayout layout)
     Returns true if the number of bands of all the RenderedImage sources and destination are the same.
public  booleanisBinary()
     Returns true if the MediaLibAccessor represents binary data.
public  booleanisDataCopy()
     Returns true if the MediaLibAccessors's data is copied from it's raster.
public static  booleanisMediaLibBinaryCompatible(ParameterBlock args, ImageLayout layout)
     Returns true if mediaLib is able to handle the source(s) and destination image format as binary (also known as bit or bilevel) image data.
public static  booleanisMediaLibCompatible(ParameterBlock args, ImageLayout layout)
     Returns true if mediaLib is able to handle the source(s) and destination image format.
public static  booleanisMediaLibCompatible(ParameterBlock args)
     Returns true if mediaLib is able to handle the source(s) image format.
public static  booleanisMediaLibCompatible(RenderedImage image)
     Returns true if mediaLib is able to handle the image.
public static  booleanisMediaLibCompatible(SampleModel sm, ColorModel cm)
     Returns true if mediaLib is able to handle an image having the supplied SampleModel and ColorModel.
public static  booleanisPixelSequential(SampleModel sm)
    

Field Detail
BINARY
final public static int BINARY(Code)
Flag indicating data are binary.



BINARY_MASK
final public static int BINARY_MASK(Code)
The bits of a FormatTag associated with binary data.



COPIED
final public static int COPIED(Code)
Flag indicating data is a copy of the raster's data.



COPY_MASK
final public static int COPY_MASK(Code)
The bits of a FormatTag associated with how dataArrays are obtained.



DATATYPE_MASK
final public static int DATATYPE_MASK(Code)
The bits of a FormatTag associated with pixel datatype.



NONBINARY
final public static int NONBINARY(Code)
Flag indicating data are not binary.



TAG_BYTE_COPIED
final public static int TAG_BYTE_COPIED(Code)
FormatTag indicating data in byte arrays and uncopied.



TAG_BYTE_UNCOPIED
final public static int TAG_BYTE_UNCOPIED(Code)
FormatTag indicating data in byte arrays and uncopied.



TAG_DOUBLE_COPIED
final public static int TAG_DOUBLE_COPIED(Code)
FormatTag indicating data in double arrays and copied.



TAG_DOUBLE_UNCOPIED
final public static int TAG_DOUBLE_UNCOPIED(Code)
FormatTag indicating data in double arrays and uncopied.



TAG_FLOAT_COPIED
final public static int TAG_FLOAT_COPIED(Code)
FormatTag indicating data in float arrays and copied.



TAG_FLOAT_UNCOPIED
final public static int TAG_FLOAT_UNCOPIED(Code)
FormatTag indicating data in float arrays and uncopied.



TAG_INT_COPIED
final public static int TAG_INT_COPIED(Code)
FormatTag indicating data in short arrays and copied.



TAG_INT_UNCOPIED
final public static int TAG_INT_UNCOPIED(Code)
FormatTag indicating data in integer arrays and uncopied.



TAG_SHORT_COPIED
final public static int TAG_SHORT_COPIED(Code)
FormatTag indicating data in short arrays and copied.



TAG_SHORT_UNCOPIED
final public static int TAG_SHORT_UNCOPIED(Code)
FormatTag indicating data in short arrays and uncopied.



TAG_USHORT_COPIED
final public static int TAG_USHORT_COPIED(Code)
FormatTag indicating data in unsigned short arrays and copied.



TAG_USHORT_UNCOPIED
final public static int TAG_USHORT_UNCOPIED(Code)
FormatTag indicating data in unsigned short arrays and uncopied.



UNCOPIED
final public static int UNCOPIED(Code)
Flag indicating data is raster's data.



bandOffsets
protected int bandOffsets(Code)
The offsets of each band in the src image



formatTag
protected int formatTag(Code)
Tag indicating the data type of the data and whether its copied



mlimages
protected mediaLibImage mlimages(Code)
Area of mediaLib images that represent image data



numBands
protected int numBands(Code)
The number of bands per pixel in the data array.



raster
protected Raster raster(Code)
The raster that is the source of pixel data.



rect
protected Rectangle rect(Code)
The rectangle of the raster that MediaLibAccessor addresses.




Constructor Detail
MediaLibAccessor
public MediaLibAccessor(Raster raster, Rectangle rect, int formatTag, boolean preferPacked)(Code)
Constructs a MediaLibAccessor object out of a Raster, Rectangle and formatTag returned from MediaLibAccessor.findCompatibleTag(). In the case of binary data the copy mask bits of the formatTag will be reset within the constructor according to whether the data are in fact copied. This cannot be easily determined before the data are actually copied.



MediaLibAccessor
public MediaLibAccessor(Raster raster, Rectangle rect, int formatTag)(Code)
Constructs a MediaLibAccessor object out of a Raster, Rectangle and formatTag returned from MediaLibAccessor.findCompatibleTag().




Method Detail
clampDataArrays
public void clampDataArrays()(Code)
Clamps data array values to a range that the underlying raster can deal with. For example, if the underlying raster stores data as bytes, but the samples ares unpacked into integer arrays by the RasterAccessor object for an operation, the operation will need to call clampDataArrays() so that the data in the int arrays is restricted to the range 0..255 before a setPixels() call is made on the underlying raster. Note that some operations (for example, lookup) can guarantee that their results don't need clamping so they can call RasterAccessor.copyDataToRaster() without first calling this function.



copyDataToRaster
public void copyDataToRaster()(Code)
Copies data back into the MediaLibAccessor's raster. Note that the data is casted from the intermediate data format to the raster's format. If clamping is needed, the call clampDataArrays() method needs to be called before calling the copyDataToRaster() method.



findCompatibleTag
public static int findCompatibleTag(Raster srcs, Raster dst)(Code)
Returns the most efficient FormatTag that is compatible with the destination raster and all source rasters.
Parameters:
  srcs - the source Raster; may be null.
Parameters:
  dst - the destination Raster.



getBandOffsets
public int[] getBandOffsets()(Code)
Returns the bandOffsets.



getDataType
public int getDataType()(Code)
Returns the data type of the RasterAccessor object. Note that this datatype is not necessarily the same data type as the underlying raster.



getDoubleParameters
public double[] getDoubleParameters(int band, double params)(Code)
Returns parameters in the appropriate order if MediaLibAccessor has reordered the bands or is attempting to make a BandSequential image look like multiple PixelSequentialImages



getIntArrayParameters
public int[][] getIntArrayParameters(int band, int[][] params)(Code)
Returns parameters in the appropriate order if MediaLibAccessor has reordered the bands or is attempting to make a BandSequential image look like multiple PixelSequentialImages



getIntParameters
public int[] getIntParameters(int band, int params)(Code)
Returns parameters in the appropriate order if MediaLibAccessor has reordered the bands or is attempting to make a BandSequential image look like multiple PixelSequentialImages



getMediaLibDataType
public static int getMediaLibDataType(int formatTag)(Code)



getMediaLibImages
public mediaLibImage[] getMediaLibImages()(Code)
Returns an array of mediaLibImages which represents the input raster. An array is returned instead of a single mediaLibImage because in some cases, an input Raster can't be represented by one mediaLibImage (unless copying is done) but can be represented by several mediaLibImages without copying.



hasMatchingBandOffsets
public static boolean hasMatchingBandOffsets(ComponentSampleModel dst, ComponentSampleModel src)(Code)
Determines if the src ComponentSampleModel and dst ComponentSampleModel have matching band offsets. If they don't mediaLib can't deal with the image without a copy.



hasSameNumBands
public static boolean hasSameNumBands(ParameterBlock args, ImageLayout layout)(Code)
Returns true if the number of bands of all the RenderedImage sources and destination are the same.
throws:
  ClassCastException - if any source is notRenderedImage.



isBinary
public boolean isBinary()(Code)
Returns true if the MediaLibAccessor represents binary data.



isDataCopy
public boolean isDataCopy()(Code)
Returns true if the MediaLibAccessors's data is copied from it's raster.



isMediaLibBinaryCompatible
public static boolean isMediaLibBinaryCompatible(ParameterBlock args, ImageLayout layout)(Code)
Returns true if mediaLib is able to handle the source(s) and destination image format as binary (also known as bit or bilevel) image data. Currently, all of the following conditions must be met in order for this method to return true.
  • MediaLib is available.
  • All sources must be RenderedImages.
  • All sources and destination must have a MultiPixelPackedSampleModel.
  • All sources and destination must have represent single-bit data.
  • All sources and destination must have a single band of pixel data.
Additional checks for each individual OpImage should be done in its corresponding RIF.
Parameters:
  args - Input arguments that include sources.
Parameters:
  layout - Destination image layout; may be null.



isMediaLibCompatible
public static boolean isMediaLibCompatible(ParameterBlock args, ImageLayout layout)(Code)
Returns true if mediaLib is able to handle the source(s) and destination image format. Currently, all of the following conditions must be met in order for this method to return true.
  • MediaLib is available.
  • All sources must be RenderedImage.
  • All sources and destination must have ComponentSampleModel and ComponentColorModel.
  • All sources and destination must have less than or equal to 4 bands of pixel data.
Additional checks for each individual OpImage should be done in its corresponding RIF.
Parameters:
  args - Input arguments that include sources.
Parameters:
  layout - Destination image layout; may be null.



isMediaLibCompatible
public static boolean isMediaLibCompatible(ParameterBlock args)(Code)
Returns true if mediaLib is able to handle the source(s) image format. Currently, all of the following conditions must be met in order for this method to return true.
  • MediaLib is available.
  • All sources must be RenderedImage.
  • All sources must have ComponentSampleModel and ComponentColorModel.
  • All sources must have less than or equal to 4 bands of pixel data.
Additional checks for each individual OpImage should be done in its corresponding RIF.
Parameters:
  args - Input arguments that include sources.



isMediaLibCompatible
public static boolean isMediaLibCompatible(RenderedImage image)(Code)
Returns true if mediaLib is able to handle the image. Currently, all of the following conditions must be met in order for this method to return true.
  • MediaLib is available.
  • The image must have ComponentSampleModel and ComponentColorModel.
  • The image must have less than or equal to 4 bands of pixel data.
Additional checks for each individual OpImage should be done in its corresponding RIF.
Parameters:
  image - The image the compatibility of which is to be checked.



isMediaLibCompatible
public static boolean isMediaLibCompatible(SampleModel sm, ColorModel cm)(Code)
Returns true if mediaLib is able to handle an image having the supplied SampleModel and ColorModel. Currently, all of the following conditions must be met in order for this method to return true:
  • mediaLib is available.
  • The SampleModel is an instance of ComponentSampleModel or one of its subclasses.
  • The ColorModel is null or an instance of ComponentColorModel or a subclass thereof.
  • The image must have no more than 4 bands of pixel data.

Parameters:
  sm - The image SampleModel.
Parameters:
  cm - The image ColorModel.
throws:
  NullPointerException - if sm is null.



isPixelSequential
public static boolean isPixelSequential(SampleModel sm)(Code)
Determines if the SampleModel stores data in a way that can be represented by a mediaLibImage without copying



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.