[]
        
(Showing Draft Content)

CSJ2K.j2k.image.Tiler

Tiler Class

This class places an image in the canvas coordinate system, tiles it, if so specified, and performs the coordinate conversions transparently. The source must be a 'BlkImgDataSrc' which is not tiled and has a the image origin at the canvas origin (i.e. it is not "canvased"), or an exception is thrown by the constructor. A tiled and "canvased" output is given through the 'BlkImgDataSrc' interface. See the 'ImgData' interface for a description of the canvas and tiling.

       <p>All tiles produced are rectangular, non-overlapping and their union
       covers all the image. However, the tiling may not be uniform, depending on
       the nominal tile size, tiling origin, component subsampling and other
       factors. Therefore it might not be assumed that all tiles are of the same
       width and height.</p><p>The nominal dimension of the tiles is the maximal one, in the reference
       grid. All the components of the image have the same number of tiles.</p>
Inheritance
Tiler
Implements
Namespace: CSJ2K.j2k.image
Assembly: C1.WPF.PdfViewer.4.6.2.dll
Syntax
public class Tiler : ImgDataAdapter, BlkImgDataSrc, ImgData

Constructors

Name Description
Tiler(BlkImgDataSrc, int, int, int, int, int, int)

Properties

Name Description
ImgULX

Returns the horizontal coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid.

ImgULY

Returns the vertical coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid.

NomTileHeight

Returns the nominal width of the tiles in the reference grid.

NomTileWidth

Returns the nominal width of the tiles in the reference grid.

TileHeight

Returns the overall height of the current tile in pixels. This is the tile's width without accounting for any component subsampling.

TileIdx

Returns the index of the current tile, relative to a standard scan-line order.

TilePartULX

Returns the horizontal tile partition offset in the reference grid

TilePartULY

Returns the vertical tile partition offset in the reference grid

TileWidth

Returns the overall width of the current tile in pixels. This is the tile's width without accounting for any component subsampling.

Methods

Name Description
ToString()

Returns a String object representing Tiler's informations

getCompData(DataBlk, int)

Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. The data is returned, as a copy of the internal data, therefore the returned data can be modified "in place".

       <p>The rectangular area to return is specified by the 'ulx', 'uly', 'w'
       and 'h' members of the 'blk' argument, relative to the current
       tile. These members are not modified by this method. The 'offset' of
       the returned data is 0, and the 'scanw' is the same as the block's
       width. See the 'DataBlk' class.</p><p>This method, in general, is less efficient than the
       'getInternCompData()' method since, in general, it copies the
       data. However if the array of returned data is to be modified by the
       caller then this method is preferable.</p><p>If the data array in 'blk' is 'null', then a new one is created. If
       the data array is not 'null' then it is reused, and it must be large
       enough to contain the block's data. Otherwise an 'ArrayStoreException'
       or an 'IndexOutOfBoundsException' is thrown by the Java system.</p><p>The returned data may have its 'progressive' attribute set. In this
       case the returned data is only an approximation of the "final"
       data.</p>
getCompULX(int)

Returns the horizontal coordinate of the upper-left corner of the specified component in the current tile.

getCompULY(int)

Returns the vertical coordinate of the upper-left corner of the specified component in the current tile.

getFixedPoint(int)

Returns the position of the fixed point in the specified component. This is the position of the least significant integral (i.e. non-fractional) bit, which is equivalent to the number of fractional bits. For instance, for fixed-point values with 2 fractional bits, 2 is returned. For floating-point data this value does not apply and 0 should be returned. Position 0 is the position of the least significant bit in the data.

getInternCompData(DataBlk, int)

Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. The data is returned, as a reference to the internal data, if any, instead of as a copy, therefore the returned data should not be modified.

       <p>The rectangular area to return is specified by the 'ulx', 'uly', 'w'
       and 'h' members of the 'blk' argument, relative to the current
       tile. These members are not modified by this method. The 'offset' and
       'scanw' of the returned data can be arbitrary. See the 'DataBlk'
       class.</p><p>This method, in general, is more efficient than the 'getCompData()'
       method since it may not copy the data. However if the array of returned
       data is to be modified by the caller then the other method is probably
       preferable.</p><p>If the data array in <tt>blk</tt> is <tt>null</tt>, then a new one
       is created if necessary. The implementation of this interface may
       choose to return the same array or a new one, depending on what is more
       efficient. Therefore, the data array in <tt>blk</tt> prior to the
       method call should not be considered to contain the returned data, a
       new array may have been created. Instead, get the array from
       <tt>blk</tt> after the method has returned.</p><p>The returned data may have its 'progressive' attribute set. In this
       case the returned data is only an approximation of the "final"
       data.</p>
getNumTiles()

Returns the total number of tiles in the image.

getNumTiles(Coord)

Returns the number of tiles in the horizontal and vertical directions.

getTile(Coord)

Returns the horizontal and vertical indexes of the current tile.

getTileCompHeight(int, int)

Returns the height in pixels of the specified tile-component.

getTileCompWidth(int, int)

Returns the width in pixels of the specified tile-component.

getTilingOrigin(Coord)

Returns the tiling origin, referred to as '(xt0siz,yt0siz)' in the codestream header (SIZ marker segment).

nextTile()

Advances to the next tile, in standard scan-line order (by rows then columns). An NoNextElementException is thrown if the current tile is the last one (i.e. there is no next tile).

setTile(int, int)

Changes the current tile, given the new tile indexes. An IllegalArgumentException is thrown if the coordinates do not correspond to a valid tile.

See Also