CSJ2K.j2k.codestream.reader.BitstreamReaderAgent.getTileCompWidth C# (CSharp) Method

getTileCompWidth() public method

Returns the width in pixels of the specified tile-component for the given (tile-component) resolution level.
public getTileCompWidth ( int t, int c, int rl ) : int
t int The tile index /// ///
c int The index of the component, from 0 to N-1. /// ///
rl int The resolution level, from 0 to L. /// ///
return int
        public int getTileCompWidth(int t, int c, int rl)
        {
            int tIdx = TileIdx;
            if (t != tIdx)
            {
                throw new System.InvalidOperationException("Asking the tile-component width of a tile " + "different  from the current one.");
            }
            int ntulx;
            int dl = mdl[c] - rl;
            // Calculate starting X of next tile X-wise at reference grid hi-res
            ntulx = (ctX < ntX - 1)?px + (ctX + 1) * ntW:ax + imgW;
            // Convert reference grid hi-res to component grid hi-res
            ntulx = (ntulx + hd.getCompSubsX(c) - 1) / hd.getCompSubsX(c);
            // Starting X of current tile at component grid hi-res is culx[c]
            // The difference at the rl level is the width
            return (ntulx + (1 << dl) - 1) / (1 << dl) - (culx[c] + (1 << dl) - 1) / (1 << dl);
        }