CSJ2K.j2k.entropy.PrecinctSizeSpec.getPPY C# (CSharp) Method

getPPY() public method

Returns the precinct partition height in component 'n' and tile 't' at resolution level 'rl'. If the tile index is equal to -1 or if the component index is equal to -1 it means that those should not be taken into account.
public getPPY ( int t, int c, int rl ) : int
t int The tile index, in raster scan order. Specify -1 if it is not /// a specific tile. /// ///
c int The component index. Specify -1 if it is not a specific /// component. /// ///
rl int The resolution level. /// ///
return int
        public virtual int getPPY(int t, int c, int rl)
        {
            int mrl, idx;
            System.Collections.Generic.List<System.Int32>[] v = null;
            bool tileSpecified = (t != - 1?true:false);
            bool compSpecified = (c != - 1?true:false);

            // Get the maximum number of decomposition levels and the object
            // (Vector array) containing the precinct dimensions (width and
            // height) for the specified (or not) tile/component
            if (tileSpecified && compSpecified)
            {
                mrl = ((System.Int32) dls.getTileCompVal(t, c));
                v = (System.Collections.Generic.List<System.Int32>[]) getTileCompVal(t, c);
            }
            else if (tileSpecified && !compSpecified)
            {
                mrl = ((System.Int32) dls.getTileDef(t));
                v = (System.Collections.Generic.List<System.Int32>[]) getTileDef(t);
            }
            else if (!tileSpecified && compSpecified)
            {
                mrl = ((System.Int32) dls.getCompDef(c));
                v = (System.Collections.Generic.List<System.Int32>[]) getCompDef(c);
            }
            else
            {
                mrl = ((System.Int32) dls.getDefault());
                v = (System.Collections.Generic.List<System.Int32>[]) getDefault();
            }
            idx = mrl - rl;
            if (v[1].Count > idx)
            {
                return ((System.Int32) v[1][idx]);
            }
            else
            {
                return ((System.Int32) v[1][v[1].Count - 1]);
            }
        }