@Test public void testBuildColorList() { final List<Color> colorList = LabelImageProcessorCache.buildColorList(); final int maxLabels = 20000; final Map<Short, Color> shortToColorMap = new HashMap<>(maxLabels * 2); Color c; short s; for (int tileIndex = 0; tileIndex < maxLabels; tileIndex++) { c = colorList.get(tileIndex); s = (short) c.getRGB(); if (shortToColorMap.containsKey(s)) { Assert.fail(s + " maps to " + shortToColorMap.get(s) + " and " + c); } else { shortToColorMap.put(s, c); } } }
public static List<Color> buildColorList() { final int maxComponentCount = 256 - 2; final List<Color> colorList = new ArrayList<>(maxComponentCount * maxComponentCount); for (int green = 1; green < maxComponentCount; green++) { for (int blue = 1; blue < maxComponentCount; blue++) { colorList.add(new Color(0, green, blue)); } } final Random consistentShuffler = new Random(99); Collections.shuffle(colorList, consistentShuffler); return colorList; }
LabelImageProcessorCache extends ImageProcessorCache { public static List<Color> buildColorList() { final int maxComponentCount = 256 - 2; final List<Color> colorList = new ArrayList<>(maxComponentCount * maxComponentCount); for (int green = 1; green < maxComponentCount; green++) { for (int blue = 1; blue < maxComponentCount; blue++) { colorList.add(new Color(0, green, blue)); } } final Random consistentShuffler = new Random(99); Collections.shuffle(colorList, consistentShuffler); return colorList; } }
LabelImageProcessorCache extends ImageProcessorCache { public static List<Color> buildColorList() { final int maxComponentCount = 256 - 2; final List<Color> colorList = new ArrayList<>(maxComponentCount * maxComponentCount); for (int green = 1; green < maxComponentCount; green++) { for (int blue = 1; blue < maxComponentCount; blue++) { colorList.add(new Color(0, green, blue)); } } final Random consistentShuffler = new Random(99); Collections.shuffle(colorList, consistentShuffler); return colorList; } LabelImageProcessorCache(final long maximumNumberOfCachedPixels,
                                    final boolean recordStats,
                                    final boolean cacheOriginalsForDownSampledImages,
                                    final Collection<TileSpec> tileSpecs); }
LabelImageProcessorCache extends ImageProcessorCache { public static List<Color> buildColorList() { final int maxComponentCount = 256 - 2; final List<Color> colorList = new ArrayList<>(maxComponentCount * maxComponentCount); for (int green = 1; green < maxComponentCount; green++) { for (int blue = 1; blue < maxComponentCount; blue++) { colorList.add(new Color(0, green, blue)); } } final Random consistentShuffler = new Random(99); Collections.shuffle(colorList, consistentShuffler); return colorList; } LabelImageProcessorCache(final long maximumNumberOfCachedPixels,
                                    final boolean recordStats,
                                    final boolean cacheOriginalsForDownSampledImages,
                                    final Collection<TileSpec> tileSpecs); static List<Color> buildColorList(); static BufferedImage createEmptyImage(final int width,
                                                 final int height); }
LabelImageProcessorCache extends ImageProcessorCache { public static List<Color> buildColorList() { final int maxComponentCount = 256 - 2; final List<Color> colorList = new ArrayList<>(maxComponentCount * maxComponentCount); for (int green = 1; green < maxComponentCount; green++) { for (int blue = 1; blue < maxComponentCount; blue++) { colorList.add(new Color(0, green, blue)); } } final Random consistentShuffler = new Random(99); Collections.shuffle(colorList, consistentShuffler); return colorList; } LabelImageProcessorCache(final long maximumNumberOfCachedPixels,
                                    final boolean recordStats,
                                    final boolean cacheOriginalsForDownSampledImages,
                                    final Collection<TileSpec> tileSpecs); static List<Color> buildColorList(); static BufferedImage createEmptyImage(final int width,
                                                 final int height); static final int MAX_LABEL_INTENSITY; }