/** * Sets the pixel's value for all the bands using an array. * * @param x pixel coordinate. * @param y pixel coordinate. * @param value The pixel's new value for each band. */ public void set(int x, int y, int... value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); unsafe_set(x,y,value); }
public void get( int x , int y , int[] pixel ) { if( image.isInBounds(x,y) ) { image.unsafe_get(x, y, pixel); } else { getOutside(x, y, pixel); } }
@Override public void setOutside(int x, int y, int[] pixel) { image.unsafe_set(colWrap.getIndex(x), rowWrap.getIndex(y), pixel); } }
@Override public void getOutside(int x, int y, int pixel[] ) { image.unsafe_get(colWrap.getIndex(x), rowWrap.getIndex(y), pixel); }
public void set( int x , int y , int[] pixel ) { if (image.isInBounds(x, y)) { image.unsafe_set(x, y, pixel); } else { setOutside(x, y, pixel); } }
/** * Returns the pixel's value for all the bands as an array. * * @param x pixel coordinate. * @param y pixel coordinate. * @param storage If not null then the pixel's value is written here. If null a new array is created. * @return The pixel's value. */ public int[] get(int x, int y, int[] storage) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); if (storage == null) { storage = new int[numBands]; } unsafe_get(x,y,storage); return storage; }