Documentation ¶
Index ¶
- Constants
- func CloneImage(img image.Image) draw.Image
- func DegreesToRadians(deg float64) float64
- func GetOptimalKernelWidth1D(radius, sigma float64) int
- func MotionBlurImage(img image.Image, radius, sigma, angle float64) image.Image
- func PerceptibleReciprocal(x float64) float64
- type Kernel1D
- type Normalized1DKernel
- type PointInfo
Constants ¶
const ( MagickEpsilon = 1.0e-12 MagickSQ2PI = 2.50662827463100024161235523934010416269302368164062 QuantumRange = float64(18446744073709551615.0) QuantumScale = 1 / QuantumRange )
Variables ¶
This section is empty.
Functions ¶
func CloneImage ¶
CloneImage simply copies the given image in a new image.NRGBA
func DegreesToRadians ¶
func GetOptimalKernelWidth1D ¶
GetOptimalKernelWidth1D computes the optimal kernel radius for a convolution filter. Start with the minimum value of 3 pixels and walk out until we drop below the threshold of one pixel numerical accuracy.
func MotionBlurImage ¶
MotionBlurImage simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion.
func PerceptibleReciprocal ¶
PerceptibleReciprocal returns 1/x where x is perceptible (not unlimited or infinitesimal).
Types ¶
type Kernel1D ¶ added in v1.0.1
type Kernel1D []float64
func (Kernel1D) Normalize ¶ added in v1.0.1
func (k Kernel1D) Normalize() Normalized1DKernel
type Normalized1DKernel ¶ added in v1.0.1
type Normalized1DKernel []float64
func MotionBlurKernel ¶ added in v1.0.1
func MotionBlurKernel(radius, sigma float64) Normalized1DKernel
MotionBlurKernel returns a kernel for a given type of motion blur, and might help make things slightly faster if using the same motion blur radius/sigma on multiple images