CSJ2K.j2k.wavelet.synthesis.InvWTFull.getInternCompData C# (CSharp) Метод

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

Returns a block of image data containing the specifed rectangular area, in the specified component, as a reference to the internal buffer (see below). The rectangular area is specified by the coordinates and dimensions of the 'blk' object.

The area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument. These members are not modified by this method.

The data returned by this method can be the data in the internal buffer of this object, if any, and thus can not be modified by the caller. The 'offset' and 'scanw' of the returned data can be arbitrary. See the 'DataBlk' class.

The returned data has its 'progressive' attribute unset (i.e. false).

public getInternCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk Its coordinates and dimensions specify the area to return. /// ///
c int The index of the component from which to get the data. /// ///
Результат CSJ2K.j2k.image.DataBlk
        public override DataBlk getInternCompData(DataBlk blk, int c)
        {
            int tIdx = TileIdx;
            if (src.getSynSubbandTree(tIdx, c).HorWFilter == null)
            {
                dtype = DataBlk.TYPE_INT;
            }
            else
            {
                dtype = src.getSynSubbandTree(tIdx, c).HorWFilter.DataType;
            }

            //If the source image has not been decomposed
            if (reconstructedComps[c] == null)
            {
                //Allocate component data buffer
                switch (dtype)
                {

                    case DataBlk.TYPE_FLOAT:
                        reconstructedComps[c] = new DataBlkFloat(0, 0, getTileCompWidth(tIdx, c), getTileCompHeight(tIdx, c));
                        break;

                    case DataBlk.TYPE_INT:
                        reconstructedComps[c] = new DataBlkInt(0, 0, getTileCompWidth(tIdx, c), getTileCompHeight(tIdx, c));
                        break;
                    }
                //Reconstruct source image
                waveletTreeReconstruction(reconstructedComps[c], src.getSynSubbandTree(tIdx, c), c);
            }

            if (blk.DataType != dtype)
            {
                if (dtype == DataBlk.TYPE_INT)
                {
                    blk = new DataBlkInt(blk.ulx, blk.uly, blk.w, blk.h);
                }
                else
                {
                    blk = new DataBlkFloat(blk.ulx, blk.uly, blk.w, blk.h);
                }
            }
            // Set the reference to the internal buffer
            blk.Data = reconstructedComps[c].Data;
            blk.offset = reconstructedComps[c].w * blk.uly + blk.ulx;
            blk.scanw = reconstructedComps[c].w;
            blk.progressive = false;
            return blk;
        }