Package org.lwjgl.stb

Class STBTTPackContext

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


    public class STBTTPackContext
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    An opaque structure which holds all the context needed from PackBegin to PackEnd.

    Layout

     struct stbtt_pack_context {
         void * user_allocator_context;
         stbrp_context * pack_info;
         int width;
         int height;
         int stride_in_bytes;
         int padding;
         unsigned int h_oversample;
         unsigned int v_oversample;
         unsigned char * pixels;
         stbrp_node * nodes;
     }
    • Field Detail

      • SIZEOF

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

      • STBTTPackContext

        public STBTTPackContext(java.nio.ByteBuffer container)
        Creates a STBTTPackContext 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
      • user_allocator_context

        public long user_allocator_context()
        Returns the value of the user_allocator_context field.
      • pack_info

        public STBRPContext pack_info()
        Returns a STBRPContext view of the struct pointed to by the pack_info field.
      • width

        public int width()
        Returns the value of the width field.
      • height

        public int height()
        Returns the value of the height field.
      • stride_in_bytes

        public int stride_in_bytes()
        Returns the value of the stride_in_bytes field.
      • padding

        public int padding()
        Returns the value of the padding field.
      • h_oversample

        public int h_oversample()
        Returns the value of the h_oversample field.
      • v_oversample

        public int v_oversample()
        Returns the value of the v_oversample 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
      • nodes

        public STBRPNode.Buffer nodes(int capacity)
        Returns a STBRPNode.Buffer view of the struct array pointed to by the nodes field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • createSafe

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

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

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

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

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

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

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

        public static STBTTPackContext.Buffer callocStack(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new STBTTPackContext.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