Top Description Inners Fields Constructors Methods
org.lwjgl.stb

public Class STBTTPackContext

extends Struct<STBTTPackContext>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct stbtt_pack_context
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

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;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
H_OVERSAMPLE

The struct member offsets.

public static final int
HEIGHT

The struct member offsets.

public static final int
NODES

The struct member offsets.

public static final int
PACK_INFO

The struct member offsets.

public static final int
PADDING

The struct member offsets.

public static final int
PIXELS

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
SKIP_MISSING

The struct member offsets.

public static final int
STRIDE_IN_BYTES

The struct member offsets.

public static final int
USER_ALLOCATOR_CONTEXT

The struct member offsets.

public static final int
V_OVERSAMPLE

The struct member offsets.

public static final int
WIDTH

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
STBTTPackContext(long address, ByteBuffer container)

public
STBTTPackContext(ByteBuffer container)

Creates a STBTTPackContext instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static STBTTPackContext
calloc()

Returns a new STBTTPackContext instance allocated with memCalloc.

public static STBTTPackContext.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new STBTTPackContext.Buffer instance allocated with memCalloc.

public static STBTTPackContext
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new STBTTPackContext instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static STBTTPackContext.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new STBTTPackContext.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static STBTTPackContext
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static STBTTPackContext
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static STBTTPackContext.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static STBTTPackContext.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
protected STBTTPackContext
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static STBTTPackContext
create()

Returns a new STBTTPackContext instance allocated with BufferUtils.

public static STBTTPackContext
create(long address)

Returns a new STBTTPackContext instance for the specified memory address.

public static STBTTPackContext.Buffer
create(int
the buffer capacity
capacity
)

Returns a new STBTTPackContext.Buffer instance allocated with BufferUtils.

public static STBTTPackContext.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a STBTTPackContext.Buffer instance at the specified memory.

public static STBTTPackContext
createSafe(long address)

Like create, but returns null if address is NULL.

public static STBTTPackContext.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public int

Returns:

the value of the h_oversample field.
h_oversample
()

public int

Returns:

the value of the height field.
height
()

public static STBTTPackContext
malloc()

Returns a new STBTTPackContext instance allocated with memAlloc.

public static STBTTPackContext.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new STBTTPackContext.Buffer instance allocated with memAlloc.

public static STBTTPackContext
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new STBTTPackContext instance allocated on the specified MemoryStack.

public static STBTTPackContext.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new STBTTPackContext.Buffer instance allocated on the specified MemoryStack.

public static STBTTPackContext
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static STBTTPackContext
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static STBTTPackContext.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static STBTTPackContext.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static int
nh_oversample(long struct)

Unsafe version of h_oversample.

public static int
nheight(long struct)

Unsafe version of height.

public static STBRPNode.Buffer
nnodes(long struct, int capacity)

Unsafe version of nodes.

public STBRPNode.Buffer

Returns:

a STBRPNode.Buffer view of the struct array pointed to by the nodes field.
nodes
(int
the number of elements in the returned buffer
capacity
)

public static STBRPContext
npack_info(long struct)

Unsafe version of pack_info.

public static int
npadding(long struct)

Unsafe version of padding.

public static ByteBuffer
npixels(long struct, int capacity)

Unsafe version of pixels.

public static int
nskip_missing(long struct)

Unsafe version of skip_missing.

public static int
nstride_in_bytes(long struct)

Unsafe version of stride_in_bytes.

public static long
nuser_allocator_context(long struct)

Unsafe version of user_allocator_context.

public static int
nv_oversample(long struct)

Unsafe version of v_oversample.

public static int
nwidth(long struct)

Unsafe version of width.

public STBRPContext

Returns:

a STBRPContext view of the struct pointed to by the pack_info field.
pack_info
()

public int

Returns:

the value of the padding field.
padding
()

public ByteBuffer

Returns:

a ByteBuffer view of the data pointed to by the pixels field.
pixels
(int
the number of elements in the returned buffer
capacity
)

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public boolean

Returns:

the value of the skip_missing field.
skip_missing
()

public int

Returns:

the value of the stride_in_bytes field.
stride_in_bytes
()

public long

Returns:

the value of the user_allocator_context field.
user_allocator_context
()

public int

Returns:

the value of the v_oversample field.
v_oversample
()

