imageutil

package
v2.0.0-...-7f6935a Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HSVModel color.Model = color.ModelFunc(convertToHSV)

Functions

func BGRASize

func BGRASize(r *image.Rectangle) int

func BgraColor

func BgraColor(c color.Color) color.RGBA

func BorderRectangle

func BorderRectangle(img draw.Image, r image.Rectangle, c color.Color, size int)

func ColorUint16s

func ColorUint16s(c color.Color) (uint16, uint16, uint16, uint16)

Ex. usage: editor.xutil.cursors

func DrawCopy

func DrawCopy(dst draw.Image, r image.Rectangle, src image.Image)

func DrawMask

func DrawMask(
	dst draw.Image,
	r image.Rectangle,
	src image.Image, srcp image.Point,
	mask image.Image, maskp image.Point,
	op draw.Op,
)

func DrawUniform

func DrawUniform(dst draw.Image, r image.Rectangle, c color.Color, op draw.Op)

func DrawUniformMask

func DrawUniformMask(
	dst draw.Image,
	r image.Rectangle,
	c color.Color,
	mask image.Image, maskp image.Point,
	op draw.Op,
)

func FillRectangle

func FillRectangle(img draw.Image, r image.Rectangle, c color.Color)

func IsLighter

func IsLighter(c color.Color) bool

func MaxPoint

func MaxPoint(p1, p2 image.Point) image.Point

func MinPoint

func MinPoint(p1, p2 image.Point) image.Point

func PaintShadow

func PaintShadow(img draw.Image, r image.Rectangle, height int, maxColorDiff float64)

maxColorDiff in [0.0, 1.0]

func RgbaColor

func RgbaColor(c color.Color) color.RGBA

func RgbaFromInt

func RgbaFromInt(u int) color.RGBA

func Shade

func Shade(c color.Color, v float64) color.Color

Turn color darker by v percent (0.0, 1.0).

func SprintRgb

func SprintRgb(c color.Color) string

func Tint

func Tint(c color.Color, v float64) color.Color

Turn color lighter by v percent (0.0, 1.0).

func TintOrShade

func TintOrShade(c color.Color, v float64) color.Color

func Valorize

func Valorize(c color.Color, v float64, auto bool) color.Color

Types

type BGRA

type BGRA struct {
	image.RGBA
}

func NewBGRA

func NewBGRA(r *image.Rectangle) *BGRA

func NewBGRAFromBuffer

func NewBGRAFromBuffer(buf []byte, r *image.Rectangle) *BGRA

func (*BGRA) At

func (img *BGRA) At(x, y int) color.Color

func (*BGRA) ColorModel

func (img *BGRA) ColorModel() color.Model

func (*BGRA) Set

func (img *BGRA) Set(x, y int, c color.Color)

func (*BGRA) SetRGBA

func (img *BGRA) SetRGBA(x, y int, c color.RGBA)

Allows fast lane if detected.

func (*BGRA) SubImage

func (img *BGRA) SubImage(r image.Rectangle) draw.Image

type HSV

type HSV struct {
	H    uint16 // [0-360)
	S, V uint8  // [0-255]
}

func MakeHSV

func MakeHSV(h uint16, s, v uint8) HSV

h in [0-360), {s,v} in [0-100]

func (HSV) RGBA

func (c HSV) RGBA() (_, _, _, _ uint32)

Jump to

Keyboard shortcuts

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