FuOp extends PixelOperator { static ImageInfo createImageInfo(IndexCoding indexCoding) { ColorPaletteDef.Point[] points = new ColorPaletteDef.Point[FuAlgo.MAX_FU_VALUE + 1]; for (int i = 0; i < points.length; i++) { String name = i != 0 ? String.format("FU_%2d", i) : "undefined"; indexCoding.addIndex(name, i, ""); points[i] = new ColorPaletteDef.Point(i, FU_COLORS[i], name); } return new ImageInfo(new ColorPaletteDef(points, points.length)); }    }
@Test public void testImageInfoColorPalette() throws Exception { ImageInfo indexInfo = FuOp.createImageInfo(new IndexCoding("Forel-Ule Scale")); ColorPaletteDef.Point[] points = indexInfo.getColorPaletteDef().getPoints(); assertEquals(22, points.length); for (int i = 0; i < points.length; i++) { assertFUColor(i, points[i].getColor()); } }