Geometrize
import Geometrize
Module information
- Declarations
- 237
- Symbols
- 254
import Geometrize
let allShapeTypes: [Shape.Type]
func defaultAddShapePrecondition(lastScore: Double, newScore: Double, shape: any Shape, lines: [Scanline], color: Rgba, _: Bitmap, _: Bitmap, _: Bitmap) -> Bool
func defaultEnergyFunction(_ lines: [Scanline], _ alpha: UInt8, _ target: Bitmap, _ current: Bitmap, _ buffer: inout Bitmap, _ score: Double) -> Double
The default/built-in energy function that calculates a measure of the improvement adding the scanlines of a shape provides - lower energy is better.
func makeDefaultShapeCreator(types: [Shape.Type], strokeWidth: Double) -> ShapeCreator
Creates a function for creating instances of Shape. Returned instances should be set up!
protocol Shape : AnyObject, CustomStringConvertible
struct Bitmap
Helper for working with bitmap data. Pixels are ordered line by line, like arrays in C.
struct Bounds
final class Circle
final class Ellipse
struct ImageRunner
Helper for creating a set of primitives from a source image.
struct ImageRunnerOptions
Encapsulates preferences/options that the image runner uses.
struct ImageRunnerShapeBoundsOptions
Encapsulates options for where shapes may be drawn within the image. Defines a rectangle expressed as percentages (0-100%) of the target image dimensions
final class Line
struct Point<N> where N : Numeric
final class Polyline
final class QuadraticBezier
final class Rectangle
struct Rgba
Helper for manipulating RGBA8888 color data.
final class RotatedEllipse
final class RotatedRectangle
Represents a rotated rectangle.
struct SVGExporter
struct Scanline
Represents a scanline, a row of pixels running across a bitmap.
struct ShapeResult
Container for info about a shape added to the model.
struct SplitMix64
final class Triangle
typealias EnergyFunction = (_ lines: [Scanline], _ alpha: UInt8, _ target: Bitmap, _ curent: Bitmap, _ buffer: inout Bitmap, _ score: Double) -> Double
Type alias for a function that calculates a measure of the improvement adding the scanlines of a shape provides - lower energy is better.
typealias ShapeAcceptancePreconditionFunction = (_ lastScore: Double, _ newScore: Double, _ shape: any Shape, _ lines: [Scanline], _ color: Rgba, _ before: Bitmap, _ after: Bitmap, _ target: Bitmap) -> Bool
Type alias for a function that is used to decide whether or not to finally add a shape to the image.
typealias ShapeCreator = (inout SplitMix64) -> any Shape
import geometrize_cli