Documentation
¶
Index ¶
- func America(src image.Image) ([]byte, error)
- func Bomb(src image.Image) ([]byte, error)
- func Communism(src image.Image) ([]byte, error)
- func ElmoBurn(src image.Image) ([]byte, error)
- func Jail(src image.Image) ([]byte, error)
- func Math(src image.Image) ([]byte, error)
- func Pride(src image.Image, flagName string) ([]byte, error)
- func PrideFlags() []string
- func Rain(src image.Image) ([]byte, error)
- func Shatter(src image.Image) ([]byte, error)
- func Wasted(src image.Image) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func America ¶
America returns src with the animated American flag overlay composited on top at americaOpacity. Output is an animated GIF whose frames share src's dimensions; the flag frame is fit/cropped to match.
func Bomb ¶
Bomb returns src with the animated explosion overlay composited on top at bombOpacity. Output is an animated GIF whose frames share src's dimensions; the overlay frame is fit/cropped to match.
func Communism ¶
Communism returns src with the animated communism overlay composited on top at communismOpacity. Output is an animated GIF whose frames share src's dimensions; the overlay is fit/cropped to match.
func ElmoBurn ¶
ElmoBurn returns src with the burning-Elmo animated overlay composited on top at elmoBurnOpacity. Output is an animated GIF whose frames share src's dimensions; the overlay frame is fit/cropped to match.
func Jail ¶
Jail composites the prison-bars overlay over src at full opacity, fitting the bars to cover the whole source while preserving the overlay's aspect.
func Math ¶
Math returns src with the animated math overlay composited on top at mathOpacity. Output is an animated GIF whose frames share src's dimensions; the overlay frame is fit/cropped to match.
func Pride ¶
Pride composites the chosen pride flag onto src at prideOpacity. flagName matches the basename of one of the PNGs in res/pride/ (e.g. "gay", "trans", "progress"). Input is normalized to lowercase, and only [a-z0-9] characters are accepted — anything else returns an error to prevent the lookup from being tricked into resolving a path outside the embedded flag directory.
func PrideFlags ¶
func PrideFlags() []string
PrideFlags returns the list of available pride flag names (the filename without the .png extension), sorted alphabetically. Useful for keeping spec-side choice lists in sync with what's actually embedded.
func Rain ¶
Rain returns src with the animated rain overlay composited on top at rainOpacity. Output is an animated GIF whose frames share src's dimensions; the overlay frame is fit/cropped to match.
Note: a procedural rain implementation also lives in animated/rain.go (synthesized streaks rather than a pre-rendered GIF). They produce different aesthetics; this is the GIF-overlay version.
func Shatter ¶
Shatter composites the broken-glass overlay over src at full opacity. The PNG ships with a transparent background and only the glass shards are opaque, so a full-opacity overlay reveals src everywhere except where the cracks/shards sit. src keeps its native dimensions; the overlay is fit/cropped to match using imaging.Fill so the cracks stay in proportion.
Types ¶
This section is empty.