public void setSubset( int dstX, int dstY, int width, int height, RasterData srcRaster, int srcX, int srcY ) {
int subWidth = clampSize( getColumns(), dstX, srcRaster.getColumns(), srcX, width );
int subHeight = clampSize( getRows(), dstY, srcRaster.getRows(), srcY, height );
if ( subHeight <= 0 || subWidth <= 0 ) {
return;
}
byte[] tmp = new byte[dataInfo.dataSize];
for ( int y = 0; y < subHeight; ++y ) {
for ( int x = 0; x < subWidth; ++x ) {
for ( int band = 0; band < this.getView().dataInfo.bands; band++ ) {
srcRaster.getSample( x + srcX, y + srcY, band, tmp );
setSample( dstX + x, dstY + y, band, tmp );
}
}
}
}