imageutil

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 7 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 added in v1.3.0

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 Complement added in v1.3.7

func Complement(c color.RGBA) color.RGBA

func DrawCopy

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

func DrawMask added in v1.3.0

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 Invert added in v1.3.7

func Invert(c color.RGBA) color.RGBA

func Invert2 added in v1.3.7

func Invert2(c color.RGBA) 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 NewLinearInvertFn added in v1.3.7

func NewLinearInvertFn(v1, v2 float64) func(color.RGBA) color.RGBA

NOTE: https://www.pyimagesearch.com/2015/10/05/opencv-gamma-correction/

func NewLinearInvertFn2 added in v1.3.7

func NewLinearInvertFn2(v1, v2 float64) func(color.Color) color.Color

func PaintShadow

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

maxColorDiff in [0.0, 1.0]

func RgbaColor added in v1.3.0

func RgbaColor(c color.Color) color.RGBA

func RgbaFromInt added in v1.3.0

func RgbaFromInt(u int) color.RGBA

func RgbaToInt added in v1.3.7

func RgbaToInt(c color.RGBA) int

func Shade

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

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

func SprintRgb added in v1.3.0

func SprintRgb(c color.Color) string

func SprintRgbaHex added in v1.3.7

func SprintRgbaHex(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 GammaTable added in v1.3.7

type GammaTable struct {
	Table [256]uint8
}

func NewGammaTable added in v1.3.7

func NewGammaTable(gamma float64) *GammaTable

func (*GammaTable) Lookup added in v1.3.7

func (g *GammaTable) Lookup(c color.RGBA) color.RGBA

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