img

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

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

Go to latest
Published: Mar 29, 2016 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package img provides image conversion functions.

Index

Constants

This section is empty.

Variables

View Source
var Threads int

Functions

func Decode

func Decode(r io.Reader, mode ImageConvert) ([]uint8, image.Rectangle, error)

Get an image pixels in NRGBA format

func Ungamma

func Ungamma(x float64) float64

Convert from SRGB to linear color

Types

type BlurFilter

type BlurFilter struct {
	Radius float64
	Clamp  bool
}

Apply Gaussian blur to the image

func (BlurFilter) Draw

func (f BlurFilter) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

Box blur as per http://blog.ivank.net/fastest-gaussian-blur.html, algorithm 2

type ColorFilter

type ColorFilter func(float64) float64

Apply filter to RGB color of each pixel

func (ColorFilter) Draw

func (f ColorFilter) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Apply a series of image compositing functions

func NewConverter

func NewConverter() *Converter

func (*Converter) Add

func (c *Converter) Add(filter ...draw.Drawer)

func (*Converter) Apply

func (c *Converter) Apply(src image.Image) *image.NRGBA

type ImageConvert

type ImageConvert int
const (
	NoConvert ImageConvert = iota
	SRGBToLinear
	BumpToNormal
)

type SobelFilter

type SobelFilter struct {
	Strength float64
	Clamp    bool
}

Apply sobel filter and convert x offset to red channel and y offset to green channel

func (SobelFilter) Draw

func (f SobelFilter) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)

Jump to

Keyboard shortcuts

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