java.lang.Object
dev.prozilla.pine.common.asset.image.Image
All Implemented Interfaces:
Asset, Destructible

public class Image extends Object implements Asset
Represents an STB image with a width and a height.
  • Field Details

    • id

      public final int id
  • Constructor Details

    • Image

      public Image(String path, ByteBuffer pixels, int width, int height, int channels)
  • Method Details

    • getFlippedImage

      public ByteBuffer getFlippedImage()
    • getPremultipliedImage

      public ByteBuffer getPremultipliedImage()
    • getPixels

      public ByteBuffer getPixels()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getChannels

      public int getChannels()
    • getPath

      public String getPath()
      Description copied from interface: Asset
      Returns the path to the file this asset was loaded from.
      Specified by:
      getPath in interface Asset
      Returns:
      The path of this asset.
    • destroy

      public void destroy()
      Description copied from interface: Asset
      Removes this asset from the asset pool and deletes it.
      Specified by:
      destroy in interface Asset
      Specified by:
      destroy in interface Destructible
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toGLFWImage

      public GLFWImage toGLFWImage()
    • premultiplyAlpha

      public static ByteBuffer premultiplyAlpha(ByteBuffer image, int width, int height, int channels)
    • flipImageVertically

      public static ByteBuffer flipImageVertically(ByteBuffer image, int width, int height, int channels)