Java Doc for HeaderEncoder.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » jj2000 » j2k » codestream » writer » 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 » jj2000.j2k.codestream.writer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jj2000.j2k.codestream.writer.HeaderEncoder

HeaderEncoder
public class HeaderEncoder implements Markers,StdEntropyCoderOptions(Code)
This class writes almost of the markers and marker segments in main header and in tile-part headers. It is created by the run() method of the Encoder instance.

A marker segment includes a marker and eventually marker segment parameters. It is designed by the three letter code of the marker associated with the marker segment. JPEG 2000 part I defines 6 types of markers:

  • Delimiting : SOC,SOT,SOD,EOC (written in FileCodestreamWriter).
  • Fixed information: SIZ.
  • Functional: COD,COC,RGN,QCD,QCC,POC.
  • In bit-stream: SOP,EPH.
  • Pointer: TLM,PLM,PLT,PPM,PPT.
  • Informational: CRG,COM.

Main Header is written when Encoder instance calls encodeMainHeader whereas tile-part headers are written when the EBCOTRateAllocator instance calls encodeTilePartHeader.
See Also:   Encoder
See Also:   Markers
See Also:   EBCOTRateAllocator



Field Summary
protected  ByteArrayOutputStreambaos
     The ByteArrayOutputStream to store header data.
protected  ForwardWTdwt
    
protected  DataOutputStreamhbuf
     The DataOutputStream to store header data.
protected  booleanisOrigSig
    
protected  intnComp
    
protected  ImgDataorigSrc
     The image data reader.
protected  PostCompRateAllocatorralloc
    
protected  ROIScalerroiSc
    
protected  Tilertiler
    
protected  J2KImageWriteParamJavawp
    

Constructor Summary
public  HeaderEncoder(ImgData origsrc, boolean isorigsig, ForwardWT dwt, Tiler tiler, J2KImageWriteParamJava wp, ROIScaler roiSc, PostCompRateAllocator ralloc)
     Initializes the header writer with the references to the coding chain.

Method Summary
public  voidencodeMainHeader()
     Write main header.
public  voidencodeTilePartHeader(int tileLength, int tileIdx)
     Writes tile-part header.
protected  byte[]getBuffer()
     Returns the byte-buffer used to store the codestream header.
protected  intgetBufferLength()
     Returns the number of bytes used in the codestream header's buffer.
public  intgetLength()
     Returns the length of the header.
public  voidreset()
     Resets the contents of this HeaderEncoder to its initial state.
protected  voidwriteCOC(boolean mh, int tileIdx, int compIdx)
     Writes COC marker segment .
protected  voidwriteCOD(boolean mh, int tileIdx)
     Writes COD marker segment.
protected  voidwriteMainQCC(int compIdx)
     Writes QCC marker segment in main header.
protected  voidwriteMainQCD()
     Writes QCD marker segment in main header.
protected  voidwritePOC(boolean mh, int tileIdx)
     Writes POC marker segment.
protected  voidwriteTileQCC(int t, int compIdx)
     Writes QCC marker segment in tile header.
protected  voidwriteTileQCD(int tIdx)
     Writes QCD marker segment in tile header.
public  voidwriteTo(BinaryDataOutput out)
     Writes the header to the specified BinaryDataOutput.
public  voidwriteTo(OutputStream out)
     Writes the header to the specified OutputStream.

Field Detail
baos
protected ByteArrayOutputStream baos(Code)
The ByteArrayOutputStream to store header data. This handler is kept in order to use methods not accessible from a general DataOutputStream. For the other methods, it's better to use variable hbuf.
See Also:   HeaderEncoder.hbuf
See Also:   



dwt
protected ForwardWT dwt(Code)
Reference to the DWT module



hbuf
protected DataOutputStream hbuf(Code)
The DataOutputStream to store header data. This kind of object is useful to write short, int, .... It's constructor takes baos as parameter.
See Also:   HeaderEncoder.baos



isOrigSig
protected boolean isOrigSig(Code)
An array specifying, for each component,if the data was signed or not



nComp
protected int nComp(Code)
The number of components in the image



origSrc
protected ImgData origSrc(Code)
The image data reader. Source of original data info



ralloc
protected PostCompRateAllocator ralloc(Code)
Reference to the rate allocator



roiSc
protected ROIScaler roiSc(Code)
Reference to the ROI module



tiler
protected Tiler tiler(Code)
Reference to the tiler module



wp
protected J2KImageWriteParamJava wp(Code)
The encoder specifications




Constructor Detail
HeaderEncoder
public HeaderEncoder(ImgData origsrc, boolean isorigsig, ForwardWT dwt, Tiler tiler, J2KImageWriteParamJava wp, ROIScaler roiSc, PostCompRateAllocator ralloc)(Code)
Initializes the header writer with the references to the coding chain.
Parameters:
  origsrc - The original image data (before any component mixing,tiling, etc.)
