draw

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package draw provides provides image composition functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box

func Box(dst Image, rect image.Rectangle, c color.Color)

Box draws a filled rectangle.

func Draw

func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)

Draw calls draw.Draw Draw calls DrawMask with a nil mask.

func DrawMask

func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)

DrawMask aligns r.Min in dst with sp in src and mp in mask and then replaces the rectangle r in dst with the result of a Porter-Duff composition. A nil mask is treated as opaque.

func HorizontalLine

func HorizontalLine(dst Image, x, y, w int, c color.Color)

HorizontalLine draws a line between (x,y) and (x+w,y).

func Line

func Line(dst Image, a, b image.Point, c color.Color)

Line draws a line between two points.

func Rectangle

func Rectangle(dst Image, rect image.Rectangle, c color.Color)

Rectangle draws a rectangle.

func RoundedBox

func RoundedBox(dst Image, rect image.Rectangle, radius int, c color.Color)

RoundedBox draws a filled rectangle with radius pixels rounded corners.

func RoundedRectangle

func RoundedRectangle(dst Image, rect image.Rectangle, radius int, c color.Color)

RoundedRectangle draws a rectangle with radius pixels rounded corners.

func VerticalLine

func VerticalLine(dst Image, x, y, h int, c color.Color)

VerticalLine draws a line between (x,y) and (x,y+h).

Types

type Drawer

type Drawer = draw.Drawer

Drawer is an alias for image/draw.Drawer.

type Image

type Image = draw.Image

Image is an alias for image/draw.Image.

type Op

type Op = draw.Op

Op is an alias for image/draw.Op

const (
	// Over specifies “(src in mask) over dst”.
	Over Op = iota

	// Src specifies “src in mask”.
	Src
)

Jump to

Keyboard shortcuts

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