Package org.lwjgl.stb

Class STBTTBitmap

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<STBTTBitmap>
org.lwjgl.stb.STBTTBitmap
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class STBTTBitmap extends org.lwjgl.system.Struct<STBTTBitmap> implements org.lwjgl.system.NativeResource
Bitmap data.

Layout


 struct stbtt__bitmap {
     int w();
     int h();
     int stride();
     unsigned char * pixels(int);
 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An array of STBTTBitmap structs.

    Nested classes/interfaces inherited from class org.lwjgl.system.Struct

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct size in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a STBTTBitmap instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new STBTTBitmap instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new STBTTBitmap.Buffer instance allocated with memCalloc.
    calloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new STBTTBitmap.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new STBTTBitmap instance allocated on the specified MemoryStack and initializes all its bits to zero.
    Deprecated.
    callocStack(int capacity)
    Deprecated.
    callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    callocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    Returns a new STBTTBitmap instance allocated with BufferUtils.
    create(int capacity)
    Returns a new STBTTBitmap.Buffer instance allocated with BufferUtils.
    create(long address)
    Returns a new STBTTBitmap instance for the specified memory address.
    create(long address, int capacity)
    Create a STBTTBitmap.Buffer instance at the specified memory.
    static @Nullable STBTTBitmap
    createSafe(long address)
    Like create, but returns null if address is NULL.
    static @Nullable STBTTBitmap.Buffer
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    int
    h()
    the bitmap height
    h(int value)
    Sets the specified value to the h() field.
    Returns a new STBTTBitmap instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new STBTTBitmap.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new STBTTBitmap.Buffer instance allocated on the specified MemoryStack.
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new STBTTBitmap instance allocated on the specified MemoryStack.
    Deprecated.
    mallocStack(int capacity)
    Deprecated.
    mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    mallocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static int
    nh(long struct)
    Unsafe version of h().
    static void
    nh(long struct, int value)
    Unsafe version of h.
    static ByteBuffer
    npixels(long struct, int capacity)
    Unsafe version of pixels.
    static void
    npixels(long struct, ByteBuffer value)
    Unsafe version of pixels.
    static int
    nstride(long struct)
    Unsafe version of stride().
    static void
    nstride(long struct, int value)
    Unsafe version of stride.
    static int
    nw(long struct)
    Unsafe version of w().
    static void
    nw(long struct, int value)
    Unsafe version of w.
    pixels(int capacity)
     
    Sets the address of the specified ByteBuffer to the pixels(int) field.
    set(int w, int h, int stride, ByteBuffer pixels)
    Initializes this struct with the specified values.
    Copies the specified struct data to this struct.
    int
     
    int
    the row stride, in bytes
    stride(int value)
    Sets the specified value to the stride() field.
    static void
    validate(long struct)
    Validates pointer members that should not be NULL.
    int
    w()
    the bitmap width
    w(int value)
    Sets the specified value to the w() field.

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • W

      public static final int W
      The struct member offsets.
    • H

      public static final int H
      The struct member offsets.
    • STRIDE

      public static final int STRIDE
      The struct member offsets.
    • PIXELS

      public static final int PIXELS
      The struct member offsets.
  • Constructor Details

    • STBTTBitmap

      public STBTTBitmap(ByteBuffer container)
      Creates a STBTTBitmap instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<STBTTBitmap>
    • w

      public int w()
      the bitmap width
    • h

      public int h()
      the bitmap height
    • stride

      public int stride()
      the row stride, in bytes
    • pixels

      public ByteBuffer pixels(int capacity)
      Parameters:
      capacity - the number of elements in the returned buffer
      Returns:
      the bitmap data
    • w

      public STBTTBitmap w(int value)
      Sets the specified value to the w() field.
    • h

      public STBTTBitmap h(int value)
      Sets the specified value to the h() field.
    • stride

      public STBTTBitmap stride(int value)
      Sets the specified value to the stride() field.
    • pixels

      public STBTTBitmap pixels(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the pixels(int) field.
    • set

      public STBTTBitmap set(int w, int h, int stride, ByteBuffer pixels)
      Initializes this struct with the specified values.
    • set

      public STBTTBitmap set(STBTTBitmap src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static STBTTBitmap malloc()
      Returns a new STBTTBitmap instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static STBTTBitmap calloc()
      Returns a new STBTTBitmap instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static STBTTBitmap create()
      Returns a new STBTTBitmap instance allocated with BufferUtils.
    • create

      public static STBTTBitmap create(long address)
      Returns a new STBTTBitmap instance for the specified memory address.
    • createSafe

      public static @Nullable STBTTBitmap createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static STBTTBitmap.Buffer malloc(int capacity)
      Returns a new STBTTBitmap.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static STBTTBitmap.Buffer calloc(int capacity)
      Returns a new STBTTBitmap.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static STBTTBitmap.Buffer create(int capacity)
      Returns a new STBTTBitmap.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static STBTTBitmap.Buffer create(long address, int capacity)
      Create a STBTTBitmap.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable STBTTBitmap.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static STBTTBitmap mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static STBTTBitmap callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static STBTTBitmap mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static STBTTBitmap callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static STBTTBitmap.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static STBTTBitmap.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static STBTTBitmap.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static STBTTBitmap.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static STBTTBitmap malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new STBTTBitmap instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static STBTTBitmap calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new STBTTBitmap instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static STBTTBitmap.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new STBTTBitmap.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static STBTTBitmap.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new STBTTBitmap.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nw

      public static int nw(long struct)
      Unsafe version of w().
    • nh

      public static int nh(long struct)
      Unsafe version of h().
    • nstride

      public static int nstride(long struct)
      Unsafe version of stride().
    • npixels

      public static ByteBuffer npixels(long struct, int capacity)
      Unsafe version of pixels.
    • nw

      public static void nw(long struct, int value)
      Unsafe version of w.
    • nh

      public static void nh(long struct, int value)
      Unsafe version of h.
    • nstride

      public static void nstride(long struct, int value)
      Unsafe version of stride.
    • npixels

      public static void npixels(long struct, ByteBuffer value)
      Unsafe version of pixels.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate