imagefilter

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Filters = make(map[FilterType]Filter)

Functions

func Register

func Register(filterType FilterType, filter Filter)

Types

type BlackAndWhiteFilter

type BlackAndWhiteFilter struct{}

func (BlackAndWhiteFilter) Apply

func (bwf BlackAndWhiteFilter) Apply(img image.Image) image.Image

type Filter

type Filter interface {
	Apply(image.Image) image.Image
}

Filter is the interface that wraps the Apply method.

func Get

func Get(filterType FilterType) Filter

type FilterType

type FilterType int

FilterType defines the type of filter to apply to the image.

const (
	NoFilter FilterType = iota
	// BlackAndWhite applies a black and white filter.
	BlackAndWhite
	Vignette
	Sepia
)

type SepiaFilter

type SepiaFilter struct{}

func (*SepiaFilter) Apply

func (sf *SepiaFilter) Apply(img image.Image) image.Image

type VignetteFilter

type VignetteFilter struct{}

func (*VignetteFilter) Apply

func (vf *VignetteFilter) Apply(img image.Image) image.Image

Jump to

Keyboard shortcuts

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