imageutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 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 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, src image.Image, r *image.Rectangle)

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, mp image.Point,
	op draw.Op,
)

func FillRectangle

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

func IntRGBA

func IntRGBA(u int) color.RGBA

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 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 ToBGRAColor

func ToBGRAColor(c color.Color) color.RGBA

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) RGBAImageWithCorrectedColor

func (img *BGRA) RGBAImageWithCorrectedColor(c color.Color) (*image.RGBA, color.Color)

Allows using rgba image for other functions that rely on detection to use faster draw lanes (ex: draw.Draw)

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