Package org.lwjgl.stb

Class STBTTPackContext

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

    public class STBTTPackContext
    extends Struct
    implements 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;
         int skip_missing;
         unsigned int h_oversample;
         unsigned int v_oversample;
         unsigned char * pixels;
         stbrp_node * nodes;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • USER_ALLOCATOR_CONTEXT, PACK_INFO, WIDTH, HEIGHT, STRIDE_IN_BYTES, PADDING, SKIP_MISSING, H_OVERSAMPLE, V_OVERSAMPLE, PIXELS, NODES

        The struct member offsets.
    • 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class 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.
      • 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 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
      • 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​(long address)
        Returns a new STBTTPackContext instance for the specified memory address.
      • 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.
      • mallocStack

        public static STBTTPackContext mallocStack()
        Returns a new STBTTPackContext instance allocated on the thread-local MemoryStack.
      • 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​(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​(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
      • nuser_allocator_context

        public static long nuser_allocator_context​(long struct)
        Unsafe version of user_allocator_context().
      • 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 java.nio.ByteBuffer npixels​(long struct,
                                                  int capacity)
        Unsafe version of pixels.