doodle.algebra

package doodle.algebra

Members list

Packages

Type members

Classlikes

trait Algebra

Base type for algebras that produce results in some effect type Drawing. Users of algebras should use dependent method types (or dependent function types in Scala 3) to return the Drawing type of the method they are passed:

Base type for algebras that produce results in some effect type Drawing. Users of algebras should use dependent method types (or dependent function types in Scala 3) to return the Drawing type of the method they are passed:

def usingAlgebra(algebra: Algebra): algebra.Drawing = ???

All Drawing types are required to implement Monad

Attributes

Companion
object
Source
Algebra.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Bitmap
trait Blend
trait Debug
trait GenericDebug[G]
trait Basic
trait Filter
trait Layout
trait GenericLayout[G]
trait Path
trait GenericPath[G]
trait Shape
trait GenericShape[G]
trait Size
trait GenericSize[G]
trait Style
trait GenericStyle[G]
trait Text
trait GenericText[G]
trait Transform
trait GenericTransform[G]
Show all
object Algebra

Attributes

Companion
trait
Source
Algebra.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Algebra.type

Base module for constructors

Base module for constructors

The intention is to assist with type inference for constructors by defining constructors that are parameterized by the Algebra and Drawing types, and instantiating those types within each backend.

Algebras that define constructors should also define a constructor mixin. See e.g. Shape for an example.

Attributes

Source
BaseConstructor.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Bitmap extends Algebra

Attributes

Source
Bitmap.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
sealed abstract class BitmapError extends Exception

Base type for all bitmap loading errors

Base type for all bitmap loading errors

Attributes

Source
BitmapError.scala
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Blend extends Algebra

Algebra describing color blending modes.

Algebra describing color blending modes.

Attributes

Source
Blend.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
trait Debug extends Algebra

Attributes

Source
Debug.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericDebug[G]
trait Basic
final case class FileNotFound(path: String) extends BitmapError

The specified file was not found

The specified file was not found

Attributes

Source
BitmapError.scala
Supertypes
trait Product
trait Equals
class BitmapError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait Filter extends Algebra

Attributes

Companion
object
Source
Filter.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
object Filter

Companion object with standard convolution kernels

Companion object with standard convolution kernels

Attributes

Companion
trait
Source
Filter.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Filter.type

Attributes

Source
Filter.scala
Supertypes
class Object
trait Matchable
class Any
trait FromBufferedImage extends Algebra

Algebra for converting a BufferedImage to a picture

Algebra for converting a BufferedImage to a picture

Attributes

Source
FromBufferedImage.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any

Constructor for FromBufferedImage algebra

Constructor for FromBufferedImage algebra

Attributes

Source
FromBufferedImage.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BaseConstructor { type Algebra <: FromBufferedImage; }
trait FromGifBase64 extends Algebra

Algebra indicating a Picture can be created from a base 64 encoded bitmap in Gif format.

Algebra indicating a Picture can be created from a base 64 encoded bitmap in Gif format.

Attributes

Source
FromBase64.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any

Constructor for FromGifBase64 algebra

Constructor for FromGifBase64 algebra

Attributes

Source
FromBase64.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BaseConstructor { type Algebra <: FromGifBase64; }
trait FromJpgBase64 extends Algebra

Algebra indicating a Picture can be created from a base 64 encoded bitmap in JPG format.

Algebra indicating a Picture can be created from a base 64 encoded bitmap in JPG format.

Attributes

Source
FromBase64.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any

Constructor for FromJpgBase64 algebra

Constructor for FromJpgBase64 algebra

Attributes

Source
FromBase64.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BaseConstructor { type Algebra <: FromJpgBase64; }
trait FromPngBase64 extends Algebra

Algebra indicating a Picture can be created from a base 64 encoded bitmap in PNG format.

Algebra indicating a Picture can be created from a base 64 encoded bitmap in PNG format.

Attributes

Source
FromBase64.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any

Constructor for FromPngBase64 algebra

Constructor for FromPngBase64 algebra

Attributes

Source
FromBase64.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BaseConstructor { type Algebra <: FromPngBase64; }
final case class IOError(description: String, cause: Throwable) extends BitmapError

Generic IO error

Generic IO error

Attributes

Source
BitmapError.scala
Supertypes
trait Product
trait Equals
class BitmapError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final case class InvalidFormat(path: String, cause: Throwable) extends BitmapError

The file exists but is not a valid image format

The file exists but is not a valid image format

Attributes

Source
BitmapError.scala
Supertypes
trait Product
trait Equals
class BitmapError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final case class Kernel(width: Int, height: Int, elements: IArray[Double])

Represents a convolution kernel/matrix for image filtering operations.

Represents a convolution kernel/matrix for image filtering operations.

Value parameters

elements

the kernel elements in row-major order

height

the height of the kernel (must be odd and positive)

width

the width of the kernel (must be odd and positive)

Attributes

Source
Kernel.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Layout extends Algebra

Attributes

Source
Layout.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericLayout[G]
trait Basic
trait LoadBitmap[Specifier, Bitmap]

Algebra for loading bitmap images from various sources.

Algebra for loading bitmap images from various sources.

This algebra is parameterized by:

Type parameters

Bitmap

the type of the resulting bitmap (e.g. BufferedImage on JVM, HTMLImageElement on JS)

Specifier

the type used to specify where to find a bitmap (e.g. File on JVM, String URL on JS)

Attributes

Companion
object
Source
LoadBitmap.scala
Supertypes
class Object
trait Matchable
class Any
object LoadBitmap

Attributes

Companion
trait
Source
LoadBitmap.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LoadBitmap.type

Convenience methods for LoadBitmap that provide synchronous, unsafe operations.

Convenience methods for LoadBitmap that provide synchronous, unsafe operations.

These are convenience methods for cases where:

  • You don't want to deal with IO ceremony
  • You're in a context where throwing exceptions is acceptable
  • You need simple fallback behavior for errors

Note: The actual implementation is platform-specific due to differences in how IO is executed synchronously or asynchronously on JVM vs JS.

Attributes

Source
LoadBitmapConvenience.scala
Supertypes
class Object
trait Matchable
class Any
final case class NetworkError(url: String, cause: Throwable) extends BitmapError

Network error when loading from URL

Network error when loading from URL

Attributes

Source
BitmapError.scala
Supertypes
trait Product
trait Equals
class BitmapError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait Path extends Algebra

Attributes

Source
Path.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericPath[G]
trait Basic
trait Picture[-Alg <: Algebra, A]

Represents a picture, which is a function from a tagless final algebra to some type F that represents drawing a picture with result A. Has a monad instance if F does.

Represents a picture, which is a function from a tagless final algebra to some type F that represents drawing a picture with result A. Has a monad instance if F does.

Attributes

Companion
object
Source
Picture.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Picture[Alg, A]
object Picture

Attributes

Companion
trait
Source
Picture.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Picture.type
trait Shape extends Algebra

Higher level shape primitives. These draw common geometric shapes with the center of the shape the origin of the bounding box.

Higher level shape primitives. These draw common geometric shapes with the center of the shape the origin of the bounding box.

Attributes

Source
Shape.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericShape[G]
trait Basic

Constructors for Shape algebra

Constructors for Shape algebra

Attributes

Source
Shape.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BaseConstructor { type Algebra <: Shape; }
trait Size extends Algebra

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

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

Attributes

Source
Size.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericSize[G]
trait Basic
trait Style extends Algebra

Apply styling to a image.

Apply styling to a image.

Attributes

Source
Style.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericStyle[G]
trait Basic
trait Text extends Algebra

Algebra for creating and styling text.

Algebra for creating and styling text.

Attributes

Source
Text.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericText[G]
trait Basic

Constructors for Text algebra

Constructors for Text algebra

Attributes

Source
Text.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BaseConstructor { type Algebra <: Text; }
trait ToPicture[Input, Alg <: Algebra]

Represents converting from the Input type to a Picture, and depends on the support of some Algebra to actually do the conversion. This can be used to represent, for example, creating a picture from a bitmap in a base64 encoded string.

Represents converting from the Input type to a Picture, and depends on the support of some Algebra to actually do the conversion. This can be used to represent, for example, creating a picture from a bitmap in a base64 encoded string.

Attributes

Source
ToPicture.scala
Supertypes
class Object
trait Matchable
class Any
trait Transform extends Algebra

Attributes

Source
Transform.scala
Supertypes
trait Algebra
class Object
trait Matchable
class Any
Known subtypes
trait GenericTransform[G]
trait Basic