public static void print(InterleavedF32 a) { for (int y = 0; y < a.height; y++) { for (int x = 0; x < a.width; x++) { System.out.print("|"); for( int band = 0; band < a.numBands; band++ ) { System.out.printf(" %6.2f", a.getBand(x, y,band)); } System.out.print(" |"); } System.out.println(); } System.out.println(); }
public static double get(ImageInterleaved img, int x, int y , int band ) { if (img instanceof InterleavedU8) { return ((InterleavedU8) img).getBand(x, y, band); } else if (img instanceof InterleavedS8) { return ((InterleavedS8) img).getBand(x, y, band); } else if (img instanceof InterleavedS16) { return ((InterleavedS16) img).getBand(x, y, band); } else if (img instanceof InterleavedU16) { return ((InterleavedU16) img).getBand(x, y, band); } else if (img instanceof InterleavedS32) { return ((InterleavedS32) img).getBand(x, y, band); } else if (img instanceof InterleavedS64) { return ((InterleavedS64) img).getBand(x, y, band); } else if (img instanceof InterleavedF32) { return ((InterleavedF32) img).getBand(x, y, band); } else if (img instanceof InterleavedF64) { return ((InterleavedF64) img).getBand(x, y, band); } else { throw new IllegalArgumentException("Unknown or incompatible image type: " + img.getClass().getSimpleName()); } }
float ra = transform.getBand(x,y,0); float ia = transform.getBand(x,y,1); float rb = transform.getBand(x+hw,y+hh,0); float ib = transform.getBand(x+hw,y+hh,1); transform.setBand(x+hw,y+hh,1,ia); ra = transform.getBand(x+hw,y,0); ia = transform.getBand(x+hw,y,1); rb = transform.getBand(x,y+hh,0); ib = transform.getBand(x,y+hh,1);