Package org.lwjgl.stb

Class STBRPContext

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class STBRPContext extends Struct<STBRPContext> implements NativeResource

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

    • SIZEOF

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

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

      public static final int WIDTH
      The struct member offsets.
    • HEIGHT

      public static final int HEIGHT
      The struct member offsets.
    • ALIGN

      public static final int ALIGN
      The struct member offsets.
    • INIT_MODE

      public static final int INIT_MODE
      The struct member offsets.
    • HEURISTIC

      public static final int HEURISTIC
      The struct member offsets.
    • NUM_NODES

      public static final int NUM_NODES
      The struct member offsets.
    • ACTIVE_HEAD

      public static final int ACTIVE_HEAD
      The struct member offsets.
    • FREE_HEAD

      public static final int FREE_HEAD
      The struct member offsets.
    • EXTRA

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

    • STBRPContext

      public STBRPContext(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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<STBRPContext>
    • 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

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

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

      public STBRPNode.Buffer extra()
      Returns:
      a STBRPNode.Buffer view of the extra field.
    • extra

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

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

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

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

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

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

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

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

      public static STBRPContext.Buffer create(int capacity)
      Returns a new STBRPContext.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • 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

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

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

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

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

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

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

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

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

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

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

      public static STBRPContext calloc(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
    • malloc

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

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

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

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

      public static STBRPNode.Buffer nextra(long struct)
      Unsafe version of extra().
    • nextra

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