Package org.lwjgl.stb

Class STBTTPackContext

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class STBTTPackContext extends Struct<STBTTPackContext> implements NativeResource

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

    • SIZEOF

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

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

      public static final int USER_ALLOCATOR_CONTEXT
      The struct member offsets.
    • PACK_INFO

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

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

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

      public static final int STRIDE_IN_BYTES
      The struct member offsets.
    • PADDING

      public static final int PADDING
      The struct member offsets.
    • SKIP_MISSING

      public static final int SKIP_MISSING
      The struct member offsets.
    • H_OVERSAMPLE

      public static final int H_OVERSAMPLE
      The struct member offsets.
    • V_OVERSAMPLE

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

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

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

    • STBTTPackContext

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

    • sizeof

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

      public boolean skip_missing()
      Returns:
      the value of the skip_missing 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 ByteBuffer pixels(int capacity)
      Returns:
      a ByteBuffer view of the data pointed to by the pixels field.
    • nodes

      public STBRPNode.Buffer nodes(int capacity)
      Returns:
      a STBRPNode.Buffer view of the struct array pointed to by the nodes field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static long nuser_allocator_context(long struct)
      Unsafe version of user_allocator_context().
    • npack_info

      public static STBRPContext npack_info(long struct)
      Unsafe version of pack_info().
    • nwidth

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

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

      public static int nstride_in_bytes(long struct)
      Unsafe version of stride_in_bytes().
    • npadding

      public static int npadding(long struct)
      Unsafe version of padding().
    • nskip_missing

      public static int nskip_missing(long struct)
      Unsafe version of skip_missing().
    • nh_oversample

      public static int nh_oversample(long struct)
      Unsafe version of h_oversample().
    • nv_oversample

      public static int nv_oversample(long struct)
      Unsafe version of v_oversample().
    • npixels

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

      public static STBRPNode.Buffer nnodes(long struct, int capacity)
      Unsafe version of nodes(int).