Package org.lwjgl.stb

Class STBTTBitmap

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer


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

    Member documentation

    • w – the bitmap width
    • h – the bitmap height
    • stride – the row stride, in bytes
    • pixels – the bitmap data

    Layout

     struct stbtt__bitmap {
         int w;
         int h;
         int stride;
         unsigned char * pixels;
     }
    • Field Detail

      • SIZEOF

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

      • STBTTBitmap

        public STBTTBitmap(java.nio.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 Detail

      • sizeof

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

        public int w()
        Returns the value of the w field.
      • h

        public int h()
        Returns the value of the h field.
      • stride

        public int stride()
        Returns the value of the stride field.
      • pixels

        public java.nio.ByteBuffer pixels(int capacity)
        Returns a ByteBuffer view of the data pointed to by the pixels field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • 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(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the pixels field.
      • set

        public STBTTBitmap set(int w,
                               int h,
                               int stride,
                               java.nio.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(long address)
        Returns a new STBTTBitmap instance for the specified memory address.
      • createSafe

        @Nullable
        public static 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(long address,
                                                int capacity)
        Create a STBTTBitmap.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

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

        public static STBTTBitmap mallocStack()
        Returns a new STBTTBitmap instance allocated on the thread-local MemoryStack.
      • callocStack

        public static STBTTBitmap callocStack()
        Returns a new STBTTBitmap instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

        public static STBTTBitmap callocStack(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
      • mallocStack

        public static STBTTBitmap.Buffer mallocStack(int capacity)
        Returns a new STBTTBitmap.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static STBTTBitmap.Buffer callocStack(int capacity)
        Returns a new STBTTBitmap.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

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

        public static STBTTBitmap.Buffer callocStack(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:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • validate

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

        public static void validate(long array,
                                    int count)
        Calls STBTTBitmap.validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array