gif

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animator

type Animator struct {
	// contains filtered or unexported fields
}

Animator represents a collection of grids that will be rendered as a GIF. Implements the conway.Animator interface. The origin of coordinates is set at the upper left corner and cells with negatives coordinates are ignored. The zero value of this type is not safe, use the function NewAnimator below.

func NewAnimator

func NewAnimator(d int, r int) (*Animator, error)

NewAnimator returns a new Animator with the given delay d between frames in 100ths of seconds and the given resolution r in pixels per cell.

func (*Animator) Add

func (a *Animator) Add(g conway.Grid) error

Add adds a grid to the collection to be used as a photogram in the animate method. Implements conway.Animator.

func (*Animator) Encode

func (a *Animator) Encode(w io.Writer) error

Encode creates an animation of all the added photograms and store it in the given writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL