Package org.lwjgl.stb
Class STBTTBitmap
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.stb.STBTTBitmap
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class STBTTBitmap extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Bitmap data.Member documentation
w
– the bitmap widthh
– the bitmap heightstride
– the row stride, in bytespixels
– the bitmap data
Layout
struct stbtt__bitmap { int w; int h; int stride; unsigned char * pixels; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
STBTTBitmap.Buffer
An array ofSTBTTBitmap
structs.
-
Constructor Summary
Constructors Constructor Description STBTTBitmap(java.nio.ByteBuffer container)
Creates aSTBTTBitmap
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 STBTTBitmap
calloc()
Returns a newSTBTTBitmap
instance allocated withmemCalloc
.static STBTTBitmap.Buffer
calloc(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated withmemCalloc
.static STBTTBitmap
callocStack()
Returns a newSTBTTBitmap
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBTTBitmap.Buffer
callocStack(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBTTBitmap.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBTTBitmap
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBTTBitmap
create()
Returns a newSTBTTBitmap
instance allocated withBufferUtils
.static STBTTBitmap.Buffer
create(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated withBufferUtils
.static STBTTBitmap
create(long address)
Returns a newSTBTTBitmap
instance for the specified memory address.static STBTTBitmap.Buffer
create(long address, int capacity)
Create aSTBTTBitmap.Buffer
instance at the specified memory.static STBTTBitmap
createSafe(long address)
static STBTTBitmap.Buffer
createSafe(long address, int capacity)
int
h()
Returns the value of theh
field.STBTTBitmap
h(int value)
Sets the specified value to theh
field.static STBTTBitmap
malloc()
Returns a newSTBTTBitmap
instance allocated withmemAlloc
.static STBTTBitmap.Buffer
malloc(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated withmemAlloc
.static STBTTBitmap
mallocStack()
Returns a newSTBTTBitmap
instance allocated on the thread-localMemoryStack
.static STBTTBitmap.Buffer
mallocStack(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated on the thread-localMemoryStack
.static STBTTBitmap.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap.Buffer
instance allocated on the specifiedMemoryStack
.static STBTTBitmap
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap
instance allocated on the specifiedMemoryStack
.static int
nh(long struct)
Unsafe version ofh()
.static void
nh(long struct, int value)
Unsafe version ofh
.static java.nio.ByteBuffer
npixels(long struct, int capacity)
Unsafe version ofpixels
.static void
npixels(long struct, java.nio.ByteBuffer value)
Unsafe version ofpixels
.static int
nstride(long struct)
Unsafe version ofstride()
.static void
nstride(long struct, int value)
Unsafe version ofstride
.static int
nw(long struct)
Unsafe version ofw()
.static void
nw(long struct, int value)
Unsafe version ofw
.java.nio.ByteBuffer
pixels(int capacity)
Returns aByteBuffer
view of the data pointed to by thepixels
field.STBTTBitmap
pixels(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thepixels
field.STBTTBitmap
set(int w, int h, int stride, java.nio.ByteBuffer pixels)
Initializes this struct with the specified values.STBTTBitmap
set(STBTTBitmap src)
Copies the specified struct data to this struct.int
sizeof()
int
stride()
Returns the value of thestride
field.STBTTBitmap
stride(int value)
Sets the specified value to thestride
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.int
w()
Returns the value of thew
field.STBTTBitmap
w(int value)
Sets the specified value to thew
field.
-
-
-
Constructor Detail
-
STBTTBitmap
public STBTTBitmap(java.nio.ByteBuffer container)
Creates aSTBTTBitmap
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
-
w
public int w()
Returns the value of thew
field.
-
h
public int h()
Returns the value of theh
field.
-
stride
public int stride()
Returns the value of thestride
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
-
w
public STBTTBitmap w(int value)
Sets the specified value to thew
field.
-
h
public STBTTBitmap h(int value)
Sets the specified value to theh
field.
-
stride
public STBTTBitmap stride(int value)
Sets the specified value to thestride
field.
-
pixels
public STBTTBitmap pixels(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thepixels
field.
-
set
public STBTTBitmap set(int w, int h, int stride, java.nio.ByteBuffer pixels)
Initializes this struct with the specified values.
-
set
public STBTTBitmap set(STBTTBitmap src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static STBTTBitmap malloc()
Returns a newSTBTTBitmap
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static STBTTBitmap calloc()
Returns a newSTBTTBitmap
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static STBTTBitmap create()
Returns a newSTBTTBitmap
instance allocated withBufferUtils
.
-
create
public static STBTTBitmap create(long address)
Returns a newSTBTTBitmap
instance for the specified memory address.
-
createSafe
@Nullable public static STBTTBitmap createSafe(long address)
-
malloc
public static STBTTBitmap.Buffer malloc(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static STBTTBitmap.Buffer calloc(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static STBTTBitmap.Buffer create(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static STBTTBitmap.Buffer create(long address, int capacity)
Create aSTBTTBitmap.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static STBTTBitmap.Buffer createSafe(long address, int capacity)
-
mallocStack
public static STBTTBitmap mallocStack()
Returns a newSTBTTBitmap
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static STBTTBitmap callocStack()
Returns a newSTBTTBitmap
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static STBTTBitmap mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static STBTTBitmap callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static STBTTBitmap.Buffer mallocStack(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static STBTTBitmap.Buffer callocStack(int capacity)
Returns a newSTBTTBitmap.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static STBTTBitmap.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static STBTTBitmap.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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
public static java.nio.ByteBuffer npixels(long struct, int capacity)
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
public static void npixels(long struct, java.nio.ByteBuffer value)
Unsafe version ofpixels
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-