@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; }
@Override protected ByteBufferRasterData createCompatibleEmptyRasterData() { return new PixelInterleavedRasterData( getView(), getOriginalWidth(), getOriginalHeight(), dataAccess.getReader(), this.dataInfo, false ); }
if ( srcRaster instanceof PixelInterleavedRasterData && getView().dataInfo.bands == dataInfo.bands ) { int srcRasterPosx = raster.getView().x + srcX; int srcRasterPosy = raster.getView().y + srcY; int effectiveCols = raster.getColumns(); int effectiveRows = raster.getRows(); srcRasterPosx -= raster.getView().x; srcRasterPosy -= raster.getView().y;