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.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$fontSize

      public static final MemoryLayout.PathElement PATH$fontSize
    • PATH$firstUnicodeCodepointInRange

      public static final MemoryLayout.PathElement PATH$firstUnicodeCodepointInRange
    • PATH$arrayOfUnicodeCodepoints

      public static final MemoryLayout.PathElement PATH$arrayOfUnicodeCodepoints
    • PATH$numChars

      public static final MemoryLayout.PathElement PATH$numChars
    • PATH$chardataForRange

      public static final MemoryLayout.PathElement PATH$chardataForRange
    • PATH$hOversample

      public static final MemoryLayout.PathElement PATH$hOversample
    • PATH$vOversample

      public static final MemoryLayout.PathElement PATH$vOversample
    • LAYOUT$fontSize

      public static final ValueLayout.OfFloat LAYOUT$fontSize
    • LAYOUT$firstUnicodeCodepointInRange

      public static final ValueLayout.OfInt LAYOUT$firstUnicodeCodepointInRange
    • LAYOUT$arrayOfUnicodeCodepoints

      public static final AddressLayout LAYOUT$arrayOfUnicodeCodepoints
    • LAYOUT$numChars

      public static final ValueLayout.OfInt LAYOUT$numChars
    • LAYOUT$chardataForRange

      public static final AddressLayout LAYOUT$chardataForRange
    • LAYOUT$hOversample

      public static final ValueLayout.OfByte LAYOUT$hOversample
    • LAYOUT$vOversample

      public static final ValueLayout.OfByte 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

      public STBTT_PackRange(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a STBTT_PackRange record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details

    • allocate

      public static STBTT_PackRange allocate(Arena arena)
    • allocate

      public static STBTT_PackRange.Ptr allocate(Arena arena, long count)
    • clone

      public static STBTT_PackRange clone(Arena arena, STBTT_PackRange src)
    • fontSize

      public float fontSize()
    • fontSize

      public STBTT_PackRange fontSize(float value)
    • firstUnicodeCodepointInRange

      public int firstUnicodeCodepointInRange()
    • firstUnicodeCodepointInRange

      public STBTT_PackRange firstUnicodeCodepointInRange(int value)
    • arrayOfUnicodeCodepoints

      @Nullable public @Nullable IntPtr arrayOfUnicodeCodepoints()
      Note: the returned IntPtr does not have correct IntPtr.size() property. It's up to user to track the size of the buffer, and use IntPtr.reinterpret(long) to set the size before actually reading from or writing to the buffer.
    • arrayOfUnicodeCodepoints

      public STBTT_PackRange arrayOfUnicodeCodepoints(@Nullable @Nullable IntPtr value)
    • arrayOfUnicodeCodepointsRaw

      @Pointer(comment="int32_t*") @NotNull public @NotNull MemorySegment arrayOfUnicodeCodepointsRaw()
    • arrayOfUnicodeCodepointsRaw

      public void arrayOfUnicodeCodepointsRaw(@Pointer(comment="int32_t*") @NotNull @NotNull MemorySegment value)
    • numChars

      public int numChars()
    • numChars

      public STBTT_PackRange numChars(int value)
    • chardataForRange

      public STBTT_PackRange chardataForRange(@Nullable @Nullable ISTBTT_Packedchar value)
    • chardataForRange

      @Unsafe @Nullable public STBTT_Packedchar.Ptr chardataForRange(int assumedCount)
    • chardataForRange

      @Nullable public @Nullable STBTT_Packedchar 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

      public STBTT_PackRange hOversample(byte value)
    • vOversample

      public byte vOversample()
    • vOversample

      public STBTT_PackRange vOversample(byte value)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • segment

      @NotNull public @NotNull MemorySegment segment()
      Returns the value of the segment record component.
      Specified by:
      segment in interface IPointer
      Returns:
      the value of the segment record component