Package org.lwjgl.stb

Class STBRPContext

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

    public class STBRPContext
    extends Struct
    implements NativeResource
    The opaque stbrp_context struct.

    Member documentation

    • extra – we allocate two extra nodes so optimal user-node-count is width not width+2

    Layout

    
     struct stbrp_context {
         int width;
         int height;
         int align;
         int init_mode;
         int heuristic;
         int num_nodes;
         stbrp_node * active_head;
         stbrp_node * free_head;
         stbrp_node extra[2];
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • WIDTH, HEIGHT, ALIGN, INIT_MODE, HEURISTIC, NUM_NODES, ACTIVE_HEAD, FREE_HEAD, EXTRA

        The struct member offsets.
    • Constructor Detail

      • STBRPContext

        public STBRPContext​(java.nio.ByteBuffer container)
        Creates a STBRPContext 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • width

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

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

        public int align()
        Returns the value of the align field.
      • init_mode

        public int init_mode()
        Returns the value of the init_mode field.
      • heuristic

        public int heuristic()
        Returns the value of the heuristic field.
      • num_nodes

        public int num_nodes()
        Returns the value of the num_nodes field.
      • active_head

        @Nullable
        public STBRPNode active_head()
        Returns a STBRPNode view of the struct pointed to by the active_head field.
      • free_head

        @Nullable
        public STBRPNode free_head()
        Returns a STBRPNode view of the struct pointed to by the free_head field.
      • extra

        public STBRPNode extra​(int index)
        Returns a STBRPNode view of the struct at the specified index of the extra field.
      • create

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

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

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

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

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

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

        public static STBRPContext.Buffer callocStack​(int capacity,
                                                      MemoryStack stack)
        Returns a new STBRPContext.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
      • nwidth

        public static int nwidth​(long struct)
        Unsafe version of width().
      • nheight

        public static int nheight​(long struct)
        Unsafe version of height().
      • nalign

        public static int nalign​(long struct)
        Unsafe version of align().
      • ninit_mode

        public static int ninit_mode​(long struct)
        Unsafe version of init_mode().
      • nheuristic

        public static int nheuristic​(long struct)
        Unsafe version of heuristic().
      • nnum_nodes

        public static int nnum_nodes​(long struct)
        Unsafe version of num_nodes().
      • nactive_head

        @Nullable
        public static STBRPNode nactive_head​(long struct)
        Unsafe version of active_head().
      • nfree_head

        @Nullable
        public static STBRPNode nfree_head​(long struct)
        Unsafe version of free_head().
      • nextra

        public static STBRPNode nextra​(long struct,
                                       int index)
        Unsafe version of extra.