@Test public void testGetImage() { DrawableBitSet bitset = new DrawableBitSet(WIDTH, HEIGHT); Shape rectangle = new Rectangle(MIN, MIN, SIZE, SIZE); bitset.set(rectangle); BufferedImage image = bitset.getImage(); assertNotNull(image); Raster raster = image.getData(); assertNotNull(raster); int sample; int setPixel = 0; for (int i = 0; i < WIDTH; i++) { for (int j = 0; j < HEIGHT; j++) { sample = raster.getSample(i, j, 0); if ((i >= MIN && j >= MIN && i <= MAX && j <= MAX)) { assertEquals(1, sample); setPixel++; } else { assertEquals(0, sample); } } } assertEquals(SET_PIXELS, setPixel); }
public BufferedImage getImage() { return image; }
DrawableBitSet { public BufferedImage getImage() { return image; } }
DrawableBitSet { public BufferedImage getImage() { return image; } DrawableBitSet(int width, int height); }
DrawableBitSet { public BufferedImage getImage() { return image; } DrawableBitSet(int width, int height); boolean get(int x, int y); void set(int x, int y); void set(Geometry geom); void set(Shape shape); BufferedImage getImage(); }
DrawableBitSet { public BufferedImage getImage() { return image; } DrawableBitSet(int width, int height); boolean get(int x, int y); void set(int x, int y); void set(Geometry geom); void set(Shape shape); BufferedImage getImage();  }