vec

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: BSD-3-Clause, MIT, Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rasterizer

type Rasterizer struct {
	vector.Rasterizer

	// Dst is the image that the Draw call uses as destination to draw into.
	Dst draw.Image

	// DrawOp is a Porter-Duff compositing operator that will be used for the
	// next call to the Draw method. After that call finishes, DrawOp is set to
	// draw.Over.
	DrawOp draw.Op
}

Rasterizer that wraps an inner "golang.org/x/image/vector" Rasterizer. The dst image normally passed to a call Draw is set as a field so Draw does not have to take it as a parameter.

func NewRasterizer

func NewRasterizer(dst draw.Image) *Rasterizer

NewRasterizer returns a rasterizer for dst image, with the dst size used to reset the inner rasterizer.

func (*Rasterizer) Draw

func (z *Rasterizer) Draw(r image.Rectangle, src image.Image, sp image.Point)

Draw aligns r.Min in field Dst with sp in src and then replaces the rectangle r in Dst with the result of drawing src on Dst. The current value of the DrawOp field is used for drawing. But note, after drawing the DrawOp is reset to draw.Over.

Jump to

Keyboard shortcuts

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