Parameters:
  isorigsig - An array specifying for each component if it wasoriginally signed or not.
Parameters:
  dwt - The discrete wavelet transform module.
Parameters:
  tiler - The tiler module.
Parameters:
  encSpec - The encoder specifications
Parameters:
  roiSc - The ROI scaler module.
Parameters:
  ralloc - The post compression rate allocator.




Method Detail
encodeMainHeader
public void encodeMainHeader() throws IOException(Code)
Write main header. JJ2000 main header corresponds to the following sequence of marker segments:
  1. SOC
  2. SIZ
  3. COD
  4. COC (if needed)
  5. QCD
  6. QCC (if needed)
  7. POC (if needed)



encodeTilePartHeader
public void encodeTilePartHeader(int tileLength, int tileIdx) throws IOException(Code)
Writes tile-part header. JJ2000 tile-part header corresponds to the following sequence of marker segments:
  1. SOT
  2. COD (if needed)
  3. COC (if needed)
  4. QCD (if needed)
  5. QCC (if needed)
  6. RGN (if needed)
  7. POC (if needed)
  8. SOD

Parameters:
  length - The length of the current tile-part.
Parameters:
  tileIdx - Index of the tile to write



getBuffer
protected byte[] getBuffer()(Code)
Returns the byte-buffer used to store the codestream header. A byte array countaining codestream header



getBufferLength
protected int getBufferLength()(Code)
Returns the number of bytes used in the codestream header's buffer. Header length in buffer (without any headeroverhead)



getLength
public int getLength()(Code)
Returns the length of the header. The length of the header in bytes



reset
public void reset()(Code)
Resets the contents of this HeaderEncoder to its initial state. It erases all the data in the header buffer and reactualizes the headerLength field of the bit stream writer.



writeCOC
protected void writeCOC(boolean mh, int tileIdx, int compIdx) throws IOException(Code)
Writes COC marker segment . It is a functional marker containing the coding style for one component (coding style, decomposition, layering).

Its values overrides any value previously set in COD in the main header or in the tile header.
Parameters:
  mh - Flag indicating whether the main header is to be written
Parameters:
  tileIdx - Tile index
Parameters:
  compIdx - index of the component which need use of the COC markersegment.
See Also:   HeaderEncoder.writeCOD




writeCOD
protected void writeCOD(boolean mh, int tileIdx) throws IOException(Code)
Writes COD marker segment. COD is a functional marker segment containing the code style default (coding style, decomposition, layering) used for compressing all the components in an image.

The values can be overriden for an individual component by a COC marker in either the main or the tile header.
Parameters:
  mh - Flag indicating whether this marker belongs to the mainheader
Parameters:
  tileIdx - Tile index if the marker belongs to a tile-part header
See Also:   HeaderEncoder.writeCOC




writeMainQCC
protected void writeMainQCC(int compIdx) throws IOException(Code)
Writes QCC marker segment in main header. It is a functional marker segment countaining the quantization used for compressing the specified component in an image. The values override for the specified component what was defined by a QCC marker in either the main or the tile header.
Parameters:
  compIdx - Index of the component which needs QCC markersegment.



writeMainQCD
protected void writeMainQCD() throws IOException(Code)
Writes QCD marker segment in main header. QCD is a functional marker segment countaining the quantization default used for compressing all the components in an image. The values can be overriden for an individual component by a QCC marker in either the main or the tile header.



writePOC
protected void writePOC(boolean mh, int tileIdx) throws IOException(Code)
Writes POC marker segment. POC is a functional marker segment containing the bounds and progression order for any progression order other than default in the codestream.
Parameters:
  mh - Flag indicating whether the main header is to be written
Parameters:
  tileIdx - Tile index



writeTileQCC
protected void writeTileQCC(int t, int compIdx) throws IOException(Code)
Writes QCC marker segment in tile header. It is a functional marker segment countaining the quantization used for compressing the specified component in an image. The values override for the specified component what was defined by a QCC marker in either the main or the tile header.
Parameters:
  t - Tile index
Parameters:
  compIdx - Index of the component which needs QCC markersegment.



writeTileQCD
protected void writeTileQCD(int tIdx) throws IOException(Code)
Writes QCD marker segment in tile header. QCD is a functional marker segment countaining the quantization default used for compressing all the components in an image. The values can be overriden for an individual component by a QCC marker in either the main or the tile header.
Parameters:
  tIdx - Tile index



writeTo
public void writeTo(BinaryDataOutput out) throws IOException(Code)
Writes the header to the specified BinaryDataOutput.
Parameters:
  out - Where to write the header.



writeTo
public void writeTo(OutputStream out) throws IOException(Code)
Writes the header to the specified OutputStream.
Parameters:
  out - Where to write the header.



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.