imageutil

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2019 License: MIT Imports: 5 Imported by: 11

README

imageutil

Utilies related to Golang images.

GoDoc Build Status

Features

  • fast "generic" get/set RGBA value from/to an image (no memory allocation)
  • process parts of an image concurrently
  • RBGA <=> NRGBA conversion

Documentation

Overview

Package imageutil provides utilities related to images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NRGBAToRGBA

func NRGBAToRGBA(r, g, b, a uint32) (uint32, uint32, uint32, uint32)

NRGBAToRGBA converts NRGBA to RGBA.

func Parallel1D

func Parallel1D(r image.Rectangle, f func(image.Rectangle))

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.

func Parallel2D

func Parallel2D(r image.Rectangle, f func(image.Rectangle))

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.

func RGBAToNRGBA

func RGBAToNRGBA(r, g, b, a uint32) (uint32, uint32, uint32, uint32)

RGBAToNRGBA converts RGBA to NRGBA.

Types

type AtFunc

type AtFunc func(x, y int) (r, g, b, a uint32)

AtFunc returns a RGBA value of the pixel at (x, y).

func NewAtFunc

func NewAtFunc(p image.Image) AtFunc

NewAtFunc returns an AtFunc for an Image.

nolint: gocyclo

type SetFunc

type SetFunc func(x, y int, r, g, b, a uint32)

SetFunc sets a RGBA value to the pixel at (x, y).

func NewSetFunc

func NewSetFunc(p draw.Image) SetFunc

NewSetFunc returns a SetFunc for an Image.

nolint: gocyclo

Jump to

Keyboard shortcuts

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