Class MemoryTexture

All Implemented Interfaces:
Paintable, Icon, LoadableIcon, Proxy

@Generated("org.javagi.JavaGI") public class MemoryTexture extends Texture implements Paintable, Icon, LoadableIcon
A GdkTexture representing image data in memory.
  • Constructor Details

    • MemoryTexture

      public MemoryTexture(MemorySegment address)
      Create a MemoryTexture instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • MemoryTexture

      public MemoryTexture(int width, int height, MemoryFormat format, byte[] bytes, long stride)

      Creates a new texture for a blob of image data.

      The GBytes must contain stride × height pixels in the given format.

      Parameters:
      width - the width of the texture
      height - the height of the texture
      format - the format of the data
      bytes - the GBytes containing the pixel data
      stride - rowstride for the data
    • MemoryTexture

      public MemoryTexture()
      Create a new MemoryTexture.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the MemoryTexture class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected MemoryTexture asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Texture
      Returns:
      the instance as if it were its parent type
    • builder

      public static MemoryTexture.Builder<? extends MemoryTexture.Builder> builder()
      A MemoryTexture.Builder object constructs a MemoryTexture with the specified properties. Use the various set...() methods to set properties, and finish construction with MemoryTexture.Builder.build().
      Returns:
      the builder object