Package ch.epfl.cs107.play.window.swing
Class SwingImage
java.lang.Object
ch.epfl.cs107.play.window.swing.SwingImage
- All Implemented Interfaces:
Image
Swing implementation of an image.
-
Constructor Summary
ConstructorsConstructorDescriptionSwingImage(Image image, RegionOfInterest roi, boolean removeBackground) Creates an image from specified image.SwingImage(InputStream stream, RegionOfInterest roi, boolean removeBackground) Creates an image from specified image input stream. -
Method Summary
-
Constructor Details
-
SwingImage
Creates an image from specified image.- Parameters:
image- (java.awt.Image): valid image to be copied, not nullroi- (RegionOfInterest): rectangle of interest in the image, may be nullremoveBackground- (boolean): which indicate if need to remove an uniform background
-
SwingImage
public SwingImage(InputStream stream, RegionOfInterest roi, boolean removeBackground) throws IOException Creates an image from specified image input stream.- Parameters:
stream- (InputStream): valid image input stream, not nullroi- (RegionOfInterest): rectangle of interest in the image, may be nullremoveBackground- (boolean): which indicate if need to remove an uniform background- Throws:
IOException- if an error occurs during reading
-
-
Method Details
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getRGB
public int getRGB(int r, int c) Description copied from interface:ImageColor getter of the pixel at the given row and column
-