Class GLFWImage.Buffer

All Implemented Interfaces:
Addressable, ArrayPointer
Enclosing class:
GLFWImage

public static class GLFWImage.Buffer extends GLFWImage implements ArrayPointer
Buffer relies on preview features of the Java platform:
Programs can only use Buffer 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 2D images.
Since:
0.1.0
Author:
squid233
  • Constructor Details

    • Buffer

      public Buffer(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator, long elementCount)
      Create a GLFWImage.Buffer instance.
      Parameters:
      address - the address.
      allocator - the allocator of this address.
      elementCount - the element count
  • Method Details

    • width

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

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

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

      public GLFWImage.Buffer width(int width)
      Description copied from class: GLFWImage
      Sets the image width.
      Overrides:
      width in class GLFWImage
      Parameters:
      width - The width, in pixels, of this image.
      Returns:
      this
    • height

      public GLFWImage.Buffer height(int height)
      Description copied from class: GLFWImage
      Sets the image height.
      Overrides:
      height in class GLFWImage
      Parameters:
      height - The height, in pixels, of this image.
      Returns:
      this
    • pixels

      public GLFWImage.Buffer pixels(MemorySegmentPREVIEW pixels)
      Description copied from class: GLFWImage
      Sets the image pixels address.
      Overrides:
      pixels in class GLFWImage
      Parameters:
      pixels - The pixel data address of this image, arranged left-to-right, top-to-bottom.
      Returns:
      this
    • widthAt

      public int widthAt(long index)
      Gets the image width at the given index.
      Parameters:
      index - the index
      Returns:
      The width, in pixels, of this image.
    • heightAt

      public int heightAt(long index)
      Gets the image height at the given index.
      Parameters:
      index - the index
      Returns:
      The height, in pixels, of this image.
    • pixelsAt

      public MemorySegmentPREVIEW pixelsAt(long index)
      Gets the image pixels address at the given index.
      Parameters:
      index - the index
      Returns:
      The pixel data address of this image, arranged left-to-right, top-to-bottom.
    • width

      public int width()
      Description copied from class: GLFWImage
      Gets the image width.
      Overrides:
      width in class GLFWImage
      Returns:
      The width, in pixels, of this image.
    • height

      public int height()
      Description copied from class: GLFWImage
      Gets the image height.
      Overrides:
      height in class GLFWImage
      Returns:
      The height, in pixels, of this image.
    • pixels

      public MemorySegmentPREVIEW pixels()
      Description copied from class: GLFWImage
      Gets the image pixels address.
      Overrides:
      pixels in class GLFWImage
      Returns:
      The pixel data address of this image, arranged left-to-right, top-to-bottom.