@Override public void unsafe_get(int x, int y, int[] storage) { int index = getIndex(x, y, 0); for (int i = 0; i < numBands; i++, index++) { storage[i] = data[index] & 0xFF; } }
@Override public Number get(int x, int y, int band) { return image.data[image.getIndex(x,y,band)]&0xFF; }
@Override public void set(int x, int y, float[] value) { setF(image.getIndex(x,y),value); }
@Override public void get(int x, int y, float[] value) { getF(image.getIndex(x,y), value); }
int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); System.arraycopy(from.data,indexFrom,to.data,indexTo,from.width); int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); int indexEndTo = indexTo + from.width; int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); int indexEndTo = indexTo + from.width; int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y);
/** * 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)] & 0xFF; }
public static void convert( InterleavedU8 from, InterleavedI8 to ) { if (from.isSubimage() || to.isSubimage()) { final int N = from.width * from.getNumBands(); for (int y = 0; y < from.height; y++) { int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); for (int x = 0; x < N; x++) { to.data[indexTo++] = ( byte )( from.data[indexFrom++] & 0xFF); } } } else { final int N = from.width * from.height * from.getNumBands(); System.arraycopy(from.data, 0, to.data, 0, N); } }
public static void convert( InterleavedU8 from, InterleavedF64 to ) { if (from.isSubimage() || to.isSubimage()) { final int N = from.width * from.getNumBands(); for (int y = 0; y < from.height; y++) { int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); for (int x = 0; x < N; x++) { to.data[indexTo++] = ( double )( from.data[indexFrom++] & 0xFF); } } } else { final int N = from.width * from.height * from.getNumBands(); for (int i = 0; i < N; i++) { to.data[i] = ( double )( from.data[i] & 0xFF); } } }
int x = (int)sampleLocation.x, y =(int)sampleLocation.y; if( input.isInBounds(x,y)) { int index = input.getIndex(x,y,1); valueU = input.data[index]&0xFF; valueV = input.data[index+1]&0xFF;
public static void convert( InterleavedU8 from, InterleavedS64 to ) { if (from.isSubimage() || to.isSubimage()) { final int N = from.width * from.getNumBands(); for (int y = 0; y < from.height; y++) { int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); for (int x = 0; x < N; x++) { to.data[indexTo++] = ( from.data[indexFrom++] & 0xFF); } } } else { final int N = from.width * from.height * from.getNumBands(); for (int i = 0; i < N; i++) { to.data[i] = ( from.data[i] & 0xFF); } } }
public static void convert( InterleavedU8 from, InterleavedF32 to ) { if (from.isSubimage() || to.isSubimage()) { final int N = from.width * from.getNumBands(); for (int y = 0; y < from.height; y++) { int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); for (int x = 0; x < N; x++) { to.data[indexTo++] = ( float )( from.data[indexFrom++] & 0xFF); } } } else { final int N = from.width * from.height * from.getNumBands(); for (int i = 0; i < N; i++) { to.data[i] = ( float )( from.data[i] & 0xFF); } } }
public static void convert( InterleavedU8 from, InterleavedI16 to ) { if (from.isSubimage() || to.isSubimage()) { final int N = from.width * from.getNumBands(); for (int y = 0; y < from.height; y++) { int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); for (int x = 0; x < N; x++) { to.data[indexTo++] = ( short )( from.data[indexFrom++] & 0xFF); } } } else { final int N = from.width * from.height * from.getNumBands(); for (int i = 0; i < N; i++) { to.data[i] = ( short )( from.data[i] & 0xFF); } } }
public static void convert( InterleavedU8 from, InterleavedS32 to ) { if (from.isSubimage() || to.isSubimage()) { final int N = from.width * from.getNumBands(); for (int y = 0; y < from.height; y++) { int indexFrom = from.getIndex(0, y); int indexTo = to.getIndex(0, y); for (int x = 0; x < N; x++) { to.data[indexTo++] = ( from.data[indexFrom++] & 0xFF); } } } else { final int N = from.width * from.height * from.getNumBands(); for (int i = 0; i < N; i++) { to.data[i] = ( from.data[i] & 0xFF); } } }