filter

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FastGaussian

func FastGaussian(src hdr.Image, radius int) hdr.Image

FastGaussian blurs im using a fast approximation of gaussian blur. The algorithm has a computational complexity independent of radius.

func StackBlur

func StackBlur(src hdr.Image, radius int) hdr.Image

StackBlur performs a fast almost Gaussian Blur implementation.

Types

type Apply

type Apply struct {
	HDRImage1 hdr.Image
	HDRImage2 hdr.Image
	// contains filtered or unexported fields
}

An Apply filter let's you apply any function on two colors.

func NewApply1

func NewApply1(m1 hdr.Image, apply func(c1, c2 hdrcolor.Color) hdrcolor.Color) *Apply

NewApply1 instanciates a new Apply filter.

func NewApply2

func NewApply2(m1, m2 hdr.Image, apply func(c1, c2 hdrcolor.Color) hdrcolor.Color) *Apply

NewApply2 instanciates a new Apply filter.

func (*Apply) At

func (f *Apply) At(x, y int) color.Color

At computes the log10(x) and returns the filtered color at the given coordinates.

func (*Apply) Bounds

func (f *Apply) Bounds() image.Rectangle

Bounds implements image.Image interface.

func (*Apply) ColorModel

func (f *Apply) ColorModel() color.Model

ColorModel returns the Image's color model.

func (*Apply) HDRAt

func (f *Apply) HDRAt(x, y int) hdrcolor.Color

HDRAt computes the log10(x) and returns the filtered color at the given coordinates.

func (*Apply) Size

func (f *Apply) Size() int

Size implements Image.

type FastBilateral

type FastBilateral struct {
	HDRImage   hdr.Image
	SigmaRange float64
	SigmaSpace float64
	// contains filtered or unexported fields
}

A FastBilateral filter is a non-linear, edge-preserving and noise-reducing smoothing filter for images. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels.

References: https://github.com/mdouchement/bilateral http://people.csail.mit.edu/sparis/bf/

func NewFastBilateral

func NewFastBilateral(m hdr.Image, sigmaSpace, sigmaRange float64) *FastBilateral

NewFastBilateral instanciates a new FastBilateral.

func NewFastBilateralAuto

func NewFastBilateralAuto(m hdr.Image) *FastBilateral

NewFastBilateralAuto instanciates a new FastBilateral with automatic sigma values.

func (*FastBilateral) At

func (f *FastBilateral) At(x, y int) color.Color

At computes the interpolation and returns the filtered color at the given coordinates.

func (*FastBilateral) Bounds

func (f *FastBilateral) Bounds() image.Rectangle

Bounds implements image.Image interface.

func (*FastBilateral) ColorModel

func (f *FastBilateral) ColorModel() color.Model

ColorModel returns the Image's color model.

func (*FastBilateral) HDRAt

func (f *FastBilateral) HDRAt(x, y int) hdrcolor.Color

HDRAt computes the interpolation and returns the filtered color at the given coordinates.

func (*FastBilateral) HDRResultImage

func (f *FastBilateral) HDRResultImage() hdr.Image

HDRResultImage computes the interpolation and returns the filtered image.

func (*FastBilateral) Perform

func (f *FastBilateral) Perform()

Perform runs the bilateral filter.

func (*FastBilateral) ResultImage

func (f *FastBilateral) ResultImage() hdr.Image

ResultImage computes the interpolation and returns the filtered image.

func (*FastBilateral) Size

func (f *FastBilateral) Size() int

Size implements Image.

type Log10

type Log10 struct {
	HDRImage hdr.Image
	// contains filtered or unexported fields
}

A Log10 applies a log10 for all pixels of the image.

func NewLog10

func NewLog10(m hdr.Image) *Log10

NewLog10 instanciates a new Log10 filter.

func (*Log10) At

func (f *Log10) At(x, y int) color.Color

At computes the log10(x) and returns the filtered color at the given coordinates.

func (*Log10) Bounds

func (f *Log10) Bounds() image.Rectangle

Bounds implements image.Image interface.

func (*Log10) ColorModel

func (f *Log10) ColorModel() color.Model

ColorModel returns the Image's color model.

func (*Log10) HDRAt

func (f *Log10) HDRAt(x, y int) hdrcolor.Color

HDRAt computes the log10(x) and returns the filtered color at the given coordinates.

func (*Log10) Size

func (f *Log10) Size() int

Size implements Image.

type Pow10

type Pow10 struct {
	HDRImage hdr.Image
	// contains filtered or unexported fields
}

A Pow10 applies a pow10 for all pixels of the image.

func NewPow10

func NewPow10(m hdr.Image) *Pow10

NewPow10 instanciates a new Pow10 filter.

func (*Pow10) At

func (f *Pow10) At(x, y int) color.Color

At computes the pow10(x) and returns the filtered color at the given coordinates.

func (*Pow10) Bounds

func (f *Pow10) Bounds() image.Rectangle

Bounds implements image.Image interface.

func (*Pow10) ColorModel

func (f *Pow10) ColorModel() color.Model

ColorModel returns the Image's color model.

func (*Pow10) HDRAt

func (f *Pow10) HDRAt(x, y int) hdrcolor.Color

HDRAt computes the pow10(x) and returns the filtered color at the given coordinates.

func (*Pow10) Size

func (f *Pow10) Size() int

Size implements Image.

type QuickSampling

type QuickSampling struct {
	HDRImage hdr.Image
	// contains filtered or unexported fields
}

A QuickSampling allows to iterate on pixels over a reduced image size.

func NewQuickSampling

func NewQuickSampling(img hdr.Image, sampling float32) *QuickSampling

NewQuickSampling instanciates a new QuickSampling for the given sampling included in [0, 1].

func (*QuickSampling) At

func (f *QuickSampling) At(x, y int) color.Color

At implements Image with quick sampling HDRImage.

func (*QuickSampling) Bounds

func (f *QuickSampling) Bounds() image.Rectangle

Bounds implements Image with quick sampling HDRImage.

func (*QuickSampling) ColorModel

func (f *QuickSampling) ColorModel() color.Model

ColorModel delegates to HDRImage function.

func (*QuickSampling) HDRAt

func (f *QuickSampling) HDRAt(x, y int) hdrcolor.Color

HDRAt implements Image with quick sampling on HDRImage.

func (*QuickSampling) Size

func (f *QuickSampling) Size() int

Size implements Image with quick sampling HDRImage.

type YFastBilateral

type YFastBilateral struct {
	HDRImage   hdr.Image
	SigmaRange float64
	SigmaSpace float64
	// contains filtered or unexported fields
}

A YFastBilateral (very fast) filter is a non-linear, edge-preserving and noise-reducing smoothing filter for images. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels.

References: https://github.com/mdouchement/bilateral http://people.csail.mit.edu/sparis/bf/

func NewYFastBilateral

func NewYFastBilateral(m hdr.Image, sigmaSpace, sigmaRange float64) *YFastBilateral

NewYFastBilateral instanciates a new YFastBilateral.

func NewYFastBilateralAuto

func NewYFastBilateralAuto(m hdr.Image) *YFastBilateral

NewYFastBilateralAuto instanciates a new YFastBilateral with automatic sigma values.

func (*YFastBilateral) At

func (f *YFastBilateral) At(x, y int) color.Color

At computes the interpolation and returns the filtered color at the given coordinates.

func (*YFastBilateral) Bounds

func (f *YFastBilateral) Bounds() image.Rectangle

Bounds implements image.Image interface.

func (*YFastBilateral) ColorModel

func (f *YFastBilateral) ColorModel() color.Model

ColorModel returns the Image's color model.

func (*YFastBilateral) HDRAt

func (f *YFastBilateral) HDRAt(x, y int) hdrcolor.Color

HDRAt computes the interpolation and returns the filtered color at the given coordinates.

func (*YFastBilateral) HDRResultImage

func (f *YFastBilateral) HDRResultImage() hdr.Image

HDRResultImage computes the interpolation and returns the filtered image.

func (*YFastBilateral) Perform

func (f *YFastBilateral) Perform()

Perform runs the bilateral filter.

func (*YFastBilateral) ResultImage

func (f *YFastBilateral) ResultImage() hdr.Image

ResultImage computes the interpolation and returns the filtered image.

func (*YFastBilateral) Size

func (f *YFastBilateral) Size() int

Size implements Image.

Jump to

Keyboard shortcuts

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