filter

package
v0.51.3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blur

type Blur struct {
	render.Widget `starlark:"child,required"`

	Radius float64 `starlark:"radius,required"`
}

Blur applies a Gaussian blur to the child widget.

DOC(Widget): The widget to apply the blur to. DOC(Radius): The radius of the Gaussian blur.

EXAMPLE BEGIN

filter.Blur(
    child = render.Image(src="...", width=64, height=64),
    radius = 2.0,
)

EXAMPLE END.

func (Blur) Paint

func (b Blur) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

func (Blur) PaintBounds

func (b Blur) PaintBounds(bounds image.Rectangle, frameIdx int) image.Rectangle

type Brightness

type Brightness struct {
	render.Widget `starlark:"child,required"`

	Change float64 `starlark:"change,required"`
}

Brightness adjusts the brightness of the child widget.

DOC(Widget): The widget to adjust brightness for. DOC(Change): The amount to change brightness by. -1.0 is black, 1.0 is white, 0.0 is no change.

EXAMPLE BEGIN

filter.Brightness(
    child = render.Image(src="...", width=64, height=64),
    change = -0.5,
)

EXAMPLE END.

func (Brightness) Paint

func (b Brightness) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Contrast

type Contrast struct {
	render.Widget `starlark:"child,required"`

	Factor float64 `starlark:"factor,required"`
}

Contrast adjusts the contrast of the child widget.

DOC(Widget): The widget to adjust contrast for. DOC(Factor): The factor to adjust contrast by. -1.0 is gray, 1.0 is no change, > 1.0 increases contrast.

EXAMPLE BEGIN

filter.Contrast(
    child = render.Image(src="...", width=64, height=64),
    factor = 2.0,
)

EXAMPLE END.

func (Contrast) Paint

func (c Contrast) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type EdgeDetection

type EdgeDetection struct {
	render.Widget `starlark:"child,required"`

	Radius float64 `starlark:"radius,required"`
}

EdgeDetection applies an edge detection filter to the child widget.

DOC(Widget): The widget to detect edges on. DOC(Radius): The radius of the edge detection kernel.

EXAMPLE BEGIN

filter.EdgeDetection(
    child = render.Image(src="...", width=64, height=64),
    radius = 2.0,
)

EXAMPLE END.

func (EdgeDetection) Paint

func (e EdgeDetection) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Emboss

type Emboss struct {
	render.Widget `starlark:"child,required"`
}

Emboss applies an emboss filter to the child widget.

DOC(Widget): The widget to emboss.

EXAMPLE BEGIN

