Documentation ¶
Overview ¶
Package gifutil contains utility functions for working with standard library "image/gif" GIF structs.
Index ¶
- func AttachImage(g *gif.GIF, img *image.Image)
- func AttachImageDelayed(g *gif.GIF, img *image.Image, delay int)
- func NewFiniteGIF(pal color.Palette, width, height, loopCount int) *gif.GIF
- func NewGIF(pal color.Palette, width, height int) *gif.GIF
- func Populate(g *gif.GIF, frames int, fg FrameGetter)
- func WriteToFile(g *gif.GIF, filename string) error
- type FrameGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachImage ¶
AttachImage appends an Image to a GIF struct's set of frames.
func AttachImageDelayed ¶
AttachImageDelayed appends an Image to a GIF struct's set of frames, as well as a delay measured in hundredths of a second
func NewFiniteGIF ¶
NewFiniteGIF creates a new, empty GIF struct that loops a fixed number of times.
Types ¶
type FrameGetter ¶
FrameGetter is an interface used by the Populate() function. All that is required to implement it is a function that, when given a frame number, returns the corresponding image associated with that frame.
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
cycloid
cycloid.go creates a gif demonstrating a cycloid - the shape that is formed when you trace one point on a rolling circle.
|
cycloid.go creates a gif demonstrating a cycloid - the shape that is formed when you trace one point on a rolling circle. |
flower
flower.go creates a gif of a flower - that is, a shape formed by the polar equation r = k * cos(p * theta), where k is the radius of the final product and p is the number of petals.
|
flower.go creates a gif of a flower - that is, a shape formed by the polar equation r = k * cos(p * theta), where k is the radius of the final product and p is the number of petals. |
Click to show internal directories.
Click to hide internal directories.