Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
Animation implements the [draw.Image] interface; you can draw to it and then invoke [EmitFrame].
That said, some implementations might be optimized for known image types, in which case, passing a pointer to the [NRGBA] field might be more efficient.
func New ¶
New begins a new animation at the given size and frame rate, to be written to the specified output file.
The output filename must have one of the following extensions: - .gif (lossy, uses a default fixed palette) - .png / .apng (lossless) - .mp4 (lossless RGB, doesn't support transparency) - .mkv (lossless RGB, doesn't support transparency) - .webp (lossy YUV colorspace conversion, alpha supported) - .webm (lossy YUV colorspace conversion, alpha supported)
Note that the output file won't be created immediately, the animation will be written to a temporary file and then renamed by the [Close] method if no errors are encountered.
func (*Animation) Close ¶
Close finishes writing the animation, and cleans up any resources.
func (*Animation) Elapsed ¶
Elapsed returns the timestamp for the current frame, with first frame having a timestamp of 0.
func (*Animation) EmitFrame ¶
EmitFrame writes the image as it presently appears as a frame to the animation.
If this is successful, then the frame counter is advanced. The frame buffer isn't cleared.