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;
}