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.NativeResourceBitmap data.Layout
struct stbtt__bitmap { intw(); inth(); intstride(); unsigned char *pixels(int); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSTBTTBitmap.BufferAn array ofSTBTTBitmapstructs.
-
Constructor Summary
Constructors Constructor Description STBTTBitmap(java.nio.ByteBuffer container)Creates aSTBTTBitmapinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static STBTTBitmapcalloc()Returns a newSTBTTBitmapinstance allocated withmemCalloc.static STBTTBitmap.Buffercalloc(int capacity)Returns a newSTBTTBitmap.Bufferinstance allocated withmemCalloc.static STBTTBitmap.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBTTBitmapcalloc(org.lwjgl.system.MemoryStack stack)Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBTTBitmapcallocStack()Deprecated.static STBTTBitmap.BuffercallocStack(int capacity)Deprecated.static STBTTBitmap.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static STBTTBitmapcallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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 STBTTBitmapcreateSafe(long address)static STBTTBitmap.BuffercreateSafe(long address, int capacity)inth()the bitmap heightSTBTTBitmaph(int value)Sets the specified value to theh()field.static STBTTBitmapmalloc()Returns a newSTBTTBitmapinstance allocated withmemAlloc.static STBTTBitmap.Buffermalloc(int capacity)Returns a newSTBTTBitmap.Bufferinstance allocated withmemAlloc.static STBTTBitmap.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStack.static STBTTBitmapmalloc(org.lwjgl.system.MemoryStack stack)Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStack.static STBTTBitmapmallocStack()Deprecated.static STBTTBitmap.BuffermallocStack(int capacity)Deprecated.static STBTTBitmap.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static STBTTBitmapmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static intnh(long struct)Unsafe version ofh().static voidnh(long struct, int value)Unsafe version ofh.static java.nio.ByteBuffernpixels(long struct, int capacity)Unsafe version ofpixels.static voidnpixels(long struct, java.nio.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.java.nio.ByteBufferpixels(int capacity)STBTTBitmappixels(java.nio.ByteBuffer value)Sets the address of the specifiedByteBufferto thepixels(int)field.STBTTBitmapset(int w, int h, int stride, java.nio.ByteBuffer pixels)Initializes this struct with the specified values.STBTTBitmapset(STBTTBitmap src)Copies the specified struct data to this struct.intsizeof()intstride()the row stride, in bytesSTBTTBitmapstride(int value)Sets the specified value to thestride()field.static voidvalidate(long struct)Validates pointer members that should not beNULL.intw()the bitmap widthSTBTTBitmapw(int value)Sets the specified value to thew()field.
-
-
-
Constructor Detail
-
STBTTBitmap
public STBTTBitmap(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
w
public int w()
the bitmap width
-
h
public int h()
the bitmap height
-
stride
public int stride()
the row stride, in bytes
-
pixels
public java.nio.ByteBuffer pixels(int capacity)
- Parameters:
capacity- the number of elements in the returned buffer- Returns:
- the bitmap data
-
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 specifiedByteBufferto thepixels(int)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 newSTBTTBitmapinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static STBTTBitmap calloc()
Returns a newSTBTTBitmapinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static STBTTBitmap create()
Returns a newSTBTTBitmapinstance allocated withBufferUtils.
-
create
public static STBTTBitmap create(long address)
Returns a newSTBTTBitmapinstance for the specified memory address.
-
createSafe
@Nullable public static STBTTBitmap createSafe(long address)
-
malloc
public static STBTTBitmap.Buffer malloc(int capacity)
Returns a newSTBTTBitmap.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static STBTTBitmap.Buffer calloc(int capacity)
Returns a newSTBTTBitmap.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static STBTTBitmap.Buffer create(int capacity)
Returns a newSTBTTBitmap.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static STBTTBitmap.Buffer create(long address, int capacity)
Create aSTBTTBitmap.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static STBTTBitmap.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static STBTTBitmap mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static STBTTBitmap callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static STBTTBitmap mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static STBTTBitmap callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static STBTTBitmap.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static STBTTBitmap.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static STBTTBitmap.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static STBTTBitmap.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static STBTTBitmap malloc(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static STBTTBitmap calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmapinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static STBTTBitmap.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static STBTTBitmap.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBTTBitmap.Bufferinstance allocated on the specifiedMemoryStackand 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
-
-