Class Image

java.lang.Object
com.raylib.Image

public class Image extends Object
Image, pixel data stored in CPU memory (RAM)
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Image

      public Image()
      Construct with auto memory allocator and fields initialized to zero.
    • Image

      public Image(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Image

      public Image(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Image

      public Image(MemorySegment data, int width, int height, int mipmaps, int format)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      data - Image raw data
      width - Image base width
      height - Image base height
      mipmaps - Mipmap levels, 1 by default
      format - Data format (PixelFormat type)
    • Image

      public Image(SegmentAllocator arena, MemorySegment data, int width, int height, int mipmaps, int format)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      data - Image raw data
      width - Image base width
      height - Image base height
      mipmaps - Mipmap levels, 1 by default
      format - Data format (PixelFormat type)
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

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

      public Image getArrayElement(int index)
    • allocateArray

      public static Image allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Image
    • allocateArray

      public static Image allocateArray(long elementCount)
      Allocate an array of Image
    • getData

      public MemorySegment getData()
      Image raw data
    • setData

      public void setData(MemorySegment value)
      Image raw data
    • data

      public MemorySegment data()
      Image raw data
    • data

      public Image data(MemorySegment value)
      Image raw data
    • getWidth

      public int getWidth()
      Image base width
    • setWidth

      public void setWidth(int value)
      Image base width
    • width

      public int width()
      Image base width
    • width

      public Image width(int value)
      Image base width
    • getHeight

      public int getHeight()
      Image base height
    • setHeight

      public void setHeight(int value)
      Image base height
    • height

      public int height()
      Image base height
    • height

      public Image height(int value)
      Image base height
    • getMipmaps

      public int getMipmaps()
      Mipmap levels, 1 by default
    • setMipmaps

      public void setMipmaps(int value)
      Mipmap levels, 1 by default
    • mipmaps

      public int mipmaps()
      Mipmap levels, 1 by default
    • mipmaps

      public Image mipmaps(int value)
      Mipmap levels, 1 by default
    • getFormat

      public int getFormat()
      Data format (PixelFormat type)
    • setFormat

      public void setFormat(int value)
      Data format (PixelFormat type)
    • format

      public int format()
      Data format (PixelFormat type)
    • format

      public Image format(int value)
      Data format (PixelFormat type)