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.Vector4f
getColorf
(int x, int y) Get a pixel's color value in range [0..1]org.joml.Vector4f
getColorf
(int x, int y, @NotNull org.joml.Vector4f out) Get a pixel's color value in range [0..1]@NotNull org.joml.Vector4i
getColori
(int x, int y) Get a pixel's color value in range [0..255]org.joml.Vector4i
getColori
(int x, int y, @NotNull org.joml.Vector4i out) Get a pixel's color value in range [0..255]@NotNull CanvasElement
Get the element this canvas belongs to.int
The height of the canvas.int
getWidth()
The width of the canvas.void
Set a pixel's color value.void
setColorf
(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 Redx
Greeny
Bluez
void
setColorf
(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 Redx
Greeny
Bluez
Alphaw
void
setColori
(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 Redx
Greeny
Bluez
void
setColori
(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 Redx
Greeny
Bluez
Alphaw
-
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
out
argument - Throws:
IllegalArgumentException
- If eitherx
ory
is below 0 or above the width or height, respectively.NullPointerException
- Ifout
isnull
-
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
out
argument - Throws:
IllegalArgumentException
- If eitherx
ory
is below 0 or above the width or height, respectively.NullPointerException
- Ifout
isnull
-
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 eitherx
ory
is 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 eitherx
ory
is 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 eitherx
ory
is 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
- Ifcolor
isnull
IllegalArgumentException
- If eitherx
ory
is 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 x
Green y
Blue z
Alpha w
- Parameters:
x
- Pixel X coordinatey
- Pixel Y coordinatecolor
- Color values.- Throws:
NullPointerException
- Ifcolor
isnull
IllegalArgumentException
- If eitherx
ory
is 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 x
Green y
Blue z
- Parameters:
x
- Pixel X coordinatey
- Pixel Y coordinatecolor
- Color values.- Throws:
NullPointerException
- Ifcolor
isnull
IllegalArgumentException
- If eitherx
ory
is 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 x
Green y
Blue z
Alpha w
- Parameters:
x
- Pixel X coordinatey
- Pixel Y coordinatecolor
- Color values.- Throws:
NullPointerException
- Ifcolor
isnull
IllegalArgumentException
- If eitherx
ory
is 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 x
Green y
Blue z
- Parameters:
x
- Pixel X coordinatey
- Pixel Y coordinatecolor
- Color values.- Throws:
NullPointerException
- Ifcolor
isnull
IllegalArgumentException
- If eitherx
ory
is below 0 or above the width or height, respectively.
-