media

package
v0.0.0-...-e720886 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	R           = 0
	G           = 1
	B           = 2
	A           = 3
	STRIDECOUNT = 4
)

Variables

View Source
var (
	CriticalRootOverride = errors.New("Root can't override")
)

Functions

func ImageDecode

func ImageDecode(data []byte) (image.Image, error)

func MustImageDecode

func MustImageDecode(data []byte) image.Image

func RGBA32ToRGBA8

func RGBA32ToRGBA8(r, g, b, a uint32) (uint8, uint8, uint8, uint8)

Types

type Blur

type Blur struct {
	Radius    float64
	KeepAlpha bool
	Mode      BlurMode
}

func NewBlur

func NewBlur(Radius float64, KeepAlpha bool, Mode BlurMode) *Blur

func (Blur) Draw

func (s Blur) Draw(target draw.Image)

type BlurMode

type BlurMode uint8
const (
	BlurBox      BlurMode = iota
	BlurGaussian BlurMode = iota
)

type Drawer

type Drawer interface {
	Bound() image.Rectangle
	Effector
}

type Effector

type Effector interface {
	Draw(dst draw.Image)
}

type Fillup

type Fillup struct {
	Mode FillupMode
	// contains filtered or unexported fields
}

func NewFillup

func NewFillup(img image.Image, mode FillupMode) *Fillup

func (Fillup) Bound

func (s Fillup) Bound() image.Rectangle

func (Fillup) Draw

func (s Fillup) Draw(dst draw.Image)

type FillupMode

type FillupMode uint8
const (
	FillupNearestNeighbor FillupMode = iota
	FillupNearest         FillupMode = iota
	FillupGausian         FillupMode = iota
)

type Fixed

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

func NewFixed

func NewFixed(img image.Image) *Fixed

func (Fixed) Bound

func (s Fixed) Bound() image.Rectangle

func (Fixed) Draw

func (s Fixed) Draw(dst draw.Image)

type Matrix

type Matrix [][]float64

func NewMatrix

func NewMatrix(w, h int) Matrix

func (Matrix) AbsSum

func (s Matrix) AbsSum() (sum float64)

func (*Matrix) Clear

func (s *Matrix) Clear(clearValue float64)

func (Matrix) Normal

func (s Matrix) Normal() Matrix

func (Matrix) Size

func (s Matrix) Size() (w, h int)

func (Matrix) String

func (s Matrix) String() (res string)

func (Matrix) Sum

func (s Matrix) Sum() (sum float64)

type Noise

type Noise struct {
	Intense float64
}

func NewNoise

func NewNoise(intense float64) *Noise

func (Noise) Draw

func (s Noise) Draw(target draw.Image)

type Repeat

type Repeat struct {
	Mode RepeatMode
	// contains filtered or unexported fields
}

func NewRepeat

func NewRepeat(img image.Image, mode RepeatMode) *Repeat

func (Repeat) Bound

func (s Repeat) Bound() image.Rectangle

func (Repeat) Draw

func (s Repeat) Draw(dst draw.Image)

type RepeatMode

type RepeatMode uint8
const (
	RepeatNormal     RepeatMode = iota
	RepeatHorizontal RepeatMode = iota
	RepeatVertical   RepeatMode = iota
)

type Uniform

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

func NewUniform

func NewUniform(c color.Color) *Uniform

func (Uniform) Bound

func (Uniform) Bound() image.Rectangle

func (Uniform) Draw

func (s Uniform) Draw(dst draw.Image)

Jump to

Keyboard shortcuts

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