Package org.lwjgl.stb
Class STBTTPackContext
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.stb.STBTTPackContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class STBTTPackContext extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceAn opaque structure which holds all the context needed fromPackBegintoPackEnd.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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSTBTTPackContext.BufferAn array ofSTBTTPackContextstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intH_OVERSAMPLE
HEIGHT
NODES
PACK_INFO
PADDING
PIXELSThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSKIP_MISSING
STRIDE_IN_BYTES
USER_ALLOCATOR_CONTEXT
V_OVERSAMPLE
WIDTHThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description STBTTPackContext(java.nio.ByteBuffer container)Creates aSTBTTPackContextinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static STBTTPackContextcalloc()Returns a newSTBTTPackContextinstance allocated withmemCalloc.static STBTTPackContext.Buffercalloc(int capacity)Returns a newSTBTTPackContext.Bufferinstance allocated withmemCalloc.static STBTTPackContextcallocStack()Returns a newSTBTTPackContextinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static STBTTPackContext.BuffercallocStack(int capacity)Returns a newSTBTTPackContext.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static STBTTPackContext.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBTTPackContext.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBTTPackContextcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newSTBTTPackContextinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBTTPackContextcreate()Returns a newSTBTTPackContextinstance allocated withBufferUtils.static STBTTPackContext.Buffercreate(int capacity)Returns a newSTBTTPackContext.Bufferinstance allocated withBufferUtils.static STBTTPackContextcreate(long address)Returns a newSTBTTPackContextinstance for the specified memory address.static STBTTPackContext.Buffercreate(long address, int capacity)Create aSTBTTPackContext.Bufferinstance at the specified memory.static STBTTPackContextcreateSafe(long address)static STBTTPackContext.BuffercreateSafe(long address, int capacity)inth_oversample()Returns the value of theh_oversamplefield.intheight()Returns the value of theheightfield.static STBTTPackContextmalloc()Returns a newSTBTTPackContextinstance allocated withmemAlloc.static STBTTPackContext.Buffermalloc(int capacity)Returns a newSTBTTPackContext.Bufferinstance allocated withmemAlloc.static STBTTPackContextmallocStack()Returns a newSTBTTPackContextinstance allocated on the thread-localMemoryStack.static STBTTPackContext.BuffermallocStack(int capacity)Returns a newSTBTTPackContext.Bufferinstance allocated on the thread-localMemoryStack.static STBTTPackContext.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBTTPackContext.Bufferinstance allocated on the specifiedMemoryStack.static STBTTPackContextmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newSTBTTPackContextinstance allocated on the specifiedMemoryStack.static intnh_oversample(long struct)Unsafe version ofh_oversample().static intnheight(long struct)Unsafe version ofheight().static STBRPNode.Buffernnodes(long struct, int capacity)Unsafe version ofnodes(int).STBRPNode.Buffernodes(int capacity)Returns aSTBRPNode.Bufferview of the struct array pointed to by thenodesfield.static STBRPContextnpack_info(long struct)Unsafe version ofpack_info().static intnpadding(long struct)Unsafe version ofpadding().static java.nio.ByteBuffernpixels(long struct, int capacity)Unsafe version ofpixels.static intnskip_missing(long struct)Unsafe version ofskip_missing().static intnstride_in_bytes(long struct)Unsafe version ofstride_in_bytes().static longnuser_allocator_context(long struct)Unsafe version ofuser_allocator_context().static intnv_oversample(long struct)Unsafe version ofv_oversample().static intnwidth(long struct)Unsafe version ofwidth().STBRPContextpack_info()Returns aSTBRPContextview of the struct pointed to by thepack_infofield.intpadding()Returns the value of thepaddingfield.java.nio.ByteBufferpixels(int capacity)Returns aByteBufferview of the data pointed to by thepixelsfield.intsizeof()booleanskip_missing()Returns the value of theskip_missingfield.intstride_in_bytes()Returns the value of thestride_in_bytesfield.longuser_allocator_context()Returns the value of theuser_allocator_contextfield.intv_oversample()Returns the value of thev_oversamplefield.intwidth()Returns the value of thewidthfield.
-
-
-
Constructor Detail
-
STBTTPackContext
public STBTTPackContext(java.nio.ByteBuffer container)
Creates aSTBTTPackContextinstance at the current position of the specifiedByteBuffercontainer. 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()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
user_allocator_context
public long user_allocator_context()
Returns the value of theuser_allocator_contextfield.
-
pack_info
public STBRPContext pack_info()
Returns aSTBRPContextview of the struct pointed to by thepack_infofield.
-
width
public int width()
Returns the value of thewidthfield.
-
height
public int height()
Returns the value of theheightfield.
-
stride_in_bytes
public int stride_in_bytes()
Returns the value of thestride_in_bytesfield.
-
padding
public int padding()
Returns the value of thepaddingfield.
-
skip_missing
public boolean skip_missing()
Returns the value of theskip_missingfield.
-
h_oversample
public int h_oversample()
Returns the value of theh_oversamplefield.
-
v_oversample
public int v_oversample()
Returns the value of thev_oversamplefield.
-
pixels
public java.nio.ByteBuffer pixels(int capacity)
Returns aByteBufferview of the data pointed to by thepixelsfield.- Parameters:
capacity- the number of elements in the returned buffer
-
nodes
public STBRPNode.Buffer nodes(int capacity)
Returns aSTBRPNode.Bufferview of the struct array pointed to by thenodesfield.- Parameters:
capacity- the number of elements in the returned buffer
-
malloc
public static STBTTPackContext malloc()
Returns a newSTBTTPackContextinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static STBTTPackContext calloc()
Returns a newSTBTTPackContextinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static STBTTPackContext create()
Returns a newSTBTTPackContextinstance allocated withBufferUtils.
-
create
public static STBTTPackContext create(long address)
Returns a newSTBTTPackContextinstance for the specified memory address.
-
createSafe
@Nullable public static STBTTPackContext createSafe(long address)
-
malloc
public static STBTTPackContext.Buffer malloc(int capacity)
Returns a newSTBTTPackContext.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static STBTTPackContext.Buffer calloc(int capacity)
Returns a newSTBTTPackContext.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static STBTTPackContext.Buffer create(int capacity)
Returns a newSTBTTPackContext.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static STBTTPackContext.Buffer create(long address, int capacity)
Create aSTBTTPackContext.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static STBTTPackContext.Buffer createSafe(long address, int capacity)
-
mallocStack
public static STBTTPackContext mallocStack()
Returns a newSTBTTPackContextinstance allocated on the thread-localMemoryStack.
-
callocStack
public static STBTTPackContext callocStack()
Returns a newSTBTTPackContextinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static STBTTPackContext mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContextinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static STBTTPackContext callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContextinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static STBTTPackContext.Buffer mallocStack(int capacity)
Returns a newSTBTTPackContext.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static STBTTPackContext.Buffer callocStack(int capacity)
Returns a newSTBTTPackContext.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static STBTTPackContext.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static STBTTPackContext.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nuser_allocator_context
public static long nuser_allocator_context(long struct)
Unsafe version ofuser_allocator_context().
-
npack_info
public static STBRPContext npack_info(long struct)
Unsafe version ofpack_info().
-
nwidth
public static int nwidth(long struct)
Unsafe version ofwidth().
-
nheight
public static int nheight(long struct)
Unsafe version ofheight().
-
nstride_in_bytes
public static int nstride_in_bytes(long struct)
Unsafe version ofstride_in_bytes().
-
npadding
public static int npadding(long struct)
Unsafe version ofpadding().
-
nskip_missing
public static int nskip_missing(long struct)
Unsafe version ofskip_missing().
-
nh_oversample
public static int nh_oversample(long struct)
Unsafe version ofh_oversample().
-
nv_oversample
public static int nv_oversample(long struct)
Unsafe version ofv_oversample().
-
npixels
public static java.nio.ByteBuffer npixels(long struct, int capacity)Unsafe version ofpixels.
-
nnodes
public static STBRPNode.Buffer nnodes(long struct, int capacity)
Unsafe version ofnodes(int).
-
-