Package org.gnome.graphene
Class Quad
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.graphene.Quad
- All Implemented Interfaces:
Proxy
A 4 vertex quadrilateral, as represented by four
graphene_point_t
.
The contents of a graphene_quad_t
are private and should never be
accessed directly.
-
Constructor Summary
ConstructorDescriptionQuad()
Allocate a new Quad.Allocate a new Quad.Quad
(MemorySegment address) Create a Quad proxy instance for the provided memory address.Allocate a new Quad with the fields set to the provided values.Allocate a new Quad with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic Quad
alloc()
Allocates a newgraphene_quad_t
instance.void
Computes the bounding rectangle of this Quad and places it intor
.boolean
Checks if the givengraphene_quad_t
contains the givengraphene_point_t
.void
free()
Frees the resources allocated by graphene_quad_alloc()static MemoryLayout
The memory layout of the native struct.getPoint
(int index) Retrieves the point of agraphene_quad_t
at the given index.static Type
getType()
Get the GType of the Quad classInitializes agraphene_quad_t
with the given points.initFromPoints
(Point[] points) Initializes agraphene_quad_t
using an array of points.initFromRect
(Rect r) Initializes agraphene_quad_t
using the four corners of the givengraphene_rect_t
.Point[]
Read the value of the fieldpoints
.void
writePoints
(Point[] points, Arena _arena) Write a value in the fieldpoints
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Quad
Create a Quad proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Quad
Allocate a new Quad.- Parameters:
arena
- to control the memory allocation scope
-
Quad
public Quad()Allocate a new Quad. The memory is allocated withArena.ofAuto()
. -
Quad
-
Quad
Allocate a new Quad with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
points
- value for the fieldpoints
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readPoints
Read the value of the fieldpoints
.- Returns:
- The value of the field
points
-
writePoints
-
alloc
Allocates a newgraphene_quad_t
instance.The contents of the returned instance are undefined.
- Returns:
- the newly created
graphene_quad_t
instance
-
bounds
Computes the bounding rectangle of this Quad and places it intor
.- Parameters:
r
- return location for agraphene_rect_t
-
contains
Checks if the givengraphene_quad_t
contains the givengraphene_point_t
.- Parameters:
p
- agraphene_point_t
- Returns:
true
if the point is inside thegraphene_quad_t
-
free
public void free()Frees the resources allocated by graphene_quad_alloc() -
getPoint
Retrieves the point of agraphene_quad_t
at the given index.- Parameters:
index
- the index of the point to retrieve- Returns:
- a
graphene_point_t
-
init
Initializes agraphene_quad_t
with the given points.- Parameters:
p1
- the first point of the quadrilateralp2
- the second point of the quadrilateralp3
- the third point of the quadrilateralp4
- the fourth point of the quadrilateral- Returns:
- the initialized
graphene_quad_t
-
initFromPoints
-
initFromRect
-