Animation
scalacv.Animation
object Animation
Animation — a drawing that is a function of the frame number, rendered to a video.
The natural extension of a composable Picture: describe frame i as frame(i), and record draws every frame onto a fresh canvas and writes them out through a Recorder. Creative coding, a rendered data animation, a synthetic test clip — all fall out of the same graphics vocabulary.
// `.avi`, not `.mp4`: the default codec is MJPG, which opens only in an AVI container — see [[Codec.Mjpg]].
Animation.record("spin.avi", frames = 60, width = 320, height = 240) { i =>
Picture.regularPolygon(Point(160, 120), sides = 5, radius = 80, rotation = i * 6)
.strokeColor(Color.hsl(i * 6, 0.8, 0.6)).strokeWidth(3)
}
Attributes
- Source
- Animation.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Animation.type
Members list
In this article