Record Class STBTT_PackRange
java.lang.Object
java.lang.Record
club.doki7.stb.truetype.datatype.STBTT_PackRange
- All Implemented Interfaces:
IPointer
,ISTBTT_PackRange
@ValueBasedCandidate
@UnsafeConstructor
public record STBTT_PackRange(@NotNull MemorySegment segment)
extends Record
implements ISTBTT_PackRange
Represents a pointer to a stbtt_pack_range
structure in native memory.
Structure
typedef struct stbtt_pack_range {
float fontSize
;
int firstUnicodeCodepointInRange
;
int* arrayOfUnicodeCodepoints
;
int numChars
;
stbtt_packedchar* chardataForRange
;
char hOversample
;
char vOversample
;
} stbtt_pack_range;
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 AddressLayout
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfFloat
static final ValueLayout.OfByte
static final ValueLayout.OfInt
static final ValueLayout.OfByte
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 long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSTBTT_PackRange
(@NotNull MemorySegment segment) Creates an instance of aSTBTT_PackRange
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic STBTT_PackRange
static STBTT_PackRange.Ptr
@Nullable IntPtr
Note: the returnedIntPtr
does not have correctIntPtr.size()
property.arrayOfUnicodeCodepoints
(@Nullable IntPtr value) @NotNull MemorySegment
void
arrayOfUnicodeCodepointsRaw
(@NotNull MemorySegment value) @Nullable STBTT_Packedchar
chardataForRange
(int assumedCount) chardataForRange
(@Nullable ISTBTT_Packedchar value) @NotNull MemorySegment
void
chardataForRangeRaw
(@NotNull MemorySegment value) static STBTT_PackRange
clone
(Arena arena, STBTT_PackRange src) final boolean
Indicates whether some other object is "equal to" this one.int
firstUnicodeCodepointInRange
(int value) float
fontSize()
fontSize
(float value) final int
hashCode()
Returns a hash code value for this object.byte
hOversample
(byte value) int
numChars()
numChars
(int value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.byte
vOversample
(byte value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$fontSize
-
PATH$firstUnicodeCodepointInRange
-
PATH$arrayOfUnicodeCodepoints
-
PATH$numChars
-
PATH$chardataForRange
-
PATH$hOversample
-
PATH$vOversample
-
LAYOUT$fontSize
-
LAYOUT$firstUnicodeCodepointInRange
-
LAYOUT$arrayOfUnicodeCodepoints
-
LAYOUT$numChars
-
LAYOUT$chardataForRange
-
LAYOUT$hOversample
-
LAYOUT$vOversample
-
SIZE$fontSize
public static final long SIZE$fontSize -
SIZE$firstUnicodeCodepointInRange
public static final long SIZE$firstUnicodeCodepointInRange -
SIZE$arrayOfUnicodeCodepoints
public static final long SIZE$arrayOfUnicodeCodepoints -
SIZE$numChars
public static final long SIZE$numChars -
SIZE$chardataForRange
public static final long SIZE$chardataForRange -
SIZE$hOversample
public static final long SIZE$hOversample -
SIZE$vOversample
public static final long SIZE$vOversample -
OFFSET$fontSize
public static final long OFFSET$fontSize -
OFFSET$firstUnicodeCodepointInRange
public static final long OFFSET$firstUnicodeCodepointInRange -
OFFSET$arrayOfUnicodeCodepoints
public static final long OFFSET$arrayOfUnicodeCodepoints -
OFFSET$numChars
public static final long OFFSET$numChars -
OFFSET$chardataForRange
public static final long OFFSET$chardataForRange -
OFFSET$hOversample
public static final long OFFSET$hOversample -
OFFSET$vOversample
public static final long OFFSET$vOversample
-
-
Constructor Details
-
STBTT_PackRange
Creates an instance of aSTBTT_PackRange
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
fontSize
public float fontSize() -
fontSize
-
firstUnicodeCodepointInRange
public int firstUnicodeCodepointInRange() -
firstUnicodeCodepointInRange
-
arrayOfUnicodeCodepoints
Note: the returnedIntPtr
does not have correctIntPtr.size()
property. It's up to user to track the size of the buffer, and useIntPtr.reinterpret(long)
to set the size before actually reading from or writing to the buffer. -
arrayOfUnicodeCodepoints
-
arrayOfUnicodeCodepointsRaw
-
arrayOfUnicodeCodepointsRaw
public void arrayOfUnicodeCodepointsRaw(@Pointer(comment="int32_t*") @NotNull @NotNull MemorySegment value) -
numChars
public int numChars() -
numChars
-
chardataForRange
-
chardataForRange
-
chardataForRange
-
chardataForRangeRaw
@Pointer(target=STBTT_Packedchar.class) @NotNull public @NotNull MemorySegment chardataForRangeRaw() -
chardataForRangeRaw
public void chardataForRangeRaw(@Pointer(target=STBTT_Packedchar.class) @NotNull @NotNull MemorySegment value) -
hOversample
public byte hOversample() -
hOversample
-
vOversample
public byte vOversample() -
vOversample
-
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.
-