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.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The 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_sbit
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionbyte
alpha_bits
(byte value) Sets the specified value to thealpha_bits
field.byte
blue_bits
(byte value) Sets the specified value to theblue_bits
field.static spng_sbit
calloc()
Returns a newspng_sbit
instance allocated withmemCalloc
.static spng_sbit.Buffer
calloc
(int capacity) Returns a newspng_sbit.Buffer
instance allocated withmemCalloc
.static spng_sbit.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newspng_sbit.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static spng_sbit
calloc
(MemoryStack stack) Returns a newspng_sbit
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static spng_sbit
create()
Returns a newspng_sbit
instance allocated withBufferUtils
.static spng_sbit.Buffer
create
(int capacity) Returns a newspng_sbit.Buffer
instance allocated withBufferUtils
.static spng_sbit
create
(long address) Returns a newspng_sbit
instance for the specified memory address.static spng_sbit.Buffer
create
(long address, int capacity) Create aspng_sbit.Buffer
instance at the specified memory.static @Nullable spng_sbit
createSafe
(long address) static @Nullable spng_sbit.Buffer
createSafe
(long address, int capacity) byte
grayscale_bits
(byte value) Sets the specified value to thegrayscale_bits
field.byte
green_bits
(byte value) Sets the specified value to thegreen_bits
field.static spng_sbit
malloc()
Returns a newspng_sbit
instance allocated withmemAlloc
.static spng_sbit.Buffer
malloc
(int capacity) Returns a newspng_sbit.Buffer
instance allocated withmemAlloc
.static spng_sbit.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newspng_sbit.Buffer
instance allocated on the specifiedMemoryStack
.static spng_sbit
malloc
(MemoryStack stack) Returns a newspng_sbit
instance allocated on the specifiedMemoryStack
.static byte
nalpha_bits
(long struct) Unsafe version ofalpha_bits()
.static void
nalpha_bits
(long struct, byte value) Unsafe version ofalpha_bits
.static byte
nblue_bits
(long struct) Unsafe version ofblue_bits()
.static void
nblue_bits
(long struct, byte value) Unsafe version ofblue_bits
.static byte
ngrayscale_bits
(long struct) Unsafe version ofgrayscale_bits()
.static void
ngrayscale_bits
(long struct, byte value) Unsafe version ofgrayscale_bits
.static byte
ngreen_bits
(long struct) Unsafe version ofgreen_bits()
.static void
ngreen_bits
(long struct, byte value) Unsafe version ofgreen_bits
.static byte
nred_bits
(long struct) Unsafe version ofred_bits()
.static void
nred_bits
(long struct, byte value) Unsafe version ofred_bits
.byte
red_bits()
red_bits
(byte value) Sets the specified value to thered_bits
field.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.int
sizeof()
Returnssizeof(struct)
.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods 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_sbit
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 Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
. -
grayscale_bits
public byte grayscale_bits()- Returns:
- the value of the
grayscale_bits
field.
-
red_bits
public byte red_bits()- Returns:
- the value of the
red_bits
field.
-
green_bits
public byte green_bits()- Returns:
- the value of the
green_bits
field.
-
blue_bits
public byte blue_bits()- Returns:
- the value of the
blue_bits
field.
-
alpha_bits
public byte alpha_bits()- Returns:
- the value of the
alpha_bits
field.
-
grayscale_bits
Sets the specified value to thegrayscale_bits
field. -
red_bits
Sets the specified value to thered_bits
field. -
green_bits
Sets the specified value to thegreen_bits
field. -
blue_bits
Sets the specified value to theblue_bits
field. -
alpha_bits
Sets the specified value to thealpha_bits
field. -
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_sbit
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newspng_sbit
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newspng_sbit
instance allocated withBufferUtils
. -
create
Returns a newspng_sbit
instance for the specified memory address. -
createSafe
-
malloc
Returns a newspng_sbit.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newspng_sbit.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newspng_sbit.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aspng_sbit.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
malloc
Returns a newspng_sbit
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newspng_sbit
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newspng_sbit.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newspng_sbit.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-