/** * Constructs a <code>DisplayJAI</code>, sets its layout to * <code>null</code>, and sets its displayed image. * * <p> * The preferred size is set such that its width is the image width plus the * left and right insets and its height is the image height plus the top and * bottom insets. * </p> * * @param image * The image to display. * @throws IllegalArgumentException * if <code>image</code> is <code>null</code>. */ public ZoomableImageDisplay(RenderedImage image) { this(); setImage(image); }
/** * Constructs a <code>DisplayJAI</code>, sets its layout to * <code>null</code>, and sets its displayed image. * * <p> * The preferred size is set such that its width is the image width plus the * left and right insets and its height is the image height plus the top and * bottom insets. * </p> * * @param image * The image to display. * @throws IllegalArgumentException * if <code>image</code> is <code>null</code>. */ public ZoomableImageDisplay(RenderedImage image) { this(); setImage(image); }
public void setImage(RenderedImage image) { this.image = image; if(image == null) { display.setVisible(false); pixelIter = null; } else { display.setImage(image); display.setVisible(true); pixelIter = RandomIterFactory.create(image, null); ipixel = new int[image.getSampleModel().getNumBands()]; dpixel = new double[image.getSampleModel().getNumBands()]; } }
public void setImage(RenderedImage image) { this.image = image; if(image == null) { display.setVisible(false); pixelIter = null; } else { display.setImage(image); display.setVisible(true); pixelIter = RandomIterFactory.create(image, null); ipixel = new int[image.getSampleModel().getNumBands()]; dpixel = new double[image.getSampleModel().getNumBands()]; } }