@Override public void setColor(float[] color, int x, int y) { final int numBands = input.getNumBands(); for( int i = 0; i < numBands; i++ ) { color[i] = input.getBand(i).unsafe_get(x,y); } }
/** * 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); }
/** * Returns the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @return Pixel intensity value. */ public long get(int x, int y) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); return unsafe_get(x,y); }
@Override public void setColor(float[] color, int x, int y) { final int numBands = input.getNumBands(); for( int i = 0; i < numBands; i++ ) { color[i] = input.getBand(i).unsafe_get(x,y); } }
@Override public void initialize(int imageWidth, int imageHeight, int sensorOrientation) { grayF = new GrayF32(imageWidth,imageHeight); transform = new InterleavedF32(imageWidth,imageHeight,2); }
/** * Returns the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @return Pixel intensity value. */ public float get(int x, int y) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: ( " + x + " , " + y + " )"); return unsafe_get(x,y); }
/** * Sets the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param value The pixel's new value. */ public void set(int x, int y, float value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y); unsafe_set(x,y,value); }
/** * Returns the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @return an intensity value. */ public int get(int x, int y) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y); return unsafe_get(x,y); }
public static <I extends ImageGray<I>> ImageType<Planar<I>> pl(int numBands , Class<I> imageType ) { return new ImageType<>(Family.PLANAR, ImageDataType.classToType(imageType), numBands); }
@Override public void setBand(int x, int y, int band, int value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds."); if (band < 0 || band >= numBands) throw new ImageAccessException("Invalid band requested."); data[getIndex(x, y, band)] = (short)value; }
/** * Returns the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @return Pixel intensity value. */ public double get(int x, int y) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: ( " + x + " , " + y + " )"); return unsafe_get(x,y); }
/** * Sets the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param value The pixel's new value. */ public void set(int x, int y, double value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y); unsafe_set(x,y,value); }
/** * Sets the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param value The pixel's new value. */ @Override public void set(int x, int y, int value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds: "+x+" "+y); data[getIndex(x, y)] = (byte) value; }
/** * Sets the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param value The pixel's new value. */ @Override public void set(int x, int y, int value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); data[getIndex(x, y)] = (short) value; }
/** * 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, long... value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); unsafe_set(x,y,value); }
/** * Sets the value of the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param value The pixel's new value. */ public void set(int x, int y, long value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); unsafe_set(x, y, value); }
@Override public void setBand(int x, int y, int band, int value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds."); if (band < 0 || band >= numBands) throw new ImageAccessException("Invalid band requested."); data[getIndex(x, y, band)] = (byte)value; }
/** * 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, double... value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); unsafe_set(x,y,value); }