Package io.github.toxicity188.javamesh
Interface MeshImage
- All Known Implementing Classes:
MeshImage.Awt
public interface MeshImage
Abstraction over texture image access used while sampling triangle tint colors from UV coordinates.
Implementations provide pixel dimensions and random-access ARGB reads so mesh polygons can be converted into Minecraft model tint data without depending on a specific image library.
MeshImage image = MeshImage.from(bufferedImage);
int color = image.rgb(0, 0);
- Since:
- 0.0.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordBufferedImage-backedMeshImageimplementation. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MeshImagefrom(@NotNull BufferedImage image) Wraps an AWT image for use by the mesh conversion pipeline.intheight()Returns the image height in pixels.intrgb(int x, int z) Returns the ARGB color of a texture pixel.intwidth()Returns the image width in pixels.
-
Field Details
-
EMPTY
Represents the empty image.- Since:
- 0.0.1
-
-
Method Details
-
height
int height()Returns the image height in pixels.- Returns:
- texture height in pixels
- Since:
- 0.0.1
-
width
int width()Returns the image width in pixels.- Returns:
- texture width in pixels
- Since:
- 0.0.1
-
rgb
int rgb(int x, int z) Returns the ARGB color of a texture pixel.- Parameters:
x- horizontal pixel coordinatez- vertical pixel coordinate- Returns:
- the packed ARGB color value
- Since:
- 0.0.1
-
from
Wraps an AWT image for use by the mesh conversion pipeline.- Parameters:
image- source image- Returns:
- an image adapter backed by
BufferedImage - Throws:
NullPointerException- ifimageisnull- Since:
- 0.0.1
-