Package limn.graphics

Class Image

java.lang.Object
limn.graphics.Image

public final class Image extends Object
An immutable, backend-independent bitmap: RGBA8 pixels, straight (non premultiplied) alpha, row-major, row 0 at the top. Decoded once (see Images) and drawn via Canvas.drawImage(limn.graphics.Image, float, float, float, float); the GPU texture is created lazily by each window's renderer, so one Image works across multiple windows (whose GL contexts are not shared).

Object identity is the texture-cache key; reuse the same instance rather than decoding the same asset repeatedly.

  • Constructor Details

    • Image

      public Image(int width, int height, byte[] rgba)
      Parameters:
      width - pixels
      height - pixels
      rgba - width*height*4 bytes, straight alpha, top-down
  • Method Details

    • width

      public int width()
      Returns:
      width in pixels
    • height

      public int height()
      Returns:
      height in pixels
    • pixels

      public byte[] pixels()
      Returns:
      the raw RGBA bytes (do not mutate)