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 Classes
    Modifier and Type
    Interface
    Description
    static final record 
    BufferedImage-backed MeshImage implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MeshImage
    Represents the empty image.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull MeshImage
    from(@NotNull BufferedImage image)
    Wraps an AWT image for use by the mesh conversion pipeline.
    int
    Returns the image height in pixels.
    int
    rgb(int x, int z)
    Returns the ARGB color of a texture pixel.
    int
    Returns the image width in pixels.
  • Field Details

    • EMPTY

      static final MeshImage 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 coordinate
      z - vertical pixel coordinate
      Returns:
      the packed ARGB color value
      Since:
      0.0.1
    • from

      @NotNull static @NotNull MeshImage from(@NotNull @NotNull BufferedImage image)
      Wraps an AWT image for use by the mesh conversion pipeline.
      Parameters:
      image - source image
      Returns:
      an image adapter backed by BufferedImage
      Throws:
      NullPointerException - if image is null
      Since:
      0.0.1