Package org.lwjgl.stb
Class STBTTBitmap
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct stbtt__bitmap {
int w;
int h;
int stride;
unsigned char * pixels;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSTBTTBitmap(ByteBuffer container) Creates aSTBTTBitmapinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic STBTTBitmapcalloc()Returns a newSTBTTBitmapinstance allocated withmemCalloc.static STBTTBitmap.Buffercalloc(int capacity) Returns a newSTBTTBitmap.Bufferinstance allocated withmemCalloc.static STBTTBitmap.Buffercalloc(int capacity, MemoryStack stack) Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBTTBitmapcalloc(MemoryStack stack) Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBTTBitmapcreate()Returns a newSTBTTBitmapinstance allocated withBufferUtils.static STBTTBitmap.Buffercreate(int capacity) Returns a newSTBTTBitmap.Bufferinstance allocated withBufferUtils.static STBTTBitmapcreate(long address) Returns a newSTBTTBitmapinstance for the specified memory address.static STBTTBitmap.Buffercreate(long address, int capacity) Create aSTBTTBitmap.Bufferinstance at the specified memory.static @Nullable STBTTBitmapcreateSafe(long address) static @Nullable STBTTBitmap.BuffercreateSafe(long address, int capacity) inth()h(int value) Sets the specified value to thehfield.static STBTTBitmapmalloc()Returns a newSTBTTBitmapinstance allocated withmemAlloc.static STBTTBitmap.Buffermalloc(int capacity) Returns a newSTBTTBitmap.Bufferinstance allocated withmemAlloc.static STBTTBitmap.Buffermalloc(int capacity, MemoryStack stack) Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStack.static STBTTBitmapmalloc(MemoryStack stack) Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStack.static intnh(long struct) Unsafe version ofh().static voidnh(long struct, int value) Unsafe version ofh.static ByteBuffernpixels(long struct, int capacity) Unsafe version ofpixels.static voidnpixels(long struct, ByteBuffer value) Unsafe version ofpixels.static intnstride(long struct) Unsafe version ofstride().static voidnstride(long struct, int value) Unsafe version ofstride.static intnw(long struct) Unsafe version ofw().static voidnw(long struct, int value) Unsafe version ofw.pixels(int capacity) pixels(ByteBuffer value) Sets the address of the specifiedByteBufferto thepixelsfield.set(int w, int h, int stride, ByteBuffer pixels) Initializes this struct with the specified values.set(STBTTBitmap src) Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).intstride()stride(int value) Sets the specified value to thestridefield.static voidvalidate(long struct) Validates pointer members that should not beNULL.intw()w(int value) Sets the specified value to thewfield.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
W
public static final int WThe struct member offsets. -
H
public static final int HThe struct member offsets. -
STRIDE
public static final int STRIDEThe struct member offsets. -
PIXELS
public static final int PIXELSThe struct member offsets.
-
-
Constructor Details
-
STBTTBitmap
Creates aSTBTTBitmapinstance 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 Details
-
sizeof
public int sizeof()Description copied from class:StructReturnssizeof(struct).- Specified by:
sizeofin classStruct<STBTTBitmap>
-
w
public int w()- Returns:
- the value of the
wfield.
-
h
public int h()- Returns:
- the value of the
hfield.
-
stride
public int stride()- Returns:
- the value of the
stridefield.
-
pixels
- Returns:
- a
ByteBufferview of the data pointed to by thepixelsfield.
-
w
Sets the specified value to thewfield. -
h
Sets the specified value to thehfield. -
stride
Sets the specified value to thestridefield. -
pixels
Sets the address of the specifiedByteBufferto thepixelsfield. -
set
Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newSTBTTBitmapinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newSTBTTBitmapinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newSTBTTBitmapinstance allocated withBufferUtils. -
create
Returns a newSTBTTBitmapinstance for the specified memory address. -
createSafe
-
malloc
Returns a newSTBTTBitmap.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newSTBTTBitmap.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newSTBTTBitmap.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aSTBTTBitmap.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nw
public static int nw(long struct) Unsafe version ofw(). -
nh
public static int nh(long struct) Unsafe version ofh(). -
nstride
public static int nstride(long struct) Unsafe version ofstride(). -
npixels
Unsafe version ofpixels. -
nw
public static void nw(long struct, int value) Unsafe version ofw. -
nh
public static void nh(long struct, int value) Unsafe version ofh. -
nstride
public static void nstride(long struct, int value) Unsafe version ofstride. -
npixels
Unsafe version ofpixels. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-