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

PktEncoder
public class PktEncoder (Code)
This class builds packets and keeps the state information of packet interdependencies. It also supports saving the state and reverting (restoring) to the last saved state, with the save() and restore() methods.

Each time the encodePacket() method is called a new packet is encoded, the packet header is returned by the method, and the packet body can be obtained with the getLastBodyBuf() and getLastBodyLen() methods.



Field Summary
final public static  charOPT_PREFIX
    
 J2KImageWriteParamJavawp
    

Constructor Summary
public  PktEncoder(CodedCBlkDataSrcEnc infoSrc, J2KImageWriteParamJava wp, Point[][][] numPrec)
     Creates a new packet header encoder, using the information from the 'infoSrc' object.

Method Summary
public  BitOutputBufferencodePacket(int ly, int c, int r, int t, CBlkRateDistStats cbs, int tIndx, BitOutputBuffer hbuf, byte bbuf, int pIdx)
     Encodes a packet and returns the buffer containing the encoded packet header.
public  byte[]getLastBodyBuf()
     Returns the buffer of the body of the last encoded packet.
public  intgetLastBodyLen()
     Returns the length of the body of the last encoded packet, in bytes.
public static  String[][]getParameterInfo()
     Returns the parameters that are used in this class and implementing classes.
public  PrecInfogetPrecInfo(int t, int c, int r, int p)
    
public  intgetROILen()
    
public  booleanisPacketWritable()
     Returns true if the current packet is writable i.e.
public  booleanisROIinPkt()
    
public  voidreset()
     Resets the state of the object to the initial state, as if the object was just created.
public  voidrestore()
     Restores the last saved state of this object.
public  voidsave()
     Saves the current state of this object.

Field Detail
OPT_PREFIX
final public static char OPT_PREFIX(Code)
The prefix for packet encoding options: 'P'



wp
J2KImageWriteParamJava wp(Code)
The encoder specs




Constructor Detail
PktEncoder
public PktEncoder(CodedCBlkDataSrcEnc infoSrc, J2KImageWriteParamJava wp, Point[][][] numPrec)(Code)
Creates a new packet header encoder, using the information from the 'infoSrc' object. The information used is the number of components, number of tiles, subband decomposition, etc.

Note that this constructor visits all the tiles in the 'infoSrc' object. The 'infoSrc' object is left at the original tile (i.e. the current tile before calling this constructor), but any side effects of visiting the tiles is not reverted.
Parameters:
  infoSrc - The source of information to construct theobject.
Parameters:
  encSpec - The parameters for the encoding
Parameters:
  maxNumPrec - Maximum number of precinct in each tile, componentand resolution level.
Parameters:
  pl - ParameterList instance that holds command line options





Method Detail
encodePacket
public BitOutputBuffer encodePacket(int ly, int c, int r, int t, CBlkRateDistStats cbs, int tIndx, BitOutputBuffer hbuf, byte bbuf, int pIdx)(Code)
Encodes a packet and returns the buffer containing the encoded packet header. The code-blocks appear in a 3D array of CBlkRateDistStats, 'cbs'. The first index is the tile index in lexicographical order, the second index is the subband index (as defined in the Subband class), and the third index is the code-block index (whithin the subband tile) in lexicographical order as well. The indexes of the new truncation points for each code-block are specified by the 3D array of int 'tIndx'. The indices of this array are the same as for cbs. The truncation point indices in 'tIndx' are the indices of the elements of the 'truncIdxs' array, of the CBlkRateDistStats class, that give the real truncation points. If a truncation point index is negative it means that the code-block has not been included in any layer yet. If the truncation point is less than or equal to the highest truncation point used in previous layers then the code-block is not included in the packet. Otherwise, if larger, the code-block is included in the packet. The body of the packet can be obtained with the getLastBodyBuf() and getLastBodyLen() methods.

Layers must be coded in increasing order, in consecutive manner, for each tile, component and resolution level (e.g., layer 1, then layer 2, etc.). For different tile, component and/or resolution level no particular order must be followed.


Parameters:
  ly - The layer index (starts at 1).
Parameters:
  c - The component index.
Parameters:
  r - The resolution level
Parameters:
  t - Index of the current tile
Parameters:
  cbs - The 3D array of coded code-blocks.
Parameters:
  tIndx - The truncation point indices for each code-block.
Parameters:
  hbuf - The header buffer. If null a new BitOutputBuffer is createdand returned. This buffer is reset before anything is written to it.
Parameters:
  bbuf - The body buffer. If null a new one is created. If not largeenough a new one is created.
Parameters:
  pIdx - The precinct index. The buffer containing the packet header.



getLastBodyBuf
public byte[] getLastBodyBuf()(Code)
Returns the buffer of the body of the last encoded packet. The length of the body can be retrieved with the getLastBodyLen() method. The length of the array returned by this method may be larger than the actual body length. The buffer of body of the last encoded packet.
exception:
  IllegalArgumentException - If no packet has been coded sincelast reset(), last restore(), or object creation.
See Also:   PktEncoder.getLastBodyLen



getLastBodyLen
public int getLastBodyLen()(Code)
Returns the length of the body of the last encoded packet, in bytes. The body itself can be retrieved with the getLastBodyBuf() method. The length of the body of last encoded packet, in bytes.
See Also:   PktEncoder.getLastBodyBuf



getParameterInfo
public static String[][] getParameterInfo()(Code)
Returns the parameters that are used in this class and implementing classes. It returns a 2D String array. Each of the 1D arrays is for a different option, and they have 3 elements. The first element is the option name, the second one is the synopsis, the third one is a long description of what the parameter is and the fourth is its default value. The synopsis or description may be 'null', in which case it is assumed that there is no synopsis or description of the option, respectively. Null may be returned if no options are supported. the options name, their synopsis and their explanation,or null if no options are supported.



getPrecInfo
public PrecInfo getPrecInfo(int t, int c, int r, int p)(Code)
Returns information about a given precinct
Parameters:
  t - Tile index.
Parameters:
  c - Component index.
Parameters:
  r - Resolution level index.
Parameters:
  p - Precinct index



getROILen
public int getROILen()(Code)
Gives the length to read in current packet body to get all ROI information



isPacketWritable
public boolean isPacketWritable()(Code)
Returns true if the current packet is writable i.e. should be written. Returns false otherwise.



isROIinPkt
public boolean isROIinPkt()(Code)
Tells if there was ROI information in the last written packet



reset
public void reset()(Code)
Resets the state of the object to the initial state, as if the object was just created.



restore
public void restore()(Code)
Restores the last saved state of this object. An IllegalArgumentException is thrown if no state has been saved.
See Also:   PktEncoder.save



save
public void save()(Code)
Saves the current state of this object. The last saved state can be restored with the restore() method.
See Also:   PktEncoder.restore



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.