doodle.algebra.generic

Type members

Classlikes

sealed abstract
class BlendMode extends Product with Serializable
Companion
object
object BlendMode
Companion
class
final case
class DrawingContext(blendMode: BlendMode, strokeColor: Color, strokeWidth: Option[Double], strokeCap: Cap, strokeJoin: Join, strokeDash: Option[Array[Float]], fill: Option[Fill], font: Font)

Stores state about the current drawing style.

Stores state about the current drawing style.

Companion
object
Companion
class
sealed
trait Fill extends Product with Serializable
Companion
object
object Fill
Companion
class
object Finalized
implicit
class FinalizedOps[F[_], A](finalized: Finalized[F, A])
trait GenericDebug[F[_]] extends Debug[[_] =>> Finalized[F, _$2]]
trait GenericLayout[F[_]] extends Layout[[_] =>> Finalized[F, _$2]]
trait GenericPath[F[_]] extends Path[[_] =>> Finalized[F, _$2]]
trait GenericShape[F[_]] extends Shape[[_] =>> Finalized[F, _$2]]
trait GenericSize[F[_]] extends Size[[_] =>> Finalized[F, _$2]]

Get information about the size of the bounding box enclosing an picture.

Get information about the size of the bounding box enclosing an picture.

trait GenericStyle[F[_]] extends Style[[_] =>> Finalized[F, _$2]]
trait GenericText[F[_]] extends Text[[_] =>> Finalized[F, _$2]]
trait GenericTransform[F[_]] extends Transform[[_] =>> Finalized[F, _$2]]
trait GivenApply[F[_]]
trait GivenFunctor[F[_]]
object Renderable
final case
class Stroke(color: Color, width: Double, cap: Cap, join: Join, dash: Option[Array[Float]])

Types

type Finalized[F[_], A] = State[List[ContextTransform], (BoundingBox, Renderable[F, A])]

A Finalized represents an effect that, when run, produces all the information needed to layout an image (it "finalizes" all the information needed for this process) and can eventually produce a value of type A (once it is rendered). Algorithmically this means:

A Finalized represents an effect that, when run, produces all the information needed to layout an image (it "finalizes" all the information needed for this process) and can eventually produce a value of type A (once it is rendered). Algorithmically this means:

  • for each shape work out its DrawingContext from which we can work out a doodle.core.BoundingBox.

  • apply transforms to bounding boxes at the point they are defined so each transformed subtree is laid out in its local coordinate system.

The List of ContextTransform's are supplied in the order they should be applied: the innermost transform is at the head of the list.

type Renderable[F[_], A] = State[Transform, F[A]]

A Renderable represents some effect producing a value of type A and also creating a concrete implementation specific drawing.

A Renderable represents some effect producing a value of type A and also creating a concrete implementation specific drawing.

Invoking a Renderable does any layout (usually using bounding box information calculated in Finalized) and as such requires a doodle.core.Transform. Transforms should be applied outermost last. So any transformation in a Renderable should be applied before the trasform it receives from its surrounding context.

Implicits

Implicits

final implicit
def FinalizedOps[F[_], A](finalized: Finalized[F, A]): FinalizedOps[F, A]