Record Class STBTT_PackContext
java.lang.Object
java.lang.Record
club.doki7.stb.truetype.datatype.STBTT_PackContext
- All Implemented Interfaces:
IPointer
,ISTBTT_PackContext
@ValueBasedCandidate
@UnsafeConstructor
public record STBTT_PackContext(@NotNull MemorySegment segment)
extends Record
implements ISTBTT_PackContext
Represents a pointer to a stbtt_pack_context
structure in native memory.
Structure
typedef struct stbtt_pack_context {
void* userAllocatorContext
;
void* packInfo
;
int width
;
int height
;
int strideInBytes
;
int padding
;
int skipMissing
;
int hOversample
;
int vOversample
;
char* pixels
;
void* nodes
;
} stbtt_pack_context;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final AddressLayout
static final AddressLayout
static final ValueLayout.OfInt
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSTBTT_PackContext
(@NotNull MemorySegment segment) Creates an instance of aSTBTT_PackContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic STBTT_PackContext
static STBTT_PackContext.Ptr
static STBTT_PackContext
clone
(Arena arena, STBTT_PackContext src) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
height()
height
(int value) int
hOversample
(int value) @NotNull MemorySegment
nodes()
nodes
(@NotNull MemorySegment value) @NotNull MemorySegment
packInfo()
packInfo
(@NotNull MemorySegment value) int
padding()
padding
(int value) @Nullable BytePtr
pixels()
Note: the returnedBytePtr
does not have correctBytePtr.size()
property.@NotNull MemorySegment
void
pixelsRaw
(@NotNull MemorySegment value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.int
skipMissing
(int value) int
strideInBytes
(int value) final String
toString()
Returns a string representation of this record class.@NotNull MemorySegment
userAllocatorContext
(@Nullable IPointer pointer) userAllocatorContext
(@NotNull MemorySegment value) int
vOversample
(int value) int
width()
width
(int value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$userAllocatorContext
-
PATH$packInfo
-
PATH$width
-
PATH$height
-
PATH$strideInBytes
-
PATH$padding
-
PATH$skipMissing
-
PATH$hOversample
-
PATH$vOversample
-
PATH$pixels
-
PATH$nodes
-
LAYOUT$userAllocatorContext
-
LAYOUT$packInfo
-
LAYOUT$width
-
LAYOUT$height
-
LAYOUT$strideInBytes
-
LAYOUT$padding
-
LAYOUT$skipMissing
-
LAYOUT$hOversample
-
LAYOUT$vOversample
-
LAYOUT$pixels
-
LAYOUT$nodes
-
SIZE$userAllocatorContext
public static final long SIZE$userAllocatorContext -
SIZE$packInfo
public static final long SIZE$packInfo -
SIZE$width
public static final long SIZE$width -
SIZE$height
public static final long SIZE$height -
SIZE$strideInBytes
public static final long SIZE$strideInBytes -
SIZE$padding
public static final long SIZE$padding -
SIZE$skipMissing
public static final long SIZE$skipMissing -
SIZE$hOversample
public static final long SIZE$hOversample -
SIZE$vOversample
public static final long SIZE$vOversample -
SIZE$pixels
public static final long SIZE$pixels -
SIZE$nodes
public static final long SIZE$nodes -
OFFSET$userAllocatorContext
public static final long OFFSET$userAllocatorContext -
OFFSET$packInfo
public static final long OFFSET$packInfo -
OFFSET$width
public static final long OFFSET$width -
OFFSET$height
public static final long OFFSET$height -
OFFSET$strideInBytes
public static final long OFFSET$strideInBytes -
OFFSET$padding
public static final long OFFSET$padding -
OFFSET$skipMissing
public static final long OFFSET$skipMissing -
OFFSET$hOversample
public static final long OFFSET$hOversample -
OFFSET$vOversample
public static final long OFFSET$vOversample -
OFFSET$pixels
public static final long OFFSET$pixels -
OFFSET$nodes
public static final long OFFSET$nodes
-
-
Constructor Details
-
STBTT_PackContext
Creates an instance of aSTBTT_PackContext
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
userAllocatorContext
-
userAllocatorContext
public STBTT_PackContext userAllocatorContext(@Pointer(comment="void*") @NotNull @NotNull MemorySegment value) -
userAllocatorContext
-
packInfo
-
packInfo
-
packInfo
-
width
public int width() -
width
-
height
public int height() -
height
-
strideInBytes
public int strideInBytes() -
strideInBytes
-
padding
public int padding() -
padding
-
skipMissing
public int skipMissing() -
skipMissing
-
hOversample
public int hOversample() -
hOversample
-
vOversample
public int vOversample() -
vOversample
-
pixels
Note: the returnedBytePtr
does not have correctBytePtr.size()
property. It's up to user to track the size of the buffer, and useBytePtr.reinterpret(long)
to set the size before actually reading from or writing to the buffer. -
pixels
-
pixelsRaw
-
pixelsRaw
-
nodes
-
nodes
-
nodes
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-