Type Parameters:
PX - The type of the pixel being managed by the Pixmap .
All Superinterfaces:
HeightAccessor , WidthAccessor
All Known Subinterfaces:
Pixmap.PixmapBuilder <PX,B>, Pixmap.PixmapProperty <PX>, RgbPixmap , RgbPixmap.RgbPixmapBuilder , RgbPixmap.RgbPixmapProperty
All Known Implementing Classes:
RgbPixmapBuilderImpl , RgbPixmapImpl
public interface Pixmap<PX>
extends WidthAccessor , HeightAccessor
A pixmap represents the data of a two dimensional image. The pixels may be
accessed by providing an x and a y position and, depending on the sub-types,
a pixel my be represented by an
RgbPixel (as of the
Pixmap
type).
Method Summary
All Methods Instance Methods Abstract Methods Default Methods
Modifier and Type
Method
Description
int
getHeight ()
Retrieves the height of the
Pixmap.
PX
getPixelAt (int aPosX,
int aPosY)
Retrieves a pixel at a given position.
PX [][]
getPixels ()
Returns the two dimensional pixels array representing the pixmap.
int
getWidth ()
Retrieves the width of the
Pixmap.
default boolean
hasPixelAt (int aPosX,
int aPosY)
Tests whether there is a pixel at a given position.
Method Details
getPixels
Returns the two dimensional pixels array representing the pixmap.
Returns:
The pixmap array.
getPixelAt
Retrieves a pixel at a given position.
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.
hasPixelAt
Tests whether there is a pixel at a given position.
Parameters:
aPosX - The x position for the pixel to be tested.
aPosY - The y position for the pixel to be tested.
Returns:
True if we have a pixel at this position.
Throws:
IndexOutOfBoundsException - in case the index is out of bounds.