filter

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Min int = 3
)

Variables

View Source
var (
	Identity_3x3 = kernel{
		3,
		[]int{0, 0, 0, 0, 1, 0, 0, 0, 0},
		1,
	}

	RidgeDetection_3x3_soft = kernel{
		3,
		[]int{0, -1, 0, -1, 4, -1, 0, -1, 0},
		1,
	}

	RidgeDetection_3x3_hard = kernel{
		3,
		[]int{-1, -1, -1, -1, 8, -1, -1, -1, -1},
		1,
	}

	Sharpen_3x3 = kernel{
		3,
		[]int{0, -1, 0, -1, 5, -1, 0, -1, 0},
		1,
	}

	Gauss_3x3 = kernel{
		3,
		[]int{1, 1, 1, 1, 1, 1, 1, 1, 1},
		9,
	}
)
View Source
var (
	CGAPalettes map[int]color.Palette
)

Functions

func CGA16

func CGA16(c color.Color) color.Color

func CGA2

func CGA2(c color.Color) (n color.Color)

func CGA4

func CGA4(c color.Color) (n color.Color)

func ConstrastGrayColor

func ConstrastGrayColor(c color.Color, m uint8, p predicate) color.Color

func DarkContrast

func DarkContrast(c color.Color) color.Color

func DarkGrayColor

func DarkGrayColor(c color.Color) color.Color

func EGA

func EGA(c color.Color) color.Color

func Gauss

func Gauss(s int) (*kernel, error)

func GrayColor

func GrayColor(c color.Color) color.Color

func Identity

func Identity(c color.Color) color.Color

func InvertColor

func InvertColor(c color.Color) color.Color

func LightGrayColor

func LightGrayColor(c color.Color) color.Color

func LongEdge

func LongEdge(bx, by int) bool

func NewBasicFilter

func NewBasicFilter(transform TransformColor) *basicFilter

func NewConvolutionFilter

func NewConvolutionFilter(k *kernel, pre, post TransformColor) *convolutionFilter

func NewKernel

func NewKernel(s int, m matrix, f int) (*kernel, error)

func NewPixelFilter

func NewPixelFilter(stripes int, edge Edge, transform TransformColor) *pixelFilter

func ShortEdge

func ShortEdge(bx, by int) bool

func VGA

func VGA(c color.Color) color.Color

func XRayColor

func XRayColor(c color.Color) color.Color

Types

type Block

type Block struct {
	// contains filtered or unexported fields
}

type Edge

type Edge func(bx, by int) bool

Edge is a Predicate function

type Filter

type Filter interface {
	//Process image transformation from source src to destination dst
	Process(src *image.Image) *image.RGBA
}

type TransformColor

type TransformColor func(color.Color) color.Color

Jump to

Keyboard shortcuts

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