Interface Canvas
public interface Canvas
A
CanvasElement's image data.-
Method Summary
Modifier and TypeMethodDescriptiongetColor(int x, int y) Get a pixel's color.@NotNull org.joml.Vector4fgetColorf(int x, int y) Get a pixel's color value in range [0..1]org.joml.Vector4fgetColorf(int x, int y, @NotNull org.joml.Vector4f out) Get a pixel's color value in range [0..1]@NotNull org.joml.Vector4igetColori(int x, int y) Get a pixel's color value in range [0..255]org.joml.Vector4igetColori(int x, int y, @NotNull org.joml.Vector4i out) Get a pixel's color value in range [0..255]@NotNull CanvasElementGet the element this canvas belongs to.intThe height of the canvas.intgetWidth()The width of the canvas.voidSet a pixel's color value.voidsetColorf(int x, int y, @NotNull org.joml.Vector3fc color) Set a pixel's color value in range [0..1] Color components Color Channel Vector Component RedxGreenyBluezvoidsetColorf(int x, int y, @NotNull org.joml.Vector4fc color) Set a pixel's color value in range [0..1] Color components Color Channel Vector Component RedxGreenyBluezAlphawvoidsetColori(int x, int y, @NotNull org.joml.Vector3ic color) Set a pixel's color value in range [0..255] Color components Color Channel Vector Component RedxGreenyBluezvoidsetColori(int x, int y, @NotNull org.joml.Vector4ic color) Set a pixel's color value in range [0..255] Color components Color Channel Vector Component RedxGreenyBluezAlphaw
-
Method Details
-
getWidth
int getWidth()The width of the canvas.- Returns:
- Canvas width
- See Also:
-
getHeight
int getHeight()The height of the canvas.- Returns:
- Canvas height
- See Also:
-
getElement
Get the element this canvas belongs to.- Returns:
- Canvas element
-
getColorf
org.joml.Vector4f getColorf(int x, int y, @NotNull @NotNull org.joml.Vector4f out) throws NullPointerException, IllegalArgumentException Get a pixel's color value in range [0..1]- Parameters:
x- Pixel X coordinatey- Pixel Y coordinateout- Vector to store color value in.- Returns:
- The
outargument - Throws:
IllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.NullPointerException- Ifoutisnull
-
getColori
org.joml.Vector4i getColori(int x, int y, @NotNull @NotNull org.joml.Vector4i out) Get a pixel's color value in range [0..255]- Parameters:
x- Pixel X coordinatey- Pixel Y coordinateout- Vector to store color value in.- Returns:
- The
outargument - Throws:
IllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.NullPointerException- Ifoutisnull
-
getColorf
Get a pixel's color value in range [0..1]- Parameters:
x- Pixel X coordinatey- Pixel Y coordinate- Returns:
- Color value
- Throws:
IllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
getColori
Get a pixel's color value in range [0..255]- Parameters:
x- Pixel X coordinatey- Pixel Y coordinate- Returns:
- Color value
- Throws:
IllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
getColor
Get a pixel's color.- Parameters:
x- Pixel X coordinatey- Pixel Y coordinate- Returns:
- Color value
- Throws:
IllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
setColor
Set a pixel's color value.- Parameters:
x- Pixel X coordinatey- Pixel Y coordinatecolor- Color values.- Throws:
NullPointerException- IfcolorisnullIllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
setColorf
void setColorf(int x, int y, @NotNull @NotNull org.joml.Vector4fc color) throws IllegalArgumentException, NullPointerException Set a pixel's color value in range [0..1]Color components Color Channel Vector Component Red xGreen yBlue zAlpha w- Parameters:
x- Pixel X coordinatey- Pixel Y coordinatecolor- Color values.- Throws:
NullPointerException- IfcolorisnullIllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
setColorf
void setColorf(int x, int y, @NotNull @NotNull org.joml.Vector3fc color) throws IllegalArgumentException, NullPointerException Set a pixel's color value in range [0..1]Color components Color Channel Vector Component Red xGreen yBlue z- Parameters:
x- Pixel X coordinatey- Pixel Y coordinatecolor- Color values.- Throws:
NullPointerException- IfcolorisnullIllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
setColori
void setColori(int x, int y, @NotNull @NotNull org.joml.Vector4ic color) throws IllegalArgumentException, NullPointerException Set a pixel's color value in range [0..255]Color components Color Channel Vector Component Red xGreen yBlue zAlpha w- Parameters:
x- Pixel X coordinatey- Pixel Y coordinatecolor- Color values.- Throws:
NullPointerException- IfcolorisnullIllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-
setColori
void setColori(int x, int y, @NotNull @NotNull org.joml.Vector3ic color) throws IllegalArgumentException, NullPointerException Set a pixel's color value in range [0..255]Color components Color Channel Vector Component Red xGreen yBlue z- Parameters:
x- Pixel X coordinatey- Pixel Y coordinatecolor- Color values.- Throws:
NullPointerException- IfcolorisnullIllegalArgumentException- If eitherxoryis below 0 or above the width or height, respectively.
-