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

getCompImgHeight() public method

Returns the height in pixels of the specified component in the overall image, for the given (component) resolution level.

Note: Component resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of same component of each tile.

Example: For an image (2 tiles) with 1 component (tile 0 having 2 decomposition levels and tile 1 having 3 decomposition levels), the first tile(-component) has 3 resolution levels and the second one has 4 resolution levels, whereas the component has only 3 resolution levels available.

public getCompImgHeight ( int c, int rl ) : int
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 getCompImgHeight(int c, int rl)
        {
            int sy, ey;
            int dl = decSpec.dls.getMinInComp(c) - rl;
            // indexation (0 is hi-res)
            // Calculate image starting x at component hi-res grid
            sy = (ay + hd.getCompSubsY(c) - 1) / hd.getCompSubsY(c);
            // Calculate image ending (excluding) x at component hi-res grid
            ey = (ay + imgH + hd.getCompSubsY(c) - 1) / hd.getCompSubsY(c);
            // The difference at the rl level is the width
            return (ey + (1 << dl) - 1) / (1 << dl) - (sy + (1 << dl) - 1) / (1 << dl);
        }