Package org.gnome.gsk
Class PathMeasure
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gsk.PathMeasure
- All Implemented Interfaces:
Proxy
GskPathMeasure
is an object that allows measurements
on GskPath
s such as determining the length of the path.
Many measuring operations require sampling the path length
at intermediate points. Therefore, a GskPathMeasure
has
a tolerance that determines what precision is required
for such approximations.
A GskPathMeasure
struct is a reference counted struct
and should be treated as opaque.
-
Constructor Summary
ConstructorDescriptionPathMeasure
(MemorySegment address) Create a PathMeasure proxy instance for the provided memory address.PathMeasure
(Path path) Creates a measure object for the givenpath
with the default tolerance. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Gets the length of the path being measured.getPath()
Returns the path that the measure was created for.boolean
Setsresult
to the point at the given distance into the path.float
Returns the tolerance that the measure was created with.static Type
getType()
Get the GType of the PathMeasure classref()
Increases the reference count of aGskPathMeasure
by one.void
unref()
Decreases the reference count of aGskPathMeasure
by one.static PathMeasure
withTolerance
(Path path, float tolerance) Creates a measure object for the givenpath
andtolerance
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
PathMeasure
Create a PathMeasure proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
PathMeasure
Creates a measure object for the givenpath
with the default tolerance.- Parameters:
path
- the path to measure
-
-
Method Details
-
getType
-
withTolerance
Creates a measure object for the givenpath
andtolerance
.- Parameters:
path
- the path to measuretolerance
- the tolerance for measuring operations- Returns:
- a new
GskPathMeasure
representingpath
-
getLength
public float getLength()Gets the length of the path being measured.The length is cached, so this function does not do any work.
- Returns:
- The length of the path measured by this PathMeasure
-
getPath
Returns the path that the measure was created for.- Returns:
- the path of this PathMeasure
-
getPoint
Setsresult
to the point at the given distance into the path.An empty path has no points, so
FALSE
is returned in that case.- Parameters:
distance
- the distanceresult
- return location for the result- Returns:
TRUE
ifresult
was set
-
getTolerance
public float getTolerance()Returns the tolerance that the measure was created with.- Returns:
- the tolerance of this PathMeasure
-
ref
Increases the reference count of aGskPathMeasure
by one.- Returns:
- the passed in
GskPathMeasure
.
-
unref
public void unref()Decreases the reference count of aGskPathMeasure
by one.If the resulting reference count is zero, frees the object.
-