SkikoPathIterator



Summary

Public constructors

SkikoPathIterator(
    path: Path,
    conicEvaluation: PathIterator.ConicEvaluation,
    tolerance: Float
)
android

Public functions

open Int
calculateSize(includeConvertedConics: Boolean)

Returns the number of verbs present in this iterator, i.e. the number of calls to next required to complete the iteration.

android
open operator Boolean

Returns true if the iteration has more elements.

android
open operator PathSegment

Returns the next path segment in the iteration, or DoneSegment if the iteration is finished.

android
open PathSegment.Type
next(outPoints: FloatArray, offset: Int)

Returns the type of the next path segment in the iteration and fills outPoints with the points specific to the segment type.

android

Public properties

open PathIterator.ConicEvaluation

Indicates whether conic segments, when present, are preserved as-is or converted to quadratic segments, using an approximation whose error is controlled by tolerance.

android
open Path

The Path this iterator iterates on.

android
open Float

Error of the approximation used to evaluate conic segments if they are converted to quadratics.

android

Public constructors

SkikoPathIterator

SkikoPathIterator(
    path: Path,
    conicEvaluation: PathIterator.ConicEvaluation,
    tolerance: Float
)

Public functions

calculateSize

open fun calculateSize(includeConvertedConics: Boolean): Int

Returns the number of verbs present in this iterator, i.e. the number of calls to next required to complete the iteration.

By default, calculateSize returns the true number of operations in the iterator. Deriving this result requires converting any conics to quadratics, if conicEvaluation is set to ConicEvaluation.AsQuadratics, which takes extra processing time. Set includeConvertedConics to false if an approximate size, not including conic conversion, is sufficient.

Parameters
includeConvertedConics: Boolean

The returned size includes any required conic conversions. Default is true, so it will return the exact size, at the cost of iterating through all elements and converting any conics as appropriate. Set to false to save on processing, at the cost of a less exact result.

hasNext

open operator fun hasNext(): Boolean

Returns true if the iteration has more elements.

next

open operator fun next(): PathSegment

Returns the next path segment in the iteration, or DoneSegment if the iteration is finished. To save on allocations, use the alternative next function, which takes a FloatArray.

next

open fun next(outPoints: FloatArray, offset: Int): PathSegment.Type

Returns the type of the next path segment in the iteration and fills outPoints with the points specific to the segment type. Each pair of floats in the outPoints array represents a point for the given segment. The number of pairs of floats depends on the PathSegment.Type:

This method does not allocate any memory.

Parameters
outPoints: FloatArray

A FloatArray large enough to hold 8 floats starting at offset, throws an IllegalStateException otherwise.

offset: Int

Offset in outPoints where to store the result

Public properties

conicEvaluation

open val conicEvaluationPathIterator.ConicEvaluation

Indicates whether conic segments, when present, are preserved as-is or converted to quadratic segments, using an approximation whose error is controlled by tolerance.

path

open val pathPath

The Path this iterator iterates on.

tolerance

open val toleranceFloat

Error of the approximation used to evaluate conic segments if they are converted to quadratics. The error is defined as the maximum distance between the original conic segment and its quadratic approximation. See conicEvaluation.