public int

Returns:

the value of the width field.
width
()

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

H_OVERSAMPLEback to summary
public static final int H_OVERSAMPLE

The struct member offsets.

HEIGHTback to summary
public static final int HEIGHT

The struct member offsets.

NODESback to summary
public static final int NODES

The struct member offsets.

PACK_INFOback to summary
public static final int PACK_INFO

The struct member offsets.

PADDINGback to summary
public static final int PADDING

The struct member offsets.

PIXELSback to summary
public static final int PIXELS

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

SKIP_MISSINGback to summary
public static final int SKIP_MISSING

The struct member offsets.

STRIDE_IN_BYTESback to summary
public static final int STRIDE_IN_BYTES

The struct member offsets.

USER_ALLOCATOR_CONTEXTback to summary
public static final int USER_ALLOCATOR_CONTEXT

The struct member offsets.

V_OVERSAMPLEback to summary
public static final int V_OVERSAMPLE

The struct member offsets.

WIDTHback to summary
public static final int WIDTH

The struct member offsets.

Constructor Detail

STBTTPackContextback to summary
protected STBTTPackContext(long address, ByteBuffer container)
STBTTPackContextback to summary
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 Detail

callocback to summary
public static STBTTPackContext calloc()

Returns a new STBTTPackContext instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static STBTTPackContext.Buffer calloc(int capacity)

Returns a new STBTTPackContext.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
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:MemoryStack

the stack from which to allocate

callocback to summary
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:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static STBTTPackContext callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static STBTTPackContext callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static STBTTPackContext.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static STBTTPackContext.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected STBTTPackContext create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static STBTTPackContext create()

Returns a new STBTTPackContext instance allocated with BufferUtils.

createback to summary
public static STBTTPackContext create(long address)

Returns a new STBTTPackContext instance for the specified memory address.

createback to summary
public static STBTTPackContext.Buffer create(int capacity)

Returns a new STBTTPackContext.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static STBTTPackContext.Buffer create(long address, int capacity)

Create a STBTTPackContext.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static STBTTPackContext createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static STBTTPackContext.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
h_oversampleback to summary
public int h_oversample()
Returns:int

the value of the h_oversample field.

Annotations
@NativeType:unsigned int
heightback to summary
public int height()
Returns:int

the value of the height field.

mallocback to summary
public static STBTTPackContext malloc()

Returns a new STBTTPackContext instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static STBTTPackContext.Buffer malloc(int capacity)

Returns a new STBTTPackContext.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static STBTTPackContext malloc(MemoryStack stack)

Returns a new STBTTPackContext instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static STBTTPackContext.Buffer malloc(int capacity, MemoryStack stack)

Returns a new STBTTPackContext.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static STBTTPackContext mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static STBTTPackContext mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static STBTTPackContext.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static STBTTPackContext.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
nh_oversampleback to summary
public static int nh_oversample(long struct)

Unsafe version of h_oversample.

nheightback to summary
public static int nheight(long struct)

Unsafe version of height.

nnodesback to summary
public static STBRPNode.Buffer nnodes(long struct, int capacity)

Unsafe version of nodes.

nodesback to summary
public STBRPNode.Buffer nodes(int capacity)
Parameters
capacity:int

the number of elements in the returned buffer

Returns:STBRPNode.Buffer

a STBRPNode.Buffer view of the struct array pointed to by the nodes field.

Annotations
@NativeType:stbrp_node *
npack_infoback to summary
public static STBRPContext npack_info(long struct)

Unsafe version of pack_info.

npaddingback to summary
public static int npadding(long struct)

Unsafe version of padding.

npixelsback to summary
public static ByteBuffer npixels(long struct, int capacity)

Unsafe version of pixels.

nskip_missingback to summary
public static int nskip_missing(long struct)

Unsafe version of skip_missing.

nstride_in_bytesback to summary
public static int nstride_in_bytes(long struct)

Unsafe version of stride_in_bytes.

nuser_allocator_contextback to summary
public static long nuser_allocator_context(long struct)

Unsafe version of user_allocator_context.

nv_oversampleback to summary
public static int nv_oversample(long struct)

Unsafe version of v_oversample.

nwidthback to summary
public static int nwidth(long struct)

Unsafe version of width.

pack_infoback to summary
public STBRPContext pack_info()
Returns:STBRPContext