filter.Emboss(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (Emboss) Paint

func (e Emboss) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type FlipHorizontal

type FlipHorizontal struct {
	render.Widget `starlark:"child,required"`
}

FlipHorizontal flips the child widget horizontally.

DOC(Widget): The widget to flip.

EXAMPLE BEGIN

filter.FlipHorizontal(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (FlipHorizontal) Paint

func (f FlipHorizontal) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type FlipVertical

type FlipVertical struct {
	render.Widget `starlark:"child,required"`
}

FlipVertical flips the child widget vertically.

DOC(Widget): The widget to flip.

EXAMPLE BEGIN

filter.FlipVertical(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (FlipVertical) Paint

func (f FlipVertical) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Gamma

type Gamma struct {
	render.Widget `starlark:"child,required"`

	Gamma float64 `starlark:"gamma,required"`
}

Gamma applies gamma correction to the child widget.

DOC(Widget): The widget to apply gamma correction to. DOC(Gamma): The gamma value. 1.0 is no change, < 1.0 darkens, > 1.0 lightens.

EXAMPLE BEGIN

filter.Gamma(
    child = render.Image(src="...", width=64, height=64),
    gamma = 0.5,
)

EXAMPLE END.

func (Gamma) Paint

func (g Gamma) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Grayscale

type Grayscale struct {
	render.Widget `starlark:"child,required"`
}

Grayscale converts the child widget to grayscale.

DOC(Widget): The widget to convert to grayscale.

EXAMPLE BEGIN

filter.Grayscale(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (Grayscale) Paint

func (g Grayscale) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Hue

type Hue struct {
	render.Widget `starlark:"child,required"`

	Change float64 `starlark:"change,required"`
}

Hue adjusts the hue of the child widget.

DOC(Widget): The widget to adjust hue for. DOC(Change): The amount to change hue by in degrees.

EXAMPLE BEGIN

filter.Hue(
    child = render.Image(src="...", width=64, height=64),
    change = 180.0,
)

EXAMPLE END.

func (Hue) Paint

func (h Hue) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Invert

type Invert struct {
	render.Widget `starlark:"child,required"`
}

Invert inverts the colors of the child widget.

DOC(Widget): The widget to invert.

EXAMPLE BEGIN

filter.Invert(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (Invert) Paint

func (i Invert) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Rotate

type Rotate struct {
	render.Widget `starlark:"child,required"`

	Angle float64 `starlark:"angle,required"`
}

Rotate rotates the child widget by the specified angle.

DOC(Widget): The widget to rotate. DOC(Angle): The angle to rotate by in degrees.

EXAMPLE BEGIN

filter.Rotate(
    child = render.Image(src="...", width=64, height=64),
    angle = 10.0,
)

EXAMPLE END.

func (Rotate) Paint

func (r Rotate) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

func (Rotate) PaintBounds

func (r Rotate) PaintBounds(bounds image.Rectangle, frameIdx int) image.Rectangle

type Saturation

type Saturation struct {
	render.Widget `starlark:"child,required"`

	Factor float64 `starlark:"factor,required"`
}

Saturation adjusts the saturation of the child widget.

DOC(Widget): The widget to adjust saturation for. DOC(Factor): The factor to adjust saturation by. 0.0 is grayscale, 1.0 is no change, > 1.0 increases saturation.

EXAMPLE BEGIN

filter.Saturation(
    child = render.Image(src="...", width=64, height=64),
    factor = 1,
)

EXAMPLE END.

func (Saturation) Paint

func (s Saturation) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Sepia

type Sepia struct {
	render.Widget `starlark:"child,required"`
}

Sepia applies a sepia filter to the child widget.

DOC(Widget): The widget to apply sepia to.

EXAMPLE BEGIN

filter.Sepia(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (Sepia) Paint

func (s Sepia) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Sharpen

type Sharpen struct {
	render.Widget `starlark:"child,required"`
}

Sharpen sharpens the child widget.

DOC(Widget): The widget to sharpen.

EXAMPLE BEGIN

filter.Sharpen(
    child = render.Image(src="...", width=64, height=64),
)

EXAMPLE END.

func (Sharpen) Paint

func (s Sharpen) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

type Shear

type Shear struct {
	render.Widget `starlark:"child,required"`

	XAngle float64 `starlark:"x_angle"`
	YAngle float64 `starlark:"y_angle"`
}

Shear shears the child widget horizontally and/or vertically.

DOC(Widget): The widget to shear. DOC(XAngle): The angle to shear horizontally in degrees. DOC(YAngle): The angle to shear vertically in degrees.

EXAMPLE BEGIN

filter.Shear(
    child = render.Image(src="...", width=64, height=64),
    x_angle = 10.0,
)

EXAMPLE END.

func (Shear) Paint

func (s Shear) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

func (Shear) PaintBounds

func (s Shear) PaintBounds(bounds image.Rectangle, frameIdx int) image.Rectangle

type Threshold

type Threshold struct {
	render.Widget `starlark:"child,required"`

	Level float64 `starlark:"level,required"`
}

Threshold applies a threshold filter to the child widget, making it black and white.

DOC(Widget): The widget to apply threshold to. DOC(Level): The threshold level, from 0 to 255.

EXAMPLE BEGIN

filter.Threshold(
    child = render.Image(src="...", width=64, height=64),
    level = 128.0,
)

EXAMPLE END.

func (Threshold) Paint

func (t Threshold) Paint(dc *gg.Context, bounds image.Rectangle, frameIdx int)

Jump to

Keyboard shortcuts

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