utils

package
v0.0.0-...-2fa1f84 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUint16 = ^uint16(0)

MaxUint16 - maximum value which can be held in an uint16

View Source
const MaxUint8 = ^uint8(0)

MaxUint8 - maximum value which can be held in an uint8

View Source
const MinUint16 = 0

MinUint16 - minimum value which can be held in an uint8

View Source
const MinUint8 = 0

MinUint8 - minimum value which can be held in an uint8

Variables

This section is empty.

Functions

func ClampF64

func ClampF64(value float64, min float64, max float64) float64

ClampF64 returns min if value is lesser then min, max if value is greater them max or value if the input value is between min and max.

func ClampInt

func ClampInt(value int, min int, max int) int

ClampInt returns min if value is lesser then min, max if value is greater them max or value if the input value is between min and max.

func ForEachGrayPixel

func ForEachGrayPixel(img *image.Gray, f func(pixel color.Gray))

ForEachGrayPixel loops through the image and calls f functions for each gray pixel.

func ForEachPixel

func ForEachPixel(size image.Point, f func(x int, y int))

ForEachPixel loops through the image and calls f functions for each [x, y] position.

func ForEachRGBAAlphaPixel

func ForEachRGBAAlphaPixel(img *image.RGBA, f func(r uint8))

ForEachRGBAAlphaPixel loops through the image and calls f functions for alpha component of each RGBA pixel

func ForEachRGBABluePixel

func ForEachRGBABluePixel(img *image.RGBA, f func(r uint8))

ForEachRGBABluePixel loops through the image and calls f functions for blue component of each RGBA pixel.

func ForEachRGBAGreenPixel

func ForEachRGBAGreenPixel(img *image.RGBA, f func(r uint8))

ForEachRGBAGreenPixel loops through the image and calls f functions for green component of each RGBA pixel.

func ForEachRGBAPixel

func ForEachRGBAPixel(img *image.RGBA, f func(pixel color.RGBA))

ForEachRGBAPixel loops through the image and calls f functions for each RGBA pixel.

func ForEachRGBARedPixel

func ForEachRGBARedPixel(img *image.RGBA, f func(r uint8))

ForEachRGBARedPixel loops through the image and calls f functions for red component of each RGBA pixel.

func GetMax

func GetMax(v []uint64) uint64

GetMax returns the maximum value from a slice

func ParallelForEachPixel

func ParallelForEachPixel(size image.Point, f func(x int, y int))

ParallelForEachPixel loops through the image and calls f functions for each [x, y] position. The image is divided into N * N blocks, where N is the number of available processor threads. For each block a parallel Goroutine is started.

Types

This section is empty.

Jump to

Keyboard shortcuts

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