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.


     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

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        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.
      • 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.
        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.
        capacity - the number of elements in the returned buffer
      • createSafe

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

        public static STBTTPackContext.Buffer createSafe​(long address,
                                                         int capacity)
        Like create, but returns null if address is NULL.
      • 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().
      • 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.