Package org.gnome.gsk
Class PathMeasure
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gsk.PathMeasure
- All Implemented Interfaces:
Proxy
Performs measurements on paths 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.
- Since:
- 4.14
-
Constructor Summary
ConstructorsConstructorDescriptionPathMeasure(MemorySegment address) Create a PathMeasure proxy instance for the provided memory address.PathMeasure(Path path) Creates a measure object for the givenpathwith the default tolerance. -
Method Summary
Modifier and TypeMethodDescriptionfloatGets the length of the path being measured.getPath()Returns the path that the measure was created for.booleanGets the point at the given distance into the path.floatReturns the tolerance that the measure was created with.static @Nullable TypegetType()Get the GType of the PathMeasure classref()Increases the reference count of aGskPathMeasureby one.voidunref()Decreases the reference count of aGskPathMeasureby one.static PathMeasurewithTolerance(Path path, float tolerance) Creates a measure object for the givenpathandtolerance.Methods inherited from class org.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 givenpathwith the default tolerance.- Parameters:
path- the path to measure- Since:
- 4.14
-
-
Method Details
-
getType
-
withTolerance
Creates a measure object for the givenpathandtolerance.- Parameters:
path- the path to measuretolerance- the tolerance for measuring operations- Returns:
- a new
GskPathMeasurerepresentingpath - Since:
- 4.14
-
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
- Since:
- 4.14
-
getPath
Returns the path that the measure was created for.- Returns:
- the path of this PathMeasure
- Since:
- 4.14
-
getPoint
Gets 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 point- Returns:
- true if
resultwas set - Since:
- 4.14
-
getTolerance
public float getTolerance()Returns the tolerance that the measure was created with.- Returns:
- the tolerance of this PathMeasure
- Since:
- 4.14
-
ref
Increases the reference count of aGskPathMeasureby one.- Returns:
- the passed in
GskPathMeasure. - Since:
- 4.14
-
unref
public void unref()Decreases the reference count of aGskPathMeasureby one.If the resulting reference count is zero, frees the object.
- Since:
- 4.14
-