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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final AddressLayoutstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfFloatstatic final ValueLayout.OfBytestatic final ValueLayout.OfIntstatic final ValueLayout.OfBytestatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSTBTT_PackRange(@NotNull MemorySegment segment) Creates an instance of aSTBTT_PackRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic STBTT_PackRangestatic STBTT_PackRange.Ptr@Nullable IntPtrNote: the returnedIntPtrdoes not have correctIntPtr.size()property.arrayOfUnicodeCodepoints(@Nullable IntPtr value) @NotNull MemorySegmentvoidarrayOfUnicodeCodepointsRaw(@NotNull MemorySegment value) @Nullable STBTT_PackedcharchardataForRange(int assumedCount) chardataForRange(@Nullable ISTBTT_Packedchar value) @NotNull MemorySegmentvoidchardataForRangeRaw(@NotNull MemorySegment value) static STBTT_PackRangeclone(Arena arena, STBTT_PackRange src) final booleanIndicates whether some other object is "equal to" this one.intfirstUnicodeCodepointInRange(int value) floatfontSize()fontSize(float value) final inthashCode()Returns a hash code value for this object.bytehOversample(byte value) intnumChars()numChars(int value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()Returns a string representation of this record class.bytevOversample(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_PackRangerecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
fontSize
public float fontSize() -
fontSize
-
firstUnicodeCodepointInRange
public int firstUnicodeCodepointInRange() -
firstUnicodeCodepointInRange
-
arrayOfUnicodeCodepoints
Note: the returnedIntPtrdoes 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 thesegmentrecord component.
-