java.lang.Object
org.refcodes.graphical.RgbPixmapImpl
- All Implemented Interfaces:
HeightAccessor
,Pixmap<RgbPixel>
,RgbPixmap
,WidthAccessor
- Direct Known Subclasses:
RgbPixmapBuilderImpl
The Class RgbPixmapImpl.
- Author:
- steiner
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.graphical.HeightAccessor
HeightAccessor.HeightBuilder<B extends HeightAccessor.HeightBuilder<B>>, HeightAccessor.HeightMutator, HeightAccessor.HeightProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.Pixmap
Pixmap.PixmapBuilder<PX,
B extends Pixmap.PixmapBuilder<PX, B>>, Pixmap.PixmapMutator<PX>, Pixmap.PixmapProperty<PX> Nested classes/interfaces inherited from interface org.refcodes.graphical.RgbPixmap
RgbPixmap.RgbPixmapBuilder, RgbPixmap.RgbPixmapMutator, RgbPixmap.RgbPixmapProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.WidthAccessor
WidthAccessor.WidthBuilder<B extends WidthAccessor.WidthBuilder<B>>, WidthAccessor.WidthMutator, WidthAccessor.WidthProperty
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInstantiates a new rgb pixmap impl.RgbPixmapImpl
(int aWidth, int aHeight) Instantiates a new rgb pixmap impl.RgbPixmapImpl
(BufferedImage aImage) Constructs aRgbPixmap
from the givenBufferedImage
.RgbPixmapImpl
(BufferedImage aImage, int aWidth, int aHeight) Constructs aRgbPixmap
from the givenBufferedImage
and the given dimension for the resulting pixmap.RgbPixmapImpl
(File aImageFile) RgbPixmapImpl
(File aImageFile, int aWidth, int aHeight) RgbPixmapImpl
(InputStream aImageInputStream) Constructs aRgbPixmap
from the given imageInputStream
.RgbPixmapImpl
(InputStream aImageInputStream, int aWidth, int aHeight) Constructs aRgbPixmap
from the given imageInputStream
and the given dimension for the resulting pixmap.RgbPixmapImpl
(URL aImageUrl) RgbPixmapImpl
(URL aImageUrl, int aWidth, int aHeight) RgbPixmapImpl
(RgbPixel[][] aPixels) Instantiates a new rgb pixmap impl. -
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the height of thePixmap
.getPixelAt
(int aPosX, int aPosY) Retrieves a pixel at a given position.RgbPixel[][]
Returns the two dimensional pixels array representing the pixmap.int
getWidth()
Retrieves the width of thePixmap
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.graphical.Pixmap
hasPixelAt
Methods inherited from interface org.refcodes.graphical.RgbPixmap
getColorAt, getRgbAt
-
Field Details
-
_pixels
-
-
Constructor Details
-
RgbPixmapImpl
public RgbPixmapImpl()Instantiates a new rgb pixmap impl. -
RgbPixmapImpl
Instantiates a new rgb pixmap impl.- Parameters:
aPixels
- the pixels
-
RgbPixmapImpl
public RgbPixmapImpl(int aWidth, int aHeight) Instantiates a new rgb pixmap impl.- Parameters:
aWidth
- the widthaHeight
- the height
-
RgbPixmapImpl
Constructs aRgbPixmap
from the givenBufferedImage
.- Parameters:
aImage
- the image from which to get the pixmap.
-
RgbPixmapImpl
- Parameters:
aImageUrl
- the image URL from which to get the pixmap.- Throws:
IOException
- thrown in case reading the image encountered problems.
-
RgbPixmapImpl
- Parameters:
aImageFile
- the imageFile
from which to get the pixmap.- Throws:
IOException
- thrown in case reading the image encountered problems.
-
RgbPixmapImpl
Constructs aRgbPixmap
from the given imageInputStream
.- Parameters:
aImageInputStream
- the imageInputStream
from which to get the pixmap.- Throws:
IOException
- thrown in case reading the image encountered problems.
-
RgbPixmapImpl
- Parameters:
aImageUrl
- the image URL from which to get the pixmap.aWidth
- The width to for the resulting pixmap, -1 if the image's width is to be used.aHeight
- the height for the resulting pixmap, -1 if the image's height is to be used.- Throws:
IOException
- thrown in case reading the image encountered problems.
-
RgbPixmapImpl
- Parameters:
aImageFile
- the imageFile
from which to get the pixmap.aWidth
- The width to for the resulting pixmap, -1 if the image's width is to be used.aHeight
- the height for the resulting pixmap, -1 if the image's height is to be used.- Throws:
IOException
- thrown in case reading the image encountered problems.
-
RgbPixmapImpl
Constructs aRgbPixmap
from the given imageInputStream
and the given dimension for the resulting pixmap.- Parameters:
aImageInputStream
- the imageInputStream
from which to get the pixmap.aWidth
- The width to for the resulting pixmap, -1 if the image's width is to be used.aHeight
- the height for the resulting pixmap, -1 if the image's height is to be used.- Throws:
IOException
- thrown in case reading the image encountered problems.
-
RgbPixmapImpl
Constructs aRgbPixmap
from the givenBufferedImage
and the given dimension for the resulting pixmap.- Parameters:
aImage
- the image from which to get the pixmap.aWidth
- The width to for the resulting pixmap, -1 if the image's width is to be used.aHeight
- the height for the resulting pixmap, -1 if the image's height is to be used.
-
-
Method Details
-
getPixels
Returns the two dimensional pixels array representing the pixmap. -
getWidth
public int getWidth()Retrieves the width of thePixmap
. -
getHeight
public int getHeight()Retrieves the height of thePixmap
. -
getPixelAt
Retrieves a pixel at a given position.- Specified by:
getPixelAt
in interfacePixmap<RgbPixel>
- Parameters:
aPosX
- The x position for the pixel to be retrieved.aPosY
- The y position for the pixel to be retrieved.- Returns:
- The according pixel
- Throws:
IndexOutOfBoundsException
- in case the index is out of bounds.
-