Documentation
¶
Overview ¶
Package buttery provides primitives for manipulating GIF animations.
Index ¶
Constants ¶
const Version = "0.0.38"
Version is semver.
Variables ¶
This section is empty.
Functions ¶
func GetDimensions ¶ added in v0.0.2
GetDimensions reports the horizontal and vertical bounds of a GIF.
func GetPaletteSize ¶ added in v0.0.2
GetPaletteSize queries the size of a GIF's color space.
Types ¶
type Config ¶ added in v0.0.4
type Config struct {
// Transparent preserves clear animations (Default false).
Transparent bool
// TrimEdges removes frames from the start and end of the incoming sequence (Default zero).
TrimEdges int
// TrimStart removes frames from the start of the incoming sequence (Default zero).
TrimStart int
// TrimEnd removes fromes frames from the end of the incoming sequence (Default zero).
TrimEnd int
// CutInterval removes every nth frame from the incoming sequence (Default zero).
CutInterval int
// Window truncates frames from the incoming sequence (Default zero).
//
// Zero indicates no window truncation.
Window int
// Shift moves the start of the sequence leftward (Default zero).
Shift int
// Stitch denotes a loop continuity transition (Default Mirror).
Stitch Stitch
// FadeColor denotes a hue for fade transitions (Default black).
// Alpha channel ignored.
FadeColor color.RGBA
// FadeRate denotes the speed of fade transitions (Default 1.0).
FadeRate float64
// ScaleDelay multiplies each frame delay by a factor (Default 1.0).
//
// The resulting delay is upheld to a lower bound of 2 centisec.
//
// A negative scale delay reverses the incoming sequence.
ScaleDelay float64
// PanVelocity specifies the number of pixels to shift the canvas per frame (Default: 1.0).
PanVelocity float64
// LoopCount denotes how many times to play the animation (Default 0).
//
// -1 indicates one play.
// 0 indicates infinite, endless plays.
// N indicates 1+N iterations.
LoopCount int
}
Config models a set of animation editing manipulations.
type Stitch ¶ added in v0.0.2
type Stitch int
Stitch models a loop continuity strategy.
const ( // None ends the incoming sequence as-is. None Stitch = iota // Mirror follows the end of the incoming sequence by replaying the sequence backwards. Mirror // FlipH follows the end of the incoming sequence by replaying the sequence reflected horizontally. FlipH // FlipV follows the end of the incoming sequence by replaying the sequence reflected vertically. FlipV // Shuffle randomizes the incoming sequence. Shuffle // PanH shifts the canvas horizontally PanH // PanV shifts the canvas vertically PanV // Fade applies time color gradients Fade )
func ParseStitch ¶ added in v0.0.2
ParseStitch generates a Stitch from a string value.
