All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.nacular.doodle.geometry.PathMetrics.kt Maven / Gradle / Ivy

There is a newer version: 0.10.4
Show newest version
package io.nacular.doodle.geometry

/**
 * Provides a mechanism to measure the size of a [Path].
 */
public interface PathMetrics {
    /**
     * @param path to measure
     * @return the bounding width of the path
     */
    // TODO: Add support for Stroke
    public fun width(path: Path): Double

    /**
     * @param path to measure
     * @return the bounding height of the path
     */
    // TODO: Add support for Stroke
    public fun height(path: Path): Double

    /**
     * @param path to measure
     * @return the bounding size of the path
     */
    // TODO: Add support for Stroke
    public fun size(path: Path): Size

    /**
     * @param path to measure
     * @return the bounding rectangle of the path
     */
    // TODO: Add support for Stroke
    public fun bounds(path: Path): Rectangle

    /**
     * @param path to measure
     * @param stroke the path will have
     * @return the the linear length of a path (i.e. the perimeter for a circle)
     */
    // TODO: Add support for Stroke
    public fun length(path: Path): Double
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy