ggfx

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: GPL-3.0 Imports: 3 Imported by: 1

README

ggfx

GGFX is a generic software graphics library that can operate on arrays of pixels, regardless of what type the pixels are. As such, it does not deal with alpha values or blending.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Circle added in v0.3.0

func Circle(resolution int, radius float64, center image.Point) []image.Point

Types

type Image

type Image[T any] struct {
	// Pix is the actual pixel array of the image.
	Pix []T

	// Stride represents the distance in slice elements between two pixels
	// that are vertically adjacent.
	Stride int

	// Width specifies how many slice elements make up a single pixel.
	Width int

	// Rect specifies a rectangle that all drawing operations will be
	// clipped to. It must not reside outside of Data. It is measured in
	// pixels and not slice elements.
	Rect image.Rectangle
}

func (Image[T]) Bounds

func (this Image[T]) Bounds() image.Rectangle

func (Image[T]) FillPolygon

func (this Image[T]) FillPolygon(fill []T, points ...image.Point)

func (Image[T]) FillRectangle

func (this Image[T]) FillRectangle(fill []T, rectangle image.Rectangle)

func (Image[T]) Line

func (this Image[T]) Line(
	stroke []T,
	weight int,
	min image.Point,
	max image.Point,
)

func (Image[T]) PixOffset added in v0.4.0

func (this Image[T]) PixOffset(x, y int) int

func (Image[T]) PolyLine added in v0.3.0

func (this Image[T]) PolyLine(stroke []T, weight int, points ...image.Point)

func (Image[T]) StrokePolygon

func (this Image[T]) StrokePolygon(stroke []T, weight int, points ...image.Point)

func (Image[T]) StrokeRectangle

func (this Image[T]) StrokeRectangle(stroke []T, weight int, rectangle image.Rectangle)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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