[]
        
(Showing Draft Content)

CSJ2K.j2k.codestream.writer.HeaderEncoder

HeaderEncoder Class

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.

       <p>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:
       <ul><li>Delimiting : SOC,SOT,SOD,EOC (written in FileCodestreamWriter).</li><li>Fixed information: SIZ.</li><li>Functional: COD,COC,RGN,QCD,QCC,POC.</li><li> In bit-stream: SOP,EPH.</li><li> Pointer: TLM,PLM,PLT,PPM,PPT.</li><li> Informational: CRG,COM.</li></ul></p><p>Main Header is written when Encoder instance calls encodeMainHeader
       whereas tile-part headers are written when the EBCOTRateAllocator instance
       calls encodeTilePartHeader.</p>
Inheritance
HeaderEncoder
Namespace: CSJ2K.j2k.codestream.writer
Assembly: C1.WPF.PdfViewer.4.6.2.dll
Syntax
public class HeaderEncoder

Constructors

Name Description
HeaderEncoder(ImgData, bool[], ForwardWT, Tiler, EncoderSpecs, ROIScaler, PostCompRateAllocator, ParameterList)

Initializes the header writer with the references to the coding chain.

Fields

Name Description
OPT_PREFIX

The prefix for the header encoder options: 'H'

baos

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.

dwt

Reference to the DWT module

encSpec

The encoder specifications

hbuf

The DataOutputStream to store header data. This kind of object is useful to write short, int, .... It's constructor takes baos as parameter.

isOrigSig

An array specifying, for each component,if the data was signed or not

origSrc

The image data reader. Source of original data info

ralloc

Reference to the rate allocator

roiSc

Reference to the ROI module

tiler

Reference to the tiler module

Properties

Name Description
Buffer

Returns the byte-buffer used to store the codestream header.

BufferLength

Returns the number of bytes used in the codestream header's buffer.

Length

Returns the length of the header.

ParameterInfo

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.

Methods

Name Description
encodeMainHeader()

Write main header. JJ2000 main header corresponds to the following sequence of marker segments:

       <ol><li>SOC</li><li>SIZ</li><li>COD</li><li>COC (if needed)</li><li>QCD</li><li>QCC (if needed)</li><li>POC (if needed)</li></ol>
encodeTilePartHeader(int, int)

Writes tile-part header. JJ2000 tile-part header corresponds to the following sequence of marker segments:

       <ol><li>SOT</li><li>COD (if needed)</li><li>COC (if needed)</li><li>QCD (if needed)</li><li>QCC (if needed)</li><li>RGN (if needed)</li><li>POC (if needed)</li><li>SOD</li></ol>
reset()

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(bool, int, int)

Writes COC marker segment . It is a functional marker containing the coding style for one component (coding style, decomposition, layering).

       <p>Its values overrides any value previously set in COD in the main
       header or in the tile header.</p>
writeCOD(bool, int)

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.

       <p>The values can be overriden for an individual component by a COC
       marker in either the main or the tile header.</p>
writeMainQCC(int)

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.

writeMainQCD()

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(bool, int)

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.

writeTileQCC(int, int)

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.

writeTileQCD(int)

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.

writeTo(BinaryDataOutput)

Writes the header to the specified BinaryDataOutput.

writeTo(Stream)

Writes the header to the specified OutputStream.

See Also