a STBRPContext view of the struct pointed to by the pack_info field.

Annotations
@NativeType:stbrp_context *
paddingback to summary
public int padding()
Returns:int

the value of the padding field.

pixelsback to summary
public ByteBuffer pixels(int capacity)
Parameters
capacity:int

the number of elements in the returned buffer

Returns:ByteBuffer

a ByteBuffer view of the data pointed to by the pixels field.

Annotations
@NativeType:unsigned char *
sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
skip_missingback to summary
public boolean skip_missing()
Returns:boolean

the value of the skip_missing field.

Annotations
@NativeType:int
stride_in_bytesback to summary
public int stride_in_bytes()
Returns:int

the value of the stride_in_bytes field.

user_allocator_contextback to summary
public long user_allocator_context()
Returns:long

the value of the user_allocator_context field.

Annotations
@NativeType:void *
v_oversampleback to summary
public int v_oversample()
Returns:int

the value of the v_oversample field.

Annotations
@NativeType:unsigned int
widthback to summary
public int width()
Returns:int

the value of the width field.

org.lwjgl.stb back to summary

public Class STBTTPackContext.Buffer

extends StructBuffer<STBTTPackContext, STBTTPackContext.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of STBTTPackContext structs.

Field Summary

Modifier and TypeField and Description
private static final STBTTPackContext

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new STBTTPackContext.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
protected STBTTPackContext
public int

Returns:

the value of the h_oversample field.
h_oversample
()

public int

Returns:

the value of the height field.
height
()

public STBRPNode.Buffer

Returns:

a STBRPNode.Buffer view of the struct array pointed to by the nodes field.
nodes
(int
the number of elements in the returned buffer
capacity
)

public STBRPContext

Returns:

a STBRPContext view of the struct pointed to by the pack_info field.
pack_info
()

public int

Returns:

the value of the padding field.
padding
()

public ByteBuffer

Returns:

a ByteBuffer view of the data pointed to by the pixels field.
pixels
(int
the number of elements in the returned buffer
capacity
)

protected STBTTPackContext.Buffer
public boolean

Returns:

the value of the skip_missing field.
skip_missing
()

public int

Returns:

the value of the stride_in_bytes field.
stride_in_bytes
()

public long

Returns:

the value of the user_allocator_context field.
user_allocator_context
()

public int

Returns:

the value of the v_oversample field.
v_oversample
()

public int

Returns:

the value of the width field.
width
()

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final STBTTPackContext ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new STBTTPackContext.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by STBTTPackContext#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

getElementFactoryback to summary
protected STBTTPackContext getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
h_oversampleback to summary
public int h_oversample()
Returns:int

the value of the h_oversample field.

Annotations
@NativeType:unsigned int
heightback to summary
public int height()
Returns:int

the value of the height field.

nodesback to summary
public STBRPNode.Buffer nodes(int capacity)
Parameters
capacity:int

the number of elements in the returned buffer

Returns:STBRPNode.Buffer

a STBRPNode.Buffer view of the struct array pointed to by the nodes field.

Annotations
@NativeType:stbrp_node *
pack_infoback to summary
public STBRPContext pack_info()
Returns:STBRPContext

a STBRPContext view of the struct pointed to by the pack_info field.

Annotations
@NativeType:stbrp_context *
paddingback to summary
public int padding()
Returns:int

the value of the padding field.

pixelsback to summary
public ByteBuffer pixels(int capacity)
Parameters
capacity:int

the number of elements in the returned buffer

Returns:ByteBuffer

a ByteBuffer view of the data pointed to by the pixels field.

Annotations
@NativeType:unsigned char *
selfback to summary
protected STBTTPackContext.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
skip_missingback to summary
public boolean skip_missing()
Returns:boolean

the value of the skip_missing field.

Annotations
@NativeType:int
stride_in_bytesback to summary
public int stride_in_bytes()
Returns:int

the value of the stride_in_bytes field.

user_allocator_contextback to summary
public long user_allocator_context()
Returns:long

the value of the user_allocator_context field.

Annotations
@NativeType:void *
v_oversampleback to summary
public int v_oversample()
Returns:int

the value of the v_oversample field.

Annotations
@NativeType:unsigned int
widthback to summary
public int width()
Returns:int

the value of the width field.