overlays

package
v0.0.0-...-344c1e1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func America

func America(src image.Image) ([]byte, error)

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

func Bomb(src image.Image) ([]byte, error)

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

func Communism(src image.Image) ([]byte, error)

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

func ElmoBurn(src image.Image) ([]byte, error)

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

func Jail(src image.Image) ([]byte, error)

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

func Math(src image.Image) ([]byte, error)

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

func Pride(src image.Image, flagName string) ([]byte, error)

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

func Rain(src image.Image) ([]byte, error)

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

func Shatter(src image.Image) ([]byte, error)

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.

func Wasted

func Wasted(src image.Image) ([]byte, error)

Wasted desaturates src to grayscale, then composites a dark-grey backdrop and the still-colored WASTED overlay on top — source goes monochrome while the title text keeps its colors.

Types

This section is empty.

Jump to

Keyboard shortcuts

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