Package org.lwjgl.util.spng
Class spng_sbit
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct spng_sbit {
uint8_t grayscale_bits;
uint8_t red_bits;
uint8_t green_bits;
uint8_t blue_bits;
uint8_t alpha_bits;
}-
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 member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionspng_sbit(ByteBuffer container) Creates aspng_sbitinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionbytealpha_bits(byte value) Sets the specified value to thealpha_bitsfield.byteblue_bits(byte value) Sets the specified value to theblue_bitsfield.static spng_sbitcalloc()Returns a newspng_sbitinstance allocated withmemCalloc.static spng_sbit.Buffercalloc(int capacity) Returns a newspng_sbit.Bufferinstance allocated withmemCalloc.static spng_sbit.Buffercalloc(int capacity, MemoryStack stack) Returns a newspng_sbit.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static spng_sbitcalloc(MemoryStack stack) Returns a newspng_sbitinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static spng_sbitcreate()Returns a newspng_sbitinstance allocated withBufferUtils.static spng_sbit.Buffercreate(int capacity) Returns a newspng_sbit.Bufferinstance allocated withBufferUtils.static spng_sbitcreate(long address) Returns a newspng_sbitinstance for the specified memory address.static spng_sbit.Buffercreate(long address, int capacity) Create aspng_sbit.Bufferinstance at the specified memory.static @Nullable spng_sbitcreateSafe(long address) static @Nullable spng_sbit.BuffercreateSafe(long address, int capacity) bytegrayscale_bits(byte value) Sets the specified value to thegrayscale_bitsfield.bytegreen_bits(byte value) Sets the specified value to thegreen_bitsfield.static spng_sbitmalloc()Returns a newspng_sbitinstance allocated withmemAlloc.static spng_sbit.Buffermalloc(int capacity) Returns a newspng_sbit.Bufferinstance allocated withmemAlloc.static spng_sbit.Buffermalloc(int capacity, MemoryStack stack) Returns a newspng_sbit.Bufferinstance allocated on the specifiedMemoryStack.static spng_sbitmalloc(MemoryStack stack) Returns a newspng_sbitinstance allocated on the specifiedMemoryStack.static bytenalpha_bits(long struct) Unsafe version ofalpha_bits().static voidnalpha_bits(long struct, byte value) Unsafe version ofalpha_bits.static bytenblue_bits(long struct) Unsafe version ofblue_bits().static voidnblue_bits(long struct, byte value) Unsafe version ofblue_bits.static bytengrayscale_bits(long struct) Unsafe version ofgrayscale_bits().static voidngrayscale_bits(long struct, byte value) Unsafe version ofgrayscale_bits.static bytengreen_bits(long struct) Unsafe version ofgreen_bits().static voidngreen_bits(long struct, byte value) Unsafe version ofgreen_bits.static bytenred_bits(long struct) Unsafe version ofred_bits().static voidnred_bits(long struct, byte value) Unsafe version ofred_bits.bytered_bits()red_bits(byte value) Sets the specified value to thered_bitsfield.set(byte grayscale_bits, byte red_bits, byte green_bits, byte blue_bits, byte alpha_bits) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).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. -
GRAYSCALE_BITS
public static final int GRAYSCALE_BITSThe struct member offsets. -
RED_BITS
public static final int RED_BITSThe struct member offsets. -
GREEN_BITS
public static final int GREEN_BITSThe struct member offsets. -
BLUE_BITS
public static final int BLUE_BITSThe struct member offsets. -
ALPHA_BITS
public static final int ALPHA_BITSThe struct member offsets.
-
-
Constructor Details
-
spng_sbit
Creates aspng_sbitinstance 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). -
grayscale_bits
public byte grayscale_bits()- Returns:
- the value of the
grayscale_bitsfield.
-
red_bits
public byte red_bits()- Returns:
- the value of the
red_bitsfield.
-
green_bits
public byte green_bits()- Returns:
- the value of the
green_bitsfield.
-
blue_bits
public byte blue_bits()- Returns:
- the value of the
blue_bitsfield.
-
alpha_bits
public byte alpha_bits()- Returns:
- the value of the
alpha_bitsfield.
-
grayscale_bits
Sets the specified value to thegrayscale_bitsfield. -
red_bits
Sets the specified value to thered_bitsfield. -
green_bits
Sets the specified value to thegreen_bitsfield. -
blue_bits
Sets the specified value to theblue_bitsfield. -
alpha_bits
Sets the specified value to thealpha_bitsfield. -
set
public spng_sbit set(byte grayscale_bits, byte red_bits, byte green_bits, byte blue_bits, byte alpha_bits) 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 newspng_sbitinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newspng_sbitinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newspng_sbitinstance allocated withBufferUtils. -
create
Returns a newspng_sbitinstance for the specified memory address. -
createSafe
-
malloc
Returns a newspng_sbit.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newspng_sbit.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newspng_sbit.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aspng_sbit.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newspng_sbitinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newspng_sbitinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newspng_sbit.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newspng_sbit.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
ngrayscale_bits
public static byte ngrayscale_bits(long struct) Unsafe version ofgrayscale_bits(). -
nred_bits
public static byte nred_bits(long struct) Unsafe version ofred_bits(). -
ngreen_bits
public static byte ngreen_bits(long struct) Unsafe version ofgreen_bits(). -
nblue_bits
public static byte nblue_bits(long struct) Unsafe version ofblue_bits(). -
nalpha_bits
public static byte nalpha_bits(long struct) Unsafe version ofalpha_bits(). -
ngrayscale_bits
public static void ngrayscale_bits(long struct, byte value) Unsafe version ofgrayscale_bits. -
nred_bits
public static void nred_bits(long struct, byte value) Unsafe version ofred_bits. -
ngreen_bits
public static void ngreen_bits(long struct, byte value) Unsafe version ofgreen_bits. -
nblue_bits
public static void nblue_bits(long struct, byte value) Unsafe version ofblue_bits. -
nalpha_bits
public static void nalpha_bits(long struct, byte value) Unsafe version ofalpha_bits.
-