CSJ2K.j2k.image.Tiler.setTile C# (CSharp) Метод

setTile() публичный Метод

Changes the current tile, given the new tile indexes. An IllegalArgumentException is thrown if the coordinates do not correspond to a valid tile.
public setTile ( int x, int y ) : void
x int The horizontal index of the tile. /// ///
y int The vertical index of the new tile. /// ///
Результат void
        public override void setTile(int x, int y)
        {
            // Check tile indexes
            if (x < 0 || y < 0 || x >= ntX || y >= ntY)
            {
                throw new System.ArgumentException("Tile's indexes out of bounds");
            }

            // Set new current tile
            tx = x;
            ty = y;
            // Calculate tile origins
            int tx0 = (x != 0) ? xt0siz + x * xtsiz : x0siz;
            int ty0 = (y != 0) ? yt0siz + y * ytsiz : y0siz;
            int tx1 = (x != ntX - 1) ? (xt0siz + (x + 1) * xtsiz) : (x0siz + src.ImgWidth);
            int ty1 = (y != ntY - 1) ? (yt0siz + (y + 1) * ytsiz) : (y0siz + src.ImgHeight);
            // Set general variables
            tileW = tx1 - tx0;
            tileH = ty1 - ty0;
            // Set component specific variables
            int nc = src.NumComps;
            if (compW == null) compW = new int[nc];
            if (compH == null) compH = new int[nc];
            if (tcx0 == null) tcx0 = new int[nc];
            if (tcy0 == null) tcy0 = new int[nc];
            for (int i = 0; i < nc; i++)
            {
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                tcx0[i] = (int)System.Math.Ceiling(tx0 / (double)src.getCompSubsX(i));
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                tcy0[i] = (int)System.Math.Ceiling(ty0 / (double)src.getCompSubsY(i));
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                compW[i] = (int)System.Math.Ceiling(tx1 / (double)src.getCompSubsX(i)) - tcx0[i];
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                compH[i] = (int)System.Math.Ceiling(ty1 / (double)src.getCompSubsY(i)) - tcy0[i];
            }
        }