@Override public void setPixel( int x, int y, byte[] result ) { if ( getView().dataInfo.bands != dataInfo.bands ) { // Is this a view on less bands? super.setPixel( x, y, result ); return; } ByteBuffer data = getByteBuffer(); data.position( calculatePos( x, y ) ); data.put( result, 0, dataInfo.noDataPixel.length ); }
@Override public byte[] getPixel( int x, int y, byte[] result ) { if ( getView().dataInfo.bands != dataInfo.bands ) { return super.getPixel( x, y, result ); } if ( result == null ) { result = new byte[dataInfo.noDataPixel.length]; } int pos = calculatePos( x, y ); if ( pos == -1 ) { System.arraycopy( dataInfo.noDataPixel, 0, result, 0, result.length ); } else { ByteBuffer data = getByteBuffer().asReadOnlyBuffer(); data.position( pos ); data.get( result, 0, dataInfo.noDataPixel.length ); } return result; }
ByteBuffer data = getByteBuffer(); for ( int i = 0; i < subHeight; i++ ) { int pos = raster.calculatePos( srcRasterPosx, i + srcRasterPosy ); pos = calculatePos( dstX, dstY + i ); data.position( pos ); data.put( srcData.slice() );