go-sdl2: github.com/veandco/go-sdl2/raster Index | Files

package raster

import "github.com/veandco/go-sdl2/raster"

Package raster implements a Painter interface for rasterizing paths over a generic Image, using its ColorModel to convert from a generic raster color to the correct color model.

Index

Package Files

painter.go

type ImagePainter Uses

type ImagePainter struct {
    Image draw.Image
    // contains filtered or unexported fields
}

ImagePainter operates on a generic Image (not only sdl.Surfaces) and allows to rasterize a path using a specific color.

func NewImagePainter Uses

func NewImagePainter(m draw.Image) *ImagePainter

NewImagePainter builds a Painter for a generic Image

func (*ImagePainter) Paint Uses

func (p *ImagePainter) Paint(ss []raster.Span, done bool)

Paint a batch of Spans using the current ImagePainter image and color. Image's Color model will be used to convert the color.

func (*ImagePainter) SetColor Uses

func (p *ImagePainter) SetColor(c color.Color)

SetColor set the color to use when rasterizing

Package raster imports 3 packages (graph). Updated 2018-12-11. Refresh now. Tools for package owners.