Effects
A picture is a description of what should be drawn. An effect carries out the description by, for example, drawing a picture to the screen or writing it to a file. Effects are implemented as type classes and defined in the effect package. Users will not usually interact directly with effects, but instead work with the syntax defined for them. For example calling draw
on a Picture
is syntax that uses the Renderer effect.
The main effects are:
- Renderer, which draws a
Picture
to the screen. - Writer, is a marker trait for effects that convert a
Picture
to some other type or write it to a file. - FileWriter, for writing to a
File
. - Base64Writer, for writing to a base 64 encoded value.
- BufferedImageWriter, for writing to a
BufferedImage
on the JVM. - DefaultFrame, not strictly an effect but a useful for utility to obtain a default frame instance. This makes other operations more convenient, as the user does not need to specify a frame.