Documentation
¶
Index ¶
- Constants
- Variables
- func ColorFilterStrings() []string
- func SetWebPLevel(level int32)
- type ColorFilter
- type ImageFilter
- type RenderFilters
- type Screens
- func (s *Screens) Empty() bool
- func (s *Screens) EncodeAVIF(maxDuration time.Duration, filters ...ImageFilter) ([]byte, error)
- func (s *Screens) EncodeGIF(maxDuration time.Duration, filters ...ImageFilter) ([]byte, error)
- func (s *Screens) EncodeWebP(maxDuration time.Duration, filters ...ImageFilter) ([]byte, error)
- func (s *Screens) Hash() ([]byte, error)
Constants ¶
const ( AVIF_HEADER_MINI = 1 AVIF_RESULT_OK = 0 AVIF_QUALITY_LOSSLESS = int32(100) AVIF_SPEED_DEFAULT = int32(-1) AVIF_SPEED_SLOWEST = int32(0) AVIF_SPEED_FASTEST = int32(10) )
const ( WebPKMin = 0 WebPKMax = 0 DefaultScreenDelayMillis = 50 DefaultMaxAgeSeconds = 0 // 0 => no max age, cache forever! )
const (
WebPLevelDefault = int32(6)
)
Variables ¶
var ErrInvalidColorFilter = fmt.Errorf("invalid color filter")
Functions ¶
func ColorFilterStrings ¶
func ColorFilterStrings() []string
ColorFilterStrings returns a slice of all String values of the enum
func SetWebPLevel ¶ added in v0.48.0
func SetWebPLevel(level int32)
Types ¶
type ColorFilter ¶
type ColorFilter uint8
const ( ColorNone ColorFilter = iota ColorDimmed ColorRedShift ColorWarm ColorSunset ColorSepia ColorVintage ColorDusk ColorCool ColorBW ColorIce ColorMoonlight ColorNeon ColorPastel )
func ColorFilterString ¶
func ColorFilterString(s string) (ColorFilter, error)
ColorFilterString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ColorFilterValues ¶
func ColorFilterValues() []ColorFilter
ColorFilterValues returns all values of the enum
func (ColorFilter) Description ¶
func (f ColorFilter) Description() (string, error)
func (ColorFilter) ImageFilter ¶
func (i ColorFilter) ImageFilter() (ImageFilter, error)
func (ColorFilter) IsAColorFilter ¶
func (i ColorFilter) IsAColorFilter() bool
IsAColorFilter returns "true" if the value is listed in the enum definition. "false" otherwise
func (ColorFilter) MarshalText ¶
func (i ColorFilter) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for ColorFilter
func (ColorFilter) String ¶
func (i ColorFilter) String() string
func (*ColorFilter) UnmarshalText ¶
func (i *ColorFilter) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for ColorFilter
type ImageFilter ¶
func Chain ¶
func Chain(filters ...ImageFilter) ImageFilter
Chain applies a sequence of ImageFilters in order.
func ColorMatrix ¶
func ColorMatrix(matrix [3][3]float32) ImageFilter
ColorMatrix applies a 3x3 color transformation matrix to the RGB values of an image.
type RenderFilters ¶
type RenderFilters struct {
Magnify int `json:"magnify,omitempty"`
ColorFilter ColorFilter `json:"color_filter,omitempty"`
}
func (RenderFilters) String ¶
func (f RenderFilters) String() string
type Screens ¶
type Screens struct {
MaxAge int32
ShowFullAnimation bool
// contains filtered or unexported fields
}
func ScreensFromImages ¶
func (*Screens) EncodeAVIF ¶
Renders screens to AVIF. Optionally pass filters for postprocessing each individual frame.
func (*Screens) EncodeGIF ¶
Renders a screen to GIF. Optionally pass filters for postprocessing each individual frame.
func (*Screens) EncodeWebP ¶
Renders a screen to WebP. Optionally pass filters for postprocessing each individual frame.