creativescala / doodle

Compositional vector graphics in Scala / Scala.JS
https://creativescala.org/doodle/
Apache License 2.0
329 stars 76 forks source link

Refactor bitmap support #85

Open noelwelsh opened 4 years ago

noelwelsh commented 4 years ago

The Bitmap algebra provides some basic support for loading bitmaps but it is limited in the following ways:

What it should do instead:

Concretely, we're looking at an interface like

trait LoadBitmap[Specifier, Bitmap] {
  def load(specifier: Specifier): IO[Bitmap]
}

where Specifier is the type of information that we used to specify where to find a bitmap (e.g. File on the JVM, String on the browser) and Bitmap is the type of the resulting bitmap (BufferedImage on the JVM.) Backend specific implementations could provide their own utility methods that augment the above.

Here are some links to relevant backend information: