emath

package
v0.0.0-...-55d3409 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GammaExpand_F64

func GammaExpand_F64(f float64) float64

Types

type Aff3

type Aff3 f64.Aff3

Use a local type so we can hang methods off it

func Identity

func Identity() Aff3

func RotateAbout

func RotateAbout(thetaDeg, x, y float64) Aff3

func (Aff3) Mult

func (p Aff3) Mult(q Aff3) Aff3

Cut-n-pasted from image@0.7.0/draw/scale:matMul

func (Aff3) Rotate

func (m1 Aff3) Rotate(thetaDeg float64) Aff3

func (Aff3) Translate

func (m1 Aff3) Translate(tx, ty float64) Aff3

type FloatGrid

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

A FloatGrid is a grid of floats, with some operations

func NewFloatGrid

func NewFloatGrid(w, h int) FloatGrid

func (*FloatGrid) CalculateGradients

func (H *FloatGrid) CalculateGradients(depth int) (FloatGrid, float64)

func (*FloatGrid) Copy

func (g1 *FloatGrid) Copy() *FloatGrid

func (*FloatGrid) DownSample

func (g1 *FloatGrid) DownSample() FloatGrid

DownSample returns a grid that is 1/4 of the size, averaging the values from the original.

func (*FloatGrid) Dx

func (fg *FloatGrid) Dx() int

func (*FloatGrid) Dy

func (fg *FloatGrid) Dy() int

func (*FloatGrid) FindMaxMinLumAtPercentile

func (I *FloatGrid) FindMaxMinLumAtPercentile(minPrct, maxPrct float64) (float64, float64)

func (FloatGrid) GaussianBlur

func (g1 FloatGrid) GaussianBlur() FloatGrid

func (*FloatGrid) Get

func (fg *FloatGrid) Get(x, y int) float64

func (*FloatGrid) NewFromThis

func (g1 *FloatGrid) NewFromThis() FloatGrid

func (*FloatGrid) Ptr2array

func (fg *FloatGrid) Ptr2array() *float64

func (*FloatGrid) Set

func (fg *FloatGrid) Set(x, y int, v float64)

func (*FloatGrid) Stats

func (fg *FloatGrid) Stats() string

func (*FloatGrid) ToImg

func (fg *FloatGrid) ToImg(title, filename string)

ToImg saves a simple grayscale, based on the range of values in the grid, and gamma scaling the gray to look normal for human vision

func (*FloatGrid) UpSampleInto

func (A *FloatGrid) UpSampleInto(B *FloatGrid)

UpSampleInto populates a grid `B`, which is assumed be 2x as big, by simply copying each value from `A` four times into a 2x2 block of values in `B`

type Mat3

type Mat3 f64.Mat3

func (Mat3) Apply

func (m Mat3) Apply(v Vec3) Vec3

func (Mat3) Mult

func (a Mat3) Mult(b Mat3) Mat3

func (Mat3) String

func (m Mat3) String() string

type Vec3

type Vec3 f64.Vec3

Actual 3x3 matrixes, used for color transforms

func GammaExpand_sRGB

func GammaExpand_sRGB(v Vec3) Vec3

https://www.sjbrown.co.uk/posts/gamma-correct-rendering/ - "linear RGB to sRGB" Each channel in `v` is assumed to be in the range [0,1]

func (*Vec3) CeilingAt

func (v *Vec3) CeilingAt(max float64)

func (*Vec3) FloorAt

func (v *Vec3) FloorAt(min float64)

func (Vec3) InvertDiag

func (v Vec3) InvertDiag() Mat3

Places the vector on the diagonal of a matrix, then inverts it

func (Vec3) String

func (v Vec3) String() string

Jump to

Keyboard shortcuts

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