Package org.gnome.graphene
Class Quad
java.lang.Object
org.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.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionQuad()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 Quadalloc()Allocates a newgraphene_quad_tinstance.voidComputes the bounding rectangle of this Quad and places it intor.booleanChecks if the givengraphene_quad_tcontains the givengraphene_point_t.voidfree()Frees the resources allocated by graphene_quad_alloc()static MemoryLayoutThe memory layout of the native struct.getPoint(int index) Retrieves the point of agraphene_quad_tat the given index.static @Nullable TypegetType()Get the GType of the Quad classInitializes agraphene_quad_twith the given points.initFromPoints(@Nullable Point @Nullable [] points) Initializes agraphene_quad_tusing an array of points.initFromRect(Rect r) Initializes agraphene_quad_tusing the four corners of the givengraphene_rect_t.@Nullable Point @Nullable []Read the value of the fieldpoints.voidwritePoints(@Nullable Point @Nullable [] points, Arena _arena) Write a value in the fieldpoints.Methods inherited from class org.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_tinstance.The contents of the returned instance are undefined.
- Returns:
- the newly created
graphene_quad_tinstance - Since:
- 1.0
-
bounds
Computes the bounding rectangle of this Quad and places it intor.- Parameters:
r- return location for agraphene_rect_t- Since:
- 1.0
-
contains
Checks if the givengraphene_quad_tcontains the givengraphene_point_t.- Parameters:
p- agraphene_point_t- Returns:
trueif the point is inside thegraphene_quad_t- Since:
- 1.0
-
free
public void free()Frees the resources allocated by graphene_quad_alloc()- Since:
- 1.0
-
getPoint
Retrieves the point of agraphene_quad_tat the given index.- Parameters:
index- the index of the point to retrieve- Returns:
- a
graphene_point_t - Since:
- 1.0
-
init
Initializes agraphene_quad_twith 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 - Since:
- 1.0
-
initFromPoints
Initializes agraphene_quad_tusing an array of points.- Parameters:
points- an array of 4graphene_point_t- Returns:
- the initialized
graphene_quad_t - Throws:
IllegalArgumentException- when length ofpointsis less than 4- Since:
- 1.2
-
initFromRect
-