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.NativeResource
An opaque structure which holds all the context needed fromPackBegin
toPackEnd
.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 class
STBTTPackContext.Buffer
An array ofSTBTTPackContext
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
H_OVERSAMPLE
HEIGHT
NODES
PACK_INFO
PADDING
PIXELSThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
SKIP_MISSING
STRIDE_IN_BYTES
USER_ALLOCATOR_CONTEXT
V_OVERSAMPLE
WIDTHThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description STBTTPackContext(java.nio.ByteBuffer container)
Creates aSTBTTPackContext
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static STBTTPackContext
calloc()
Returns a newSTBTTPackContext
instance allocated withmemCalloc
.static STBTTPackContext.Buffer
calloc(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated withmemCalloc
.static STBTTPackContext
callocStack()
Returns a newSTBTTPackContext
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBTTPackContext.Buffer
callocStack(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBTTPackContext.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBTTPackContext
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBTTPackContext
create()
Returns a newSTBTTPackContext
instance allocated withBufferUtils
.static STBTTPackContext.Buffer
create(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated withBufferUtils
.static STBTTPackContext
create(long address)
Returns a newSTBTTPackContext
instance for the specified memory address.static STBTTPackContext.Buffer
create(long address, int capacity)
Create aSTBTTPackContext.Buffer
instance at the specified memory.static STBTTPackContext
createSafe(long address)
static STBTTPackContext.Buffer
createSafe(long address, int capacity)
int
h_oversample()
Returns the value of theh_oversample
field.int
height()
Returns the value of theheight
field.static STBTTPackContext
malloc()
Returns a newSTBTTPackContext
instance allocated withmemAlloc
.static STBTTPackContext.Buffer
malloc(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated withmemAlloc
.static STBTTPackContext
mallocStack()
Returns a newSTBTTPackContext
instance allocated on the thread-localMemoryStack
.static STBTTPackContext.Buffer
mallocStack(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated on the thread-localMemoryStack
.static STBTTPackContext.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext.Buffer
instance allocated on the specifiedMemoryStack
.static STBTTPackContext
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext
instance allocated on the specifiedMemoryStack
.static int
nh_oversample(long struct)
Unsafe version ofh_oversample()
.static int
nheight(long struct)
Unsafe version ofheight()
.static STBRPNode.Buffer
nnodes(long struct, int capacity)
Unsafe version ofnodes(int)
.STBRPNode.Buffer
nodes(int capacity)
Returns aSTBRPNode.Buffer
view of the struct array pointed to by thenodes
field.static STBRPContext
npack_info(long struct)
Unsafe version ofpack_info()
.static int
npadding(long struct)
Unsafe version ofpadding()
.static java.nio.ByteBuffer
npixels(long struct, int capacity)
Unsafe version ofpixels
.static int
nskip_missing(long struct)
Unsafe version ofskip_missing()
.static int
nstride_in_bytes(long struct)
Unsafe version ofstride_in_bytes()
.static long
nuser_allocator_context(long struct)
Unsafe version ofuser_allocator_context()
.static int
nv_oversample(long struct)
Unsafe version ofv_oversample()
.static int
nwidth(long struct)
Unsafe version ofwidth()
.STBRPContext
pack_info()
Returns aSTBRPContext
view of the struct pointed to by thepack_info
field.int
padding()
Returns the value of thepadding
field.java.nio.ByteBuffer
pixels(int capacity)
Returns aByteBuffer
view of the data pointed to by thepixels
field.int
sizeof()
boolean
skip_missing()
Returns the value of theskip_missing
field.int
stride_in_bytes()
Returns the value of thestride_in_bytes
field.long
user_allocator_context()
Returns the value of theuser_allocator_context
field.int
v_oversample()
Returns the value of thev_oversample
field.int
width()
Returns the value of thewidth
field.
-
-
-
Constructor Detail
-
STBTTPackContext
public STBTTPackContext(java.nio.ByteBuffer container)
Creates aSTBTTPackContext
instance at the current position of the specifiedByteBuffer
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()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
user_allocator_context
public long user_allocator_context()
Returns the value of theuser_allocator_context
field.
-
pack_info
public STBRPContext pack_info()
Returns aSTBRPContext
view of the struct pointed to by thepack_info
field.
-
width
public int width()
Returns the value of thewidth
field.
-
height
public int height()
Returns the value of theheight
field.
-
stride_in_bytes
public int stride_in_bytes()
Returns the value of thestride_in_bytes
field.
-
padding
public int padding()
Returns the value of thepadding
field.
-
skip_missing
public boolean skip_missing()
Returns the value of theskip_missing
field.
-
h_oversample
public int h_oversample()
Returns the value of theh_oversample
field.
-
v_oversample
public int v_oversample()
Returns the value of thev_oversample
field.
-
pixels
public java.nio.ByteBuffer pixels(int capacity)
Returns aByteBuffer
view of the data pointed to by thepixels
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
nodes
public STBRPNode.Buffer nodes(int capacity)
Returns aSTBRPNode.Buffer
view of the struct array pointed to by thenodes
field.- Parameters:
capacity
- the number of elements in the returned buffer
-
malloc
public static STBTTPackContext malloc()
Returns a newSTBTTPackContext
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static STBTTPackContext calloc()
Returns a newSTBTTPackContext
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static STBTTPackContext create()
Returns a newSTBTTPackContext
instance allocated withBufferUtils
.
-
create
public static STBTTPackContext create(long address)
Returns a newSTBTTPackContext
instance for the specified memory address.
-
createSafe
@Nullable public static STBTTPackContext createSafe(long address)
-
malloc
public static STBTTPackContext.Buffer malloc(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static STBTTPackContext.Buffer calloc(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static STBTTPackContext.Buffer create(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static STBTTPackContext.Buffer create(long address, int capacity)
Create aSTBTTPackContext.Buffer
instance 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 newSTBTTPackContext
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static STBTTPackContext callocStack()
Returns a newSTBTTPackContext
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static STBTTPackContext mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static STBTTPackContext callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTPackContext
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static STBTTPackContext.Buffer callocStack(int capacity)
Returns a newSTBTTPackContext.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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)
.
-
-