scomplex

package
v0.0.0-...-1b03cc8 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComplexInt32ArrayToString

func ComplexInt32ArrayToString(cpx []ComplexInt32, width int) string

Formats a slice of ComplexInt32 as a string that can be used as a literal.

Types

type ComplexImage

type ComplexImage struct {
	// The "pixel" data.
	Pix []complex128
	// The rectangle defining the bounds of the image.
	Rect image.Rectangle
	// The maximum modulus value that occurs in this image. This is useful
	// when computing a histogram of the modulus value.
	MaxMod float64
	// Extreme values found in this image
	MinRe, MaxRe, MinIm, MaxIm float64
}

A ComplexImage is an image where each pixel is a Go complex128.

func FromComplexArray

func FromComplexArray(cpx []complex128, width int) (dst *ComplexImage)

FromComplexArray wraps an array of complex numbers in a ComplexImage.

func ToShiftedComplex

func ToShiftedComplex(src SippImage) (dst *ComplexImage)

ToShiftedComplex converts the input image into a ComplexImage, multiplying each pixel by (-1)^(x+y), in order for a subsequent FFT to be centred properly.

func (*ComplexImage) Render

func (comp *ComplexImage) Render() (SippImage, SippImage)

Render renders the real and imaginary parts of the image as separate 8-bit grayscale images.

type ComplexInt32

type ComplexInt32 struct {
	Re int32
	Im int32
}

A ComplexInt32 is a complex number with int32 real and imaginary parts.

func (ComplexInt32) Add

Adds a ComplexInt32 to this one, returning a new one.

func (ComplexInt32) Mult

Multiplies a ComplexInt32 to this one, returning a new one.

func (ComplexInt32) Sub

Subtracts a ComplexInt32 from this one, returning a new one.

type ComplexInt32Image

type ComplexInt32Image struct {
	// The "pixel" data.
	Pix []ComplexInt32
	// The rectangle defining the bounds of the image.
	Rect image.Rectangle
	// The maximum modulus value that occurs in this image. This is useful
	// when computing a histogram of the modulus value. We retain a float64 for
	// precision.
	MaxMod float64
	// Extreme values found in this image
	MinRe, MaxRe, MinIm, MaxIm int32
}

A ComplexInt32Image is an image where each pixel is a ComplexInt32.

func FromComplexInt32Array

func FromComplexInt32Array(cpx []ComplexInt32, width int) (dst *ComplexInt32Image)

FromComplexInt32Array wraps an array of complex numbers in a ComplexInt32Image.

func ToShiftedComplexInt32

func ToShiftedComplexInt32(src SippImage) (dst *ComplexInt32Image)

ToShiftedInt32Complex converts the input image into a ComplexInt32Image, multiplying each pixel by (-1)^(x+y), in order for a subsequent FFT to be centred properly.

func (*ComplexInt32Image) Render

func (comp *ComplexInt32Image) Render() (SippImage, SippImage)

Render renders the real and imaginary parts of the image as separate 8-bit grayscale images.

Jump to

Keyboard shortcuts

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