C# 클래스 CSJ2K.j2k.codestream.writer.HeaderEncoder

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.

파일 보기 프로젝트 열기: cureos/csj2k 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
baos System.IO.MemoryStream
dwt CSJ2K.j2k.wavelet.analysis.ForwardWT
encSpec CSJ2K.j2k.encoder.EncoderSpecs
hbuf System.IO.BinaryWriter
isOrigSig bool[]
origSrc ImgData
ralloc CSJ2K.j2k.entropy.encoder.PostCompRateAllocator
roiSc CSJ2K.j2k.roi.encoder.ROIScaler
tiler CSJ2K.j2k.image.Tiler

공개 메소드들

메소드 설명
HeaderEncoder ( ImgData origsrc, bool isorigsig, ForwardWT dwt, Tiler tiler, CSJ2K.j2k.encoder.EncoderSpecs encSpec, ROIScaler roiSc, PostCompRateAllocator ralloc, CSJ2K.j2k.util.ParameterList pl ) : System

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

encodeMainHeader ( ) : void

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 ( int tileLength, int tileIdx ) : void

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

reset ( ) : void

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.

writeTo ( BinaryDataOutput out_Renamed ) : void

Writes the header to the specified BinaryDataOutput.

writeTo ( System out_Renamed ) : void

Writes the header to the specified OutputStream.

보호된 메소드들

메소드 설명
writeCOC ( bool mh, int tileIdx, int compIdx ) : void

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.

writeCOD ( bool mh, int tileIdx ) : void

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.

writeMainQCC ( int compIdx ) : void

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 ( ) : void

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 mh, int tileIdx ) : void

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 t, int compIdx ) : void

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 tIdx ) : void

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.

비공개 메소드들

메소드 설명
writeCOM ( ) : void

Write COM marker segment(s) to the codestream.

This marker is currently written in main header and indicates the JJ2000 encoder's version that has created the codestream.

writeRGN ( int tIdx ) : void

Writes the RGN marker segment in the tile header. It describes the scaling value in each tile component

May be used in tile or main header. If used in main header, it refers to a ROI of the whole image, regardless of tiling. When used in tile header, only the particular tile is affected.

writeSIZ ( ) : void

Writes SIZ marker segment of the codestream header. It is a fixed information marker segment containing informations about image and tile sizes. It is required in the main header immediately after SOC marker segment.

writeSOC ( ) : void

Start Of Codestream marker (SOC) signalling the beginning of a codestream.

메소드 상세

HeaderEncoder() 공개 메소드

Initializes the header writer with the references to the coding chain.
public HeaderEncoder ( ImgData origsrc, bool isorigsig, ForwardWT dwt, Tiler tiler, CSJ2K.j2k.encoder.EncoderSpecs encSpec, ROIScaler roiSc, PostCompRateAllocator ralloc, CSJ2K.j2k.util.ParameterList pl ) : System
origsrc ImgData The original image data (before any component mixing, /// tiling, etc.) /// ///
isorigsig bool An array specifying for each component if it was /// originally signed or not. /// ///
dwt CSJ2K.j2k.wavelet.analysis.ForwardWT The discrete wavelet transform module. /// ///
tiler CSJ2K.j2k.image.Tiler The tiler module. /// ///
encSpec CSJ2K.j2k.encoder.EncoderSpecs The encoder specifications /// ///
roiSc CSJ2K.j2k.roi.encoder.ROIScaler The ROI scaler module. /// ///
ralloc CSJ2K.j2k.entropy.encoder.PostCompRateAllocator The post compression rate allocator. /// ///
pl CSJ2K.j2k.util.ParameterList ParameterList instance. /// ///
리턴 System

encodeMainHeader() 공개 메소드

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)
public encodeMainHeader ( ) : void
리턴 void

encodeTilePartHeader() 공개 메소드

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
public encodeTilePartHeader ( int tileLength, int tileIdx ) : void
tileLength int
tileIdx int Index of the tile to write /// ///
리턴 void

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.
public reset ( ) : void
리턴 void

writeCOC() 보호된 메소드

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.

protected writeCOC ( bool mh, int tileIdx, int compIdx ) : void
mh bool Flag indicating whether the main header is to be written. /// ///
tileIdx int Tile index. /// ///
compIdx int index of the component which need use of the COC marker /// segment. /// ///
리턴 void

writeCOD() 보호된 메소드

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.

protected writeCOD ( bool mh, int tileIdx ) : void
mh bool Flag indicating whether this marker belongs to the main /// header /// ///
tileIdx int Tile index if the marker belongs to a tile-part header /// ///
리턴 void

writeMainQCC() 보호된 메소드

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.
protected writeMainQCC ( int compIdx ) : void
compIdx int Index of the component which needs QCC marker segment. /// ///
리턴 void

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.
protected writeMainQCD ( ) : void
리턴 void

writePOC() 보호된 메소드

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.
protected writePOC ( bool mh, int tileIdx ) : void
mh bool Flag indicating whether the main header is to be written /// ///
tileIdx int Tile index /// ///
리턴 void

writeTileQCC() 보호된 메소드

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.
protected writeTileQCC ( int t, int compIdx ) : void
t int Tile index /// ///
compIdx int Index of the component which needs QCC marker segment. /// ///
리턴 void

writeTileQCD() 보호된 메소드

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.
protected writeTileQCD ( int tIdx ) : void
tIdx int Tile index /// ///
리턴 void

writeTo() 공개 메소드

Writes the header to the specified BinaryDataOutput.
public writeTo ( BinaryDataOutput out_Renamed ) : void
out_Renamed BinaryDataOutput
리턴 void

writeTo() 공개 메소드

Writes the header to the specified OutputStream.
public writeTo ( System out_Renamed ) : void
out_Renamed System
리턴 void

프로퍼티 상세

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.
protected System.IO.MemoryStream baos
리턴 System.IO.MemoryStream

dwt 보호되어 있는 프로퍼티

Reference to the DWT module
protected ForwardWT,CSJ2K.j2k.wavelet.analysis dwt
리턴 CSJ2K.j2k.wavelet.analysis.ForwardWT

encSpec 보호되어 있는 프로퍼티

The encoder specifications
protected EncoderSpecs,CSJ2K.j2k.encoder encSpec
리턴 CSJ2K.j2k.encoder.EncoderSpecs

hbuf 보호되어 있는 프로퍼티

The DataOutputStream to store header data. This kind of object is useful to write short, int, .... It's constructor takes baos as parameter.
protected System.IO.BinaryWriter hbuf
리턴 System.IO.BinaryWriter

isOrigSig 보호되어 있는 프로퍼티

An array specifying, for each component,if the data was signed or not
protected bool[] isOrigSig
리턴 bool[]

origSrc 보호되어 있는 프로퍼티

The image data reader. Source of original data info
protected ImgData origSrc
리턴 ImgData

ralloc 보호되어 있는 프로퍼티

Reference to the rate allocator
protected PostCompRateAllocator,CSJ2K.j2k.entropy.encoder ralloc
리턴 CSJ2K.j2k.entropy.encoder.PostCompRateAllocator

roiSc 보호되어 있는 프로퍼티

Reference to the ROI module
protected ROIScaler,CSJ2K.j2k.roi.encoder roiSc
리턴 CSJ2K.j2k.roi.encoder.ROIScaler

tiler 보호되어 있는 프로퍼티

Reference to the tiler module
protected Tiler,CSJ2K.j2k.image tiler
리턴 CSJ2K.j2k.image.Tiler