Version: v0.0.0-...-751e882 Latest Latest

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

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 3 Imported by: 1



Package haar provides a Haar wavelet function for bitmap images.



View Source
const ColourChannels = 3

ColourChannels is the number of channels for one color. We will be using three colour channels per pixel at all times.


This section is empty.


This section is empty.


type Coef

type Coef [ColourChannels]float64

Coef is the union of coefficients for all channels of the original image.

func (*Coef) Add

func (coef *Coef) Add(offset Coef)

Add adds another coefficient in place.

func (*Coef) Divide

func (coef *Coef) Divide(value float64)

Divide divides all elements of the coefficient by a value, in place.

func (*Coef) Subtract

func (coef *Coef) Subtract(offset Coef)

Subtract subtracts another coefficient in place.

type Matrix

type Matrix struct {
	// Coefs is the slice of coefficients resulting from a forward 2D Haar
	// transform. The position of a coefficient (x,y) is (y * Width + x).
	Coefs []Coef

	// The number of columns in the matrix.
	Width uint

	// The number of rows in the matrix.
	Height uint

Matrix is the result of the Haar transform, a two-dimensional matrix of coefficients.

func Transform

func Transform(img image.Image) Matrix

Transform performs a forward 2D Haar transform on the provided image after converting it to YIQ space.

Source Files

Jump to

Keyboard shortcuts

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