package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Jun 9, 2019
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 13
Opens a new window with list of known importers.
README
¶
imageutil
Utilies related to Golang images.
Features
- fast "generic" get/set RGBA value from/to an image (no memory allocation)
- process parts of an image concurrently
- RBGA <=> NRGBA conversion
Documentation
¶
Package imageutil provides utilities related to images.
-
func NRGBAToRGBA(r, g, b, a uint32) (uint32, uint32, uint32, uint32)
-
func Parallel1D(r image.Rectangle, f func(image.Rectangle))
-
func Parallel2D(r image.Rectangle, f func(image.Rectangle))
-
func RGBAToNRGBA(r, g, b, a uint32) (uint32, uint32, uint32, uint32)
-
type AtFunc
-
type SetFunc
NRGBAToRGBA converts NRGBA to RGBA.
Parallel1D dispatches tasks concurrently for a Rectangle.
It splits the image horizontally in GOMAXPROCS parts and runs GOMAXPROCS workers.
It should be used if all the pixels of the image have the same process cost.
Parallel2D dispatches tasks concurrently for a Rectangle.
It splits the image in a GOMAXPROCS x GOMAXPROCS grid
and runs GOMAXPROCS workers.
It should be used if all the pixels of the image don't have the same process cost.
RGBAToNRGBA converts RGBA to NRGBA.
type AtFunc func(x, y int) (r, g, b, a uint32)
AtFunc returns a RGBA value of the pixel at (x, y).
NewAtFunc returns an AtFunc for an Image.
nolint: gocyclo
type SetFunc func(x, y int, r, g, b, a uint32)
SetFunc sets a RGBA value to the pixel at (x, y).
NewSetFunc returns a SetFunc for an Image.
nolint: gocyclo
Source Files
¶
Click to show internal directories.
Click to hide internal directories.