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


java.lang.Object
   com.sun.media.imageio.stream.RawImageInputStream

RawImageInputStream
public class RawImageInputStream implements ImageInputStream(Code)
This class defines the content of the ImageInputStream containing several raw images with the same image type: the number of the images, the image type, the offset for the first sample of each image, and the image size information.

ImageInputStream methods are not commented individually. These methods merely forward the call to the ImageInputStream specified when the RawImageInputStream is constructed.




Constructor Summary
public  RawImageInputStream(ImageInputStream source, ImageTypeSpecifier type, long[] imageOffsets, Dimension[] imageDimensions)
     Constructor.
public  RawImageInputStream(ImageInputStream source, SampleModel sampleModel, long[] imageOffsets, Dimension[] imageDimensions)
     Constructor.

This constructor is the same as RawImageInputStream.RawImageInputStream(ImageInputStream,ImageTypeSpecifier,long[],Dimension[]) except that a SampleModel is supplied instead of an ImageTypeSpecifier.

public  RawImageInputStream(ImageInputStream source, org.xml.sax.InputSource xmlSource)
     Constructor. The xmlSource must adhere to the following DTD:
 <!DOCTYPE "com_sun_media_imageio_stream_raw_1.0" [
 <!ELEMENT com_sun_media_imageio_stream_raw_1.0
 (byteOrder?, offset?, width?, height?,
 (ComponentSampleModel |
 MultiPixelPackedSampleModel |
 SinglePixelPackedSampleModel),
 (ComponentColorModel |
 DirectColorModel |
 IndexColorModel)?)>
 <!ATTLIST com_sun_media_imageio_stream_raw_1.0
 xmlns CDATA #FIXED "http://com/sun/media/imageio">
 <!ELEMENT byteOrder (#PCDATA)>
 <!-- Byte order of data stream -->
 <!-- Either "NETWORK" or "REVERSE" -->
 <!-- Data type: String -->
 <!ELEMENT offset (#PCDATA)>
 <!-- Byte offset to the image data in the stream -->
 <!-- Data type: long -->
 <!ELEMENT width (#PCDATA)>
 <!-- Image width; default value is SampleModel width -->
 <!-- Data type: int -->
 <!ELEMENT height (#PCDATA)>
 <!-- Image height; default value is SampleModel height -->
 <!-- Data type: int -->
 <!ELEMENT ComponentSampleModel EMPTY>
 <!-- ComponentSampleModel -->
 <!ATTLIST ComponentSampleModel
 dataType (BYTE | USHORT | SHORT | INT | FLOAT | DOUBLE) #REQUIRED
 <!-- Data type: String -->
 w              CDATA #REQUIRED
 <!-- SampleModel width -->
 <!-- Data type: int -->
 h              CDATA #REQUIRED
 <!-- SampleModel height -->
 <!-- Data type: int -->
 pixelStride    CDATA "1"
 <!-- SampleModel pixel stride -->
 <!-- Data type: int -->
 scanlineStride CDATA #REQUIRED
 <!-- SampleModel line stride -->
 <!-- Data type: int -->
 bankIndices    CDATA #IMPLIED
 <!-- SampleModel bank indices -->
 <!-- Data type: int array -->
 bandOffsets    CDATA #REQUIRED>
 <!-- SampleModel band offsets -->
 <!-- Data type: int array -->
 <!ELEMENT MultiPixelPackedSampleModel EMPTY>
 <!-- MultiPixelPackedSampleModel -->
 <!ATTLIST MultiPixelPackedSampleModel
 dataType       (BYTE | USHORT | INT) #REQUIRED
 <!-- Data type: String -->
 w              CDATA #REQUIRED
 <!-- SampleModel width -->
 <!-- Data type: int -->
 h              CDATA #REQUIRED
 <!-- SampleModel height -->
 <!-- Data type: int -->
 numberOfBits   CDATA #REQUIRED
 <!-- Number of bits per pixel -->
 <!-- Data type: int -->
 scanlineStride CDATA #REQUIRED
 <!-- SampleModel line stride -->
 <!-- Data type: int -->
 dataBitOffset  CDATA "0">
 <!-- Offset to first valid bit in a line -->
 <!-- Data type: int -->
 <!ELEMENT SinglePixelPackedSampleModel EMPTY>
 <!-- SinglePixelPackedSampleModel -->
 <!ATTLIST SinglePixelPackedSampleModel
 dataType       (BYTE | USHORT | INT) #REQUIRED
 <!-- Data type: String -->
 w              CDATA #REQUIRED
 <!-- SampleModel width -->
 <!-- Data type: int -->
 h              CDATA #REQUIRED
 <!-- SampleModel height -->
 <!-- Data type: int -->
 scanlineStride CDATA #REQUIRED
 <!-- SampleModel line stride -->
 <!-- Data type: int -->
 bitMasks       CDATA #REQUIRED>
 <!-- Masks indicating RGBA positions -->
 <!-- Data type: int -->
 <!ELEMENT ComponentColorModel EMPTY>
 <!-- ComponentColorModel -->
 <!ATTLIST ComponentColorModel
 colorSpace (CIEXYZ | GRAY | LINEAR_RGB | PYCC | sRGB | URL)
 #REQUIRED
 <!-- A string representing a predefined ColorSpace or a URI
 representing the location of any ICC profile from which
 a ColorSpace may be created.

Method Summary
public  voidclose()
    
public  voidflush()
    
public  voidflushBefore(long pos)
    
public  intgetBitOffset()
    
public  ByteOrdergetByteOrder()
    
public  longgetFlushedPosition()
    
public  DimensiongetImageDimension(int imageIndex)
     Retrieves the dimnsion of the imageIndexth image.
Parameters:
  imageIndex - the index of the image of interest.
throws:
  IllegalArgumentException - If the provided parameter is out ofrangle.
public  longgetImageOffset(int imageIndex)
     Retrieves the image offset of the imageIndexth image.
Parameters:
  imageIndex - the index of the image of interest.
throws:
  IllegalArgumentException - If the provided parameter is out ofrange.
public  ImageTypeSpecifiergetImageType()
     Retrieves the image type.
public  intgetNumImages()
     Retrieves the number of images in the ImageInputStream.
public  longgetStreamPosition()
    
public  booleanisCached()
    
public  booleanisCachedFile()
    
public  booleanisCachedMemory()
    
public  longlength()
    
public  voidmark()
    
public  intread()
    
public  intread(byte[] b)
    
public  intread(byte[] b, int off, int len)
    
public  intreadBit()
    
public  longreadBits(int numBits)
    
public  booleanreadBoolean()
    
public  bytereadByte()
    
public  voidreadBytes(IIOByteBuffer buf, int len)
    
public  charreadChar()
    
public  doublereadDouble()
    
public  floatreadFloat()
    
public  voidreadFully(byte[] b, int off, int len)
    
public  voidreadFully(byte[] b)
    
public  voidreadFully(short[] s, int off, int len)
    
public  voidreadFully(char[] c, int off, int len)
    
public  voidreadFully(int[] i, int off, int len)
    
public  voidreadFully(long[] l, int off, int len)
    
public  voidreadFully(float[] f, int off, int len)
    
public  voidreadFully(double[] d, int off, int len)
    
public  intreadInt()
    
public  StringreadLine()
    
public  longreadLong()
    
public  shortreadShort()
    
public  StringreadUTF()
    
public  intreadUnsignedByte()
    
public  longreadUnsignedInt()
    
public  intreadUnsignedShort()
    
public  voidreset()
    
public  voidseek(long pos)
    
public  voidsetBitOffset(int bitOffset)
    
public  voidsetByteOrder(ByteOrder byteOrder)
    
public  intskipBytes(int n)
    
public  longskipBytes(long n)
    


Constructor Detail
RawImageInputStream
public RawImageInputStream(ImageInputStream source, ImageTypeSpecifier type, long[] imageOffsets, Dimension[] imageDimensions)(Code)
Constructor.
Parameters:
  source - The ImageInputStream containing all the rawimages.
Parameters:
  type - The ImageTypeSpecifier for all the imagesin the stream.
Parameters:
  imageOffsets - The position of the first sample for each imagein the stream.
Parameters:
  imageDimensions - The image size for each image in the stream.
throws:
  IllegalArgumentException - If the sizes ofimageOffsetsand imageDimensions are different or ifeither array is null.



RawImageInputStream
public RawImageInputStream(ImageInputStream source, SampleModel sampleModel, long[] imageOffsets, Dimension[] imageDimensions)(Code)
Constructor.

This constructor is the same as RawImageInputStream.RawImageInputStream(ImageInputStream,ImageTypeSpecifier,long[],Dimension[]) except that a SampleModel is supplied instead of an ImageTypeSpecifier. This constructor creates a ColorModel for the supplied SampleModel and then creates an ImageTypeSpecifier.

Suitable ColorModels are guaranteed to exist for all instances of ComponentSampleModel. For 1- and 3- banded SampleModels, the ColorModel will be opaque. For 2- and 4-banded SampleModels, the output will use alpha transparency which is not premultiplied. 1- and 2-banded data will use a grayscale ColorSpace, and 3- and 4-banded data a sRGB ColorSpace. Data with 5 or more bands will use a ColorSpace which satisfies compatibility constraints but is merely a placeholder and does not perform correct color conversion to and from the C.I.E. XYZ and sRGB color spaces.

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

An instance of IndexColorModel will be created for instances of MultiPixelPackedSampleModel. The colormap will be a grayscale ramp with 1 << numberOfBits entries ranging from zero to at most 255.


Parameters:
  source - The ImageInputStream containing all the rawimages.
Parameters:
  sampleModel - The SampleModel for all the imagesin the stream.
Parameters:
  imageOffsets - The position of the first sample for each imagein the stream.
Parameters:
  imageDimensions - The image size for each image in the stream.
throws:
  IllegalArgumentException - If sampleModel is null.
throws:
  IllegalArgumentException - If the sizes ofimageOffsetsand imageDimensions are different or ifeither array is null.
throws:
  IllegalArgumentException - If it is not possible to create aColorModel from the suppliedSampleModel.



RawImageInputStream
public RawImageInputStream(ImageInputStream source, org.xml.sax.InputSource xmlSource) throws SAXException, IOException(Code)
Constructor. The xmlSource must adhere to the following DTD:
 <!DOCTYPE "com_sun_media_imageio_stream_raw_1.0" [
 <!ELEMENT com_sun_media_imageio_stream_raw_1.0
 (byteOrder?, offset?, width?, height?,
 (ComponentSampleModel |
 MultiPixelPackedSampleModel |
 SinglePixelPackedSampleModel),
 (ComponentColorModel |
 DirectColorModel |
 IndexColorModel)?)>
 <!ATTLIST com_sun_media_imageio_stream_raw_1.0
 xmlns CDATA #FIXED "http://com/sun/media/imageio">
 <!ELEMENT byteOrder (#PCDATA)>
 <!-- Byte order of data stream -->
 <!-- Either "NETWORK" or "REVERSE" -->
 <!-- Data type: String -->
 <!ELEMENT offset (#PCDATA)>
 <!-- Byte offset to the image data in the stream -->
 <!-- Data type: long -->
 <!ELEMENT width (#PCDATA)>
 <!-- Image width; default value is SampleModel width -->
 <!-- Data type: int -->
 <!ELEMENT height (#PCDATA)>
 <!-- Image height; default value is SampleModel height -->
 <!-- Data type: int -->
 <!ELEMENT ComponentSampleModel EMPTY>
 <!-- ComponentSampleModel -->
 <!ATTLIST ComponentSampleModel
 dataType (BYTE | USHORT | SHORT | INT | FLOAT | DOUBLE) #REQUIRED
 <!-- Data type: String -->
 w              CDATA #REQUIRED
 <!-- SampleModel width -->
 <!-- Data type: int -->
 h              CDATA #REQUIRED
 <!-- SampleModel height -->
 <!-- Data type: int -->
 pixelStride    CDATA "1"
 <!-- SampleModel pixel stride -->
 <!-- Data type: int -->
 scanlineStride CDATA #REQUIRED
 <!-- SampleModel line stride -->
 <!-- Data type: int -->
 bankIndices    CDATA #IMPLIED
 <!-- SampleModel bank indices -->
 <!-- Data type: int array -->
 bandOffsets    CDATA #REQUIRED>
 <!-- SampleModel band offsets -->
 <!-- Data type: int array -->
 <!ELEMENT MultiPixelPackedSampleModel EMPTY>
 <!-- MultiPixelPackedSampleModel -->
 <!ATTLIST MultiPixelPackedSampleModel
 dataType       (BYTE | USHORT | INT) #REQUIRED
 <!-- Data type: String -->
 w              CDATA #REQUIRED
 <!-- SampleModel width -->
 <!-- Data type: int -->
 h              CDATA #REQUIRED
 <!-- SampleModel height -->
 <!-- Data type: int -->
 numberOfBits   CDATA #REQUIRED
 <!-- Number of bits per pixel -->
 <!-- Data type: int -->
 scanlineStride CDATA #REQUIRED
 <!-- SampleModel line stride -->
 <!-- Data type: int -->
 dataBitOffset  CDATA "0">
 <!-- Offset to first valid bit in a line -->
 <!-- Data type: int -->
 <!ELEMENT SinglePixelPackedSampleModel EMPTY>
 <!-- SinglePixelPackedSampleModel -->
 <!ATTLIST SinglePixelPackedSampleModel
 dataType       (BYTE | USHORT | INT) #REQUIRED
 <!-- Data type: String -->
 w              CDATA #REQUIRED
 <!-- SampleModel width -->
 <!-- Data type: int -->
 h              CDATA #REQUIRED
 <!-- SampleModel height -->
 <!-- Data type: int -->
 scanlineStride CDATA #REQUIRED
 <!-- SampleModel line stride -->
 <!-- Data type: int -->
 bitMasks       CDATA #REQUIRED>
 <!-- Masks indicating RGBA positions -->
 <!-- Data type: int -->
 <!ELEMENT ComponentColorModel EMPTY>
 <!-- ComponentColorModel -->
 <!ATTLIST ComponentColorModel
 colorSpace (CIEXYZ | GRAY | LINEAR_RGB | PYCC | sRGB | URL)
 #REQUIRED
 <!-- A string representing a predefined ColorSpace or a URI
 representing the location of any ICC profile from which
 a ColorSpace may be created. -->
 <!-- Data type: String -->
 bits                 CDATA          #IMPLIED
 <!-- Number of bits per color component -->
 <!-- Data type: int -->
 hasAlpha             (true | false) #REQUIRED
 <!-- Whether an alpha channel is present -->
 <!-- Data type: boolean -->
 isAlphaPremultiplied (true | false) #REQUIRED
 <!-- Whether any alpha channel is premultiplied -->
 <!-- Data type: boolean -->
 transparency         (BITMASK | OPAQUE | TRANSLUCENT) #REQUIRED
 <!-- The type of transparency -->
 transferType (BYTE | USHORT | SHORT | INT | FLOAT | DOUBLE)
 #REQUIRED>
 <!-- The data transfer type -->
 <!ELEMENT DirectColorModel EMPTY>
 <!-- DirectColorModel -->
 <!ATTLIST DirectColorModel
 colorSpace           (LINEAR_RGB | sRGB | URL) #IMPLIED
 <!-- A string representing a predefined RGB ColorSpace or a
 URL representing the location of any ICC profile from
 which an RGB ColorSpace may be created. -->
 <!-- Data type: String -->
 bits       CDATA #REQUIRED
 <!-- Number of bits per color component -->
 <!-- Data type: int -->
 rmask      CDATA #REQUIRED
 <!-- Bitmask of the red component -->
 <!-- Data type: int -->
 gmask      CDATA #REQUIRED
 <!-- Bitmask of the grenn component -->
 <!-- Data type: int -->
 bmask      CDATA #REQUIRED
 <!-- Bitmask of the blue component -->
 <!-- Data type: int -->
 amask      CDATA "0">
 <!-- Bitmask of the alpha component -->
 <!-- Data type: int -->
 <!ELEMENT IndexColorModel EMPTY>
 <!-- IndexColorModel -->
 <!ATTLIST IndexColorModel
 bits CDATA #REQUIRED
 <!-- Number of bits per color component -->
 <!-- Data type: int -->
 size CDATA #REQUIRED
 <!-- Number of elements in the colormap -->
 <!-- Data type: int -->
 r    CDATA #REQUIRED
 <!-- Red elements of the colormap -->
 <!-- Data type: byte array -->
 g    CDATA #REQUIRED
 <!-- Green elements of the colormap -->
 <!-- Data type: byte array -->
 b    CDATA #REQUIRED
 <!-- Blue elements of the colormap -->
 <!-- Data type: byte array -->
 a    CDATA #IMPLIED>
 <!-- Alpha elements of the colormap -->
 <!-- Data type: byte array -->
 ]>
 

Parameters:
  source - The ImageInputStream containing all the rawimages.
Parameters:
  xmlSource - The org.xml.sax.InputSource to providethe xml document in which the stream structure is defined.
throws:
  RuntimeException - If the parse configuration isn't correct.
throws:
  IllegalArgumentException - If the number of "width" elements isn'tthe same as the number of "height" elements.
throws:
  SAXException - If one is thrown in parsing.
throws:
  IOException - If one is thrown in parsing, or creating color spacefrom a URL.




Method Detail
close
public void close() throws IOException(Code)



flush
public void flush() throws IOException(Code)



flushBefore
public void flushBefore(long pos) throws IOException(Code)



getBitOffset
public int getBitOffset() throws IOException(Code)



getByteOrder
public ByteOrder getByteOrder()(Code)



getFlushedPosition
public long getFlushedPosition()(Code)



getImageDimension
public Dimension getImageDimension(int imageIndex)(Code)
Retrieves the dimnsion of the imageIndexth image.
Parameters:
  imageIndex - the index of the image of interest.
throws:
  IllegalArgumentException - If the provided parameter is out ofrangle. the size of the specified image.



getImageOffset
public long getImageOffset(int imageIndex)(Code)
Retrieves the image offset of the imageIndexth image.
Parameters:
  imageIndex - the index of the image of interest.
throws:
  IllegalArgumentException - If the provided parameter is out ofrange. the offset in the stream to the specified image.



getImageType
public ImageTypeSpecifier getImageType()(Code)
Retrieves the image type. the image type



getNumImages
public int getNumImages()(Code)
Retrieves the number of images in the ImageInputStream. the number of image in the stream.



getStreamPosition
public long getStreamPosition() throws IOException(Code)



isCached
public boolean isCached()(Code)



isCachedFile
public boolean isCachedFile()(Code)



isCachedMemory
public boolean isCachedMemory()(Code)



length
public long length() throws IOException(Code)



mark
public void mark()(Code)



read
public int read() throws IOException(Code)



read
public int read(byte[] b) throws IOException(Code)



read
public int read(byte[] b, int off, int len) throws IOException(Code)



readBit
public int readBit() throws IOException(Code)



readBits
public long readBits(int numBits) throws IOException(Code)



readBoolean
public boolean readBoolean() throws IOException(Code)



readByte
public byte readByte() throws IOException(Code)



readBytes
public void readBytes(IIOByteBuffer buf, int len) throws IOException(Code)



readChar
public char readChar() throws IOException(Code)



readDouble
public double readDouble() throws IOException(Code)



readFloat
public float readFloat() throws IOException(Code)



readFully
public void readFully(byte[] b, int off, int len) throws IOException(Code)



readFully
public void readFully(byte[] b) throws IOException(Code)



readFully
public void readFully(short[] s, int off, int len) throws IOException(Code)



readFully
public void readFully(char[] c, int off, int len) throws IOException(Code)



readFully
public void readFully(int[] i, int off, int len) throws IOException(Code)



readFully
public void readFully(long[] l, int off, int len) throws IOException(Code)



readFully
public void readFully(float[] f, int off, int len) throws IOException(Code)



readFully
public void readFully(double[] d, int off, int len) throws IOException(Code)



readInt
public int readInt() throws IOException(Code)



readLine
public String readLine() throws IOException(Code)



readLong
public long readLong() throws IOException(Code)



readShort
public short readShort() throws IOException(Code)



readUTF
public String readUTF() throws IOException(Code)



readUnsignedByte
public int readUnsignedByte() throws IOException(Code)



readUnsignedInt
public long readUnsignedInt() throws IOException(Code)



readUnsignedShort
public int readUnsignedShort() throws IOException(Code)



reset
public void reset() throws IOException(Code)



seek
public void seek(long pos) throws IOException(Code)



setBitOffset
public void setBitOffset(int bitOffset) throws IOException(Code)



setByteOrder
public void setByteOrder(ByteOrder byteOrder)(Code)



skipBytes
public int skipBytes(int n) throws IOException(Code)



skipBytes
public long skipBytes(long n) throws IOException(Code)



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.