@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; }
@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; }
/** * Returns the value of the specified band in the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param band which color band in the pixel * @param value The new value of the element. */ public void setBand(int x, int y, int band, byte 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)] = value; }
/** * Returns the value of the specified band in the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param band which color band in the pixel * @param value The new value of the element. */ public void setBand(int x, int y, int band, long 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)] = value; }
/** * Returns the value of the specified band in the specified pixel. * * @param x pixel coordinate. * @param y pixel coordinate. * @param band which color band in the pixel * @return an intensity value. */ @Override public int getBand(int x, int y, int band) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds."); if (band < 0 || band >= numBands) throw new ImageAccessException("Invalid band requested."); return data[getIndex(x, y, band)]; }
/** * 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); }
/** * 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); }
/** * 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 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); }
/** * 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); }
/** * 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 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); }
/** * 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); }
/** * 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)] = 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, byte... value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); int index = getIndex(x, y, 0); for (int i = 0; i < numBands; i++, index++) { data[index] = value[i]; } }
/** * 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, short... value) { if (!isInBounds(x, y)) throw new ImageAccessException("Requested pixel is out of bounds"); int index = getIndex(x, y, 0); for (int i = 0; i < numBands; i++, index++) { data[index] = value[i]; } }