calculateBlocks method
Calculates the block range within the sub-file that needs to be read.
Implementation
void calculateBlocks(SubFileParameter subFileParameter) {
// calculate the blocks (tiles) in the subfile which need to be read
fromBlockX = max(fromBaseTileX - subFileParameter.boundaryTileLeft, 0);
fromBlockY = max(fromBaseTileY - subFileParameter.boundaryTileTop, 0);
toBlockX = min(toBaseTileX - subFileParameter.boundaryTileLeft, subFileParameter.blocksWidth - 1);
toBlockY = min(toBaseTileY - subFileParameter.boundaryTileTop, subFileParameter.blocksHeight - 1);
}