ComponentOne PdfViewer for WPF and Silverlight
C1.WPF.PdfViewer.4.6.2 Assembly / CSJ2K.j2k.codestream.writer Namespace / PktEncoder Class / encodePacket Method
The layer index (starts at 1).
The component index.
The resolution level
Index of the current tile
The 3D array of coded code-blocks.
The truncation point indices for each code-block.
The header buffer. If null a new BitOutputBuffer is created and returned. This buffer is reset before anything is written to it.
The body buffer. If null a new one is created. If not large enough a new one is created.
The precinct index.

In This Topic
    encodePacket Method
    In This Topic
    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.

    Syntax
    'Declaration
     
    
    Public Overridable Function encodePacket( _
       ByVal ly As Integer, _
       ByVal c As Integer, _
       ByVal r As Integer, _
       ByVal t As Integer, _
       ByVal cbs() As CBlkRateDistStats, _
       ByVal tIndx() As Integer, _
       ByVal hbuf As BitOutputBuffer, _
       ByVal bbuf() As Byte, _
       ByVal pIdx As Integer _
    ) As BitOutputBuffer
    public virtual BitOutputBuffer encodePacket( 
       int ly,
       int c,
       int r,
       int t,
       CBlkRateDistStats[] cbs,
       int[] tIndx,
       BitOutputBuffer hbuf,
       byte[] bbuf,
       int pIdx
    )

    Parameters

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

    Return Value

    The buffer containing the packet header.
    See Also