raster

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package raster provides 2D raster drawing primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlendPixel

func BlendPixel(img *image.RGBA, x, y int, c color.RGBA)

BlendPixel alpha-blends a color onto an existing pixel.

func Dot

func Dot(img *image.RGBA, cx, cy, r int, c color.RGBA)

Dot draws a small filled circle.

func FillQuad

func FillQuad(img *image.RGBA, q [4]Vec2, c color.RGBA)

FillQuad fills a convex quadrilateral using scanline.

func Label

func Label(img *image.RGBA, cx, cy int, text string, c color.RGBA)

Label draws a bitmap label (3x5 font, scaled 2x).

func Line

func Line(img *image.RGBA, x0, y0, x1, y1 int, c color.RGBA)

Line draws an anti-aliased line between integer coordinates.

func LineAA

func LineAA(img *image.RGBA, x0, y0, x1, y1 float64, c color.RGBA)

LineAA draws an anti-aliased line using Xiaolin Wu's algorithm.

func PointInQuad

func PointInQuad(px, py float64, q [4]Vec2) bool

PointInQuad checks if point (px, py) is inside a quadrilateral.

func QuadOutline

func QuadOutline(img *image.RGBA, q [4]Vec2, c color.RGBA)

QuadOutline draws the outline of a quadrilateral with anti-aliased lines.

Types

type Vec2

type Vec2 struct {
	X, Y float64
}

Vec2 is a 2D point.

Jump to

Keyboard shortcuts

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