final case class Algebra(gc: Graphics2D, applyDrawing: Apply[Reification] = Apply.apply[Reification], functorDrawing: Functor[Reification] = Apply.apply[Reification]) extends Basic with Java2dFromBufferedImage with Java2dFromBase64 with ReifiedBitmap with ReifiedPath with ReifiedShape with ReifiedText with GenericDebug[Reification] with GenericLayout[Reification] with GenericSize[Reification] with GenericStyle[Reification] with GenericTransform[Reification] with GivenApply[Reification] with GivenFunctor[Reification] with algebra.Algebra with Product with Serializable
- Source
- Algebra.scala
- Alphabetic
- By Inheritance
- Algebra
- Serializable
- Product
- Equals
- GivenFunctor
- GivenApply
- GenericTransform
- GenericStyle
- GenericSize
- GenericLayout
- GenericDebug
- ReifiedText
- GenericText
- ReifiedShape
- GenericShape
- ReifiedPath
- GenericPath
- ReifiedBitmap
- Bitmap
- Java2dFromBase64
- FromJpgBase64
- FromGifBase64
- FromPngBase64
- Java2dFromBufferedImage
- FromBufferedImage
- Basic
- Transform
- Text
- Style
- Size
- Shape
- Path
- Layout
- Debug
- Algebra
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Algebra(gc: Graphics2D, applyDrawing: Apply[Reification] = Apply.apply[Reification], functorDrawing: Functor[Reification] = Apply.apply[Reification])
Type Members
- trait PathApi extends AnyRef
- Definition Classes
- GenericPath
- trait ShapeApi extends AnyRef
- Definition Classes
- GenericShape
- trait TextApi extends AnyRef
- Definition Classes
- GenericText
- type Drawing[A] = IndexedStateT[Eval, List[ContextTransform], List[ContextTransform], (BoundingBox, algebra.generic.Renderable[Reification, A])]
The effect type that methods on this algebra produce.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val TextApi: TextApi { type Bounds = java.awt.geom.Rectangle2D }
- Definition Classes
- ReifiedText → GenericText
- def above[A](top: Finalized[Reification, A], bottom: Finalized[Reification, A])(implicit s: Semigroup[A]): Finalized[Reification, A]
- Definition Classes
- GenericLayout → Layout
- val applyDrawing: Apply[Reification]
- Definition Classes
- Algebra → GivenApply
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def at[A](img: Finalized[Reification, A], landmark: Landmark): Finalized[Reification, A]
Displace img by the given landmark relative to the origin, expanding the bounding box if necessary to include the relocated image.
Displace img by the given landmark relative to the origin, expanding the bounding box if necessary to include the relocated image.
- Definition Classes
- GenericLayout → Layout
- def at[A](img: Drawing[A], offset: Point): Drawing[A]
- Definition Classes
- Layout
- def at[A](img: Drawing[A], offset: Vec): Drawing[A]
- Definition Classes
- Layout
- def at[A](img: Drawing[A], r: Double, a: Angle): Drawing[A]
- Definition Classes
- Layout
- def at[A](img: Drawing[A], x: Double, y: Double): Drawing[A]
- Definition Classes
- Layout
- def below[A](bottom: Drawing[A], top: Drawing[A])(implicit s: Semigroup[A]): Drawing[A]
- Definition Classes
- Layout
- def beside[A](left: Finalized[Reification, A], right: Finalized[Reification, A])(implicit s: Semigroup[A]): Finalized[Reification, A]
- Definition Classes
- GenericLayout → Layout
- def boundingBox[A](picture: Finalized[Reification, A]): Finalized[Reification, BoundingBox]
Get the bounding box enclosing the picture
Get the bounding box enclosing the picture
- Definition Classes
- GenericSize → Size
- def boundingBox(elements: List[PathElement]): BoundingBox
- Definition Classes
- GenericPath
- def catmulRom(points: Seq[Point], tension: Double = 0.5): Drawing[Unit]
- Definition Classes
- Path
- def circle(diameter: Double): Finalized[Reification, Unit]
A circle with the given diameter.
A circle with the given diameter. We use diamter rather than radius so circle(100) has the same size as square(100)
- Definition Classes
- GenericShape → Shape
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def debug[A](picture: Finalized[Reification, A], color: Color = Color.crimson): Finalized[Reification, A]
Draws the bounding box and origin of the given picture on top of the picture.
Draws the bounding box and origin of the given picture on top of the picture. The given color is used for the bounding box and origin.
The bounding box and origin are not included in layout calculations and hence will not affect the picture's layout.
- Definition Classes
- GenericDebug → Debug
- implicit val drawingInstance: Applicative[Drawing]
- def empty: Finalized[Reification, Unit]
The empty shape, which is no shape at all.
The empty shape, which is no shape at all.
- Definition Classes
- GenericShape → Shape
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equilateralTriangle(width: Double): Drawing[Unit]
Create an equilateral triangle with the given side length.
Create an equilateral triangle with the given side length.
- Definition Classes
- Path
- def fillColor[A](image: Finalized[Reification, A], fillColor: Color): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def fillGradient[A](image: Finalized[Reification, A], fillGradient: Gradient): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def font[A](image: Finalized[Reification, A], font: Font): Finalized[Reification, A]
Specifies the font to use when rendering text
Specifies the font to use when rendering text
- Definition Classes
- GenericText → Text
- def fromBufferedImage(in: BufferedImage): Algebra.Drawing[Unit]
- Definition Classes
- Java2dFromBufferedImage → FromBufferedImage
- def fromGifBase64(base64: Base64[Gif]): Algebra.Drawing[Unit]
Create a picture from a Base64 encoded bitmap in the given format.
Create a picture from a Base64 encoded bitmap in the given format. The format is reified as a value so the method can dispatch on it.
- Definition Classes
- Java2dFromBase64 → FromGifBase64
- def fromJpgBase64(base64: Base64[Jpg]): Algebra.Drawing[Unit]
Create a picture from a Base64 encoded bitmap in the given format.
Create a picture from a Base64 encoded bitmap in the given format. The format is reified as a value so the method can dispatch on it.
- Definition Classes
- Java2dFromBase64 → FromJpgBase64
- def fromPngBase64(base64: Base64[Png]): Algebra.Drawing[Unit]
Create a picture from a Base64 encoded bitmap in the given format.
Create a picture from a Base64 encoded bitmap in the given format. The format is reified as a value so the method can dispatch on it.
- Definition Classes
- Java2dFromBase64 → FromPngBase64
- val functorDrawing: Functor[Reification]
- Definition Classes
- Algebra → GivenFunctor
- val gc: Graphics2D
- def genericFromBase64(value: String): Algebra.Drawing[Unit]
- Definition Classes
- Java2dFromBase64
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def height[A](picture: Finalized[Reification, A]): Finalized[Reification, Double]
Get the height of the bounding box enclosing the picture
Get the height of the bounding box enclosing the picture
- Definition Classes
- GenericSize → Size
- def horizontalReflection[A](img: Drawing[A]): Drawing[A]
- Definition Classes
- Transform
- def interpolatingSpline(points: Seq[Point]): Drawing[Unit]
- Definition Classes
- Path
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def margin[A](img: Finalized[Reification, A], top: Double, right: Double, bottom: Double, left: Double): Finalized[Reification, A]
Expand the bounding box of img by the given amounts.
Expand the bounding box of img by the given amounts.
- Definition Classes
- GenericLayout → Layout
- def margin[A](img: Drawing[A], width: Double): Drawing[A]
- Definition Classes
- Layout
- def margin[A](img: Drawing[A], width: Double, height: Double): Drawing[A]
- Definition Classes
- Layout
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noDash[A](image: Finalized[Reification, A]): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def noFill[A](image: Finalized[Reification, A]): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def noStroke[A](image: Finalized[Reification, A]): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def on[A](top: Finalized[Reification, A], bottom: Finalized[Reification, A])(implicit s: Semigroup[A]): Finalized[Reification, A]
Place the origin of top on the origin of bottom
Place the origin of top on the origin of bottom
- Definition Classes
- GenericLayout → Layout
- def originAt[A](img: Finalized[Reification, A], landmark: Landmark): Finalized[Reification, A]
Place the origin of img at the given landmark, expanding the bounding box if necessary to include the relocated origin.
Place the origin of img at the given landmark, expanding the bounding box if necessary to include the relocated origin.
- Definition Classes
- GenericLayout → Layout
- def originAt[A](img: Drawing[A], offset: Point): Drawing[A]
- Definition Classes
- Layout
- def originAt[A](img: Drawing[A], offset: Vec): Drawing[A]
- Definition Classes
- Layout
- def originAt[A](img: Drawing[A], r: Double, a: Angle): Drawing[A]
- Definition Classes
- Layout
- def originAt[A](img: Drawing[A], x: Double, y: Double): Drawing[A]
- Definition Classes
- Layout
- def path(path: OpenPath): Finalized[Reification, Unit]
- Definition Classes
- GenericPath → Path
- def path(path: ClosedPath): Finalized[Reification, Unit]
- Definition Classes
- GenericPath → Path
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def read(file: File): Drawing[Unit]
Read an image from the given file
Read an image from the given file
- Definition Classes
- ReifiedBitmap → Bitmap
- def read(file: String): Drawing[Unit]
Convenience to read an image from the file specified in the given String
Convenience to read an image from the file specified in the given String
- Definition Classes
- Bitmap
- def rectangle(width: Double, height: Double): Finalized[Reification, Unit]
A rectangle with the given width and height.
A rectangle with the given width and height.
- Definition Classes
- GenericShape → Shape
- def regularPolygon(sides: Int, radius: Double): Drawing[Unit]
- Definition Classes
- Path
- def rotate[A](img: Drawing[A], angle: Angle): Drawing[A]
- Definition Classes
- Transform
- def roundedRectangle(width: Double, height: Double, radius: Double): Drawing[Unit]
- Definition Classes
- Path
- def scale[A](img: Drawing[A], x: Double, y: Double): Drawing[A]
- Definition Classes
- Transform
- def size[A](picture: Finalized[Reification, A]): Finalized[Reification, (Double, Double)]
Get the width and height of the bounding box enclosing the picture
Get the width and height of the bounding box enclosing the picture
- Definition Classes
- GenericSize → Size
- def square(width: Double): Finalized[Reification, Unit]
A square with the given side length.
A square with the given side length.
- Definition Classes
- GenericShape → Shape
- def star(points: Int, outerRadius: Double, innerRadius: Double): Drawing[Unit]
- Definition Classes
- Path
- def strokeCap[A](image: Finalized[Reification, A], cap: Cap): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def strokeColor[A](image: Finalized[Reification, A], strokeColor: Color): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def strokeDash[A](image: Finalized[Reification, A], pattern: Iterable[Double]): Finalized[Reification, A]
Specify the stroke dash pattern.
Specify the stroke dash pattern. The pattern gives the length, in local coordinates, of opaque and transparent sections. The first element is the length of an opaque section, the second of a transparent section, and so on.
- Definition Classes
- GenericStyle → Style
- def strokeJoin[A](image: Finalized[Reification, A], join: Join): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- def strokeWidth[A](image: Finalized[Reification, A], strokeWidth: Double): Finalized[Reification, A]
- Definition Classes
- GenericStyle → Style
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def text(text: String): Finalized[Reification, Unit]
Render the given String
Render the given String
- Definition Classes
- GenericText → Text
- def transform[A](img: Finalized[Reification, A], tx: Transform): Finalized[Reification, A]
- Definition Classes
- GenericTransform → Transform
- def translate[A](img: Drawing[A], vec: Vec): Drawing[A]
- Definition Classes
- Transform
- def translate[A](img: Drawing[A], x: Double, y: Double): Drawing[A]
- Definition Classes
- Transform
- def triangle(width: Double, height: Double): Finalized[Reification, Unit]
An isoceles triangle with the given width and height.
An isoceles triangle with the given width and height.
- Definition Classes
- GenericShape → Shape
- def under[A](bottom: Drawing[A], top: Drawing[A])(implicit s: Semigroup[A]): Drawing[A]
- Definition Classes
- Layout
- def verticalReflection[A](img: Drawing[A]): Drawing[A]
- Definition Classes
- Transform
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def width[A](picture: Finalized[Reification, A]): Finalized[Reification, Double]
Get the width of the bounding box enclosing the picture
Get the width of the bounding box enclosing the picture
- Definition Classes
- GenericSize → Size
- object PathApi extends (ReifiedPath.this)#PathApi
- Definition Classes
- ReifiedPath → GenericPath
- object ShapeApi extends (ReifiedShape.this)#ShapeApi
- Definition Classes
- ReifiedShape → GenericShape