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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final longstatic final longstatic final longstatic final longstatic 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 MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSTBTT_PackContext(@NotNull MemorySegment segment) Creates an instance of aSTBTT_PackContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic STBTT_PackContextstatic STBTT_PackContext.Ptrstatic STBTT_PackContextclone(Arena arena, STBTT_PackContext src) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()height(int value) inthOversample(int value) @NotNull MemorySegmentnodes()nodes(@NotNull MemorySegment value) @NotNull MemorySegmentpackInfo()packInfo(@NotNull MemorySegment value) intpadding()padding(int value) @Nullable BytePtrpixels()Note: the returnedBytePtrdoes not have correctBytePtr.size()property.@NotNull MemorySegmentvoidpixelsRaw(@NotNull MemorySegment value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.intskipMissing(int value) intstrideInBytes(int value) final StringtoString()Returns a string representation of this record class.@NotNull MemorySegmentuserAllocatorContext(@Nullable IPointer pointer) userAllocatorContext(@NotNull MemorySegment value) intvOversample(int value) intwidth()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_PackContextrecord class.- Parameters:
segment- the value for thesegmentrecord 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 returnedBytePtrdoes 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 thesegmentrecord component.
-