CSJ2K.j2k.image.invcomptransf.InvCompTransf.setTile C# (CSharp) Method

setTile() public method

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

This default implementation changes the tile in the source and re-initializes properly component transformation variables..

public setTile ( int x, int y ) : void
x int The horizontal index of the tile. /// ///
y int The vertical index of the new tile. /// /// ///
return void
        public override void setTile(int x, int y)
        {
            src.setTile(x, y);
            tIdx = TileIdx; // index of the current tile

            // initializations
            if (((System.Int32)cts.getTileDef(tIdx)) == NONE) transfType = NONE;
            else
            {
                int nc = src.NumComps > 3 ? 3 : src.NumComps;
                int rev = 0;
                for (int c = 0; c < nc; c++)
                {
                    rev += (wfs.isReversible(tIdx, c) ? 1 : 0);
                }
                if (rev == 3)
                {
                    // All WT are reversible
                    transfType = INV_RCT;
                }
                else if (rev == 0)
                {
                    // All WT irreversible
                    transfType = INV_ICT;
                }
                else
                {
                    // Error
                    throw new System.ArgumentException(
                        "Wavelet transformation and " + "component transformation" + " not coherent in tile" + tIdx);
                }
            }
        }