Interface Image
-
public interface ImageRepresents an image based on raster graphics. Images be loaded from PNG or JPEG files using aMediaLoader.Instances of an
Imagemay represent either the entire underlying image, or a rectangular region within the source image. That is, instances do not always map directly to an image file. This aligns with the common practice of including multiple images within a larger image, either as a sprite sheet (for 2D graphics) or a texture (for 3D graphics).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ImageextractRegion(Rect region)Returns a newImageinstance that is based on the same source image, but only contains the specified rectangular region within the source image.intgetAlpha(int x, int y)Returns the alpha of a pixel within the image.ColorRGBgetColor(int x, int y)Returns the RGB color value of a pixel within the image.default intgetHeight()RectgetRegion()default intgetWidth()
-
-
-
Method Detail
-
getRegion
Rect getRegion()
-
getWidth
default int getWidth()
-
getHeight
default int getHeight()
-
extractRegion
Image extractRegion(Rect region)
Returns a newImageinstance that is based on the same source image, but only contains the specified rectangular region within the source image.
-
getColor
ColorRGB getColor(int x, int y)
Returns the RGB color value of a pixel within the image. This does not include the pixel's alpha value even if the image does support transparency. The alpha value can be retrieved separately usinggetAlpha(int, int).
-
getAlpha
int getAlpha(int x, int y)Returns the alpha of a pixel within the image. The returned value is between 0 (fully transparent) and 100 (fully opaque).
-
-