Class GLFWImage

All Implemented Interfaces:
Addressable
Direct Known Subclasses:
GLFWImage.Buffer

public class GLFWImage extends Struct
GLFWImage relies on preview features of the Java platform:
Programs can only use GLFWImage when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
This describes a single 2D image. See the documentation for each related function what the expected pixel format is.

Layout


 struct GLFWimage {
     int width;
     int height;
     unsigned char* pixelsPREVIEW;
 }
Since:
0.1.0
Author:
squid233
  • Field Details

  • Constructor Details

  • Method Details

    • create

      public static GLFWImage create(SegmentAllocatorPREVIEW allocator)
      Creates a GLFWImage instance with the given allocator.
      Parameters:
      allocator - the allocator
      Returns:
      the instance
    • create

      public static GLFWImage.Buffer create(SegmentAllocatorPREVIEW allocator, long count)
      Creates a GLFWImage.Buffer instance with the given allocator and count.
      Parameters:
      allocator - the allocator
      count - the count
      Returns:
      the instance
    • width

      public GLFWImage width(int width)
      Sets the image width.
      Parameters:
      width - The width, in pixels, of this image.
      Returns:
      this
    • height

      public GLFWImage height(int height)
      Sets the image height.
      Parameters:
      height - The height, in pixels, of this image.
      Returns:
      this
    • pixels

      public GLFWImage pixels(MemorySegmentPREVIEW pixels)
      Sets the image pixels address.
      Parameters:
      pixels - The pixel data address of this image, arranged left-to-right, top-to-bottom.
      Returns:
      this
    • width

      public int width()
      Gets the image width.
      Returns:
      The width, in pixels, of this image.
    • height

      public int height()
      Gets the image height.
      Returns:
      The height, in pixels, of this image.
    • pixels

      public MemorySegmentPREVIEW pixels()
      Gets the image pixels address.
      Returns:
      The pixel data address of this image, arranged left-to-right, top-to-bottom.