gfx

package module
v0.0.0-...-513dc49 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2019 License: MIT Imports: 17 Imported by: 20

README

gfx

Graphic Drawing Library for simple demo effects.

See github.com/klauspost/gad for usage and more information.

NOTICE

This library may change at any time.

It does not provide any compatibility guarentees.

If you use this, be sure to vendor it by copying it.

You have been warned.

LICENSE

The code here is released under a standard MIT license. See LICENSE file for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddData

func AddData(fn LoadFn)

AddData will add a data loader.

func Fullscreen

func Fullscreen(b bool)

func InitGreyPalette

func InitGreyPalette(p [256]uint32)

func InitShadedPalette

func InitShadedPalette(neutral int, rgb color.RGBA)

InitGreyShadedPalette will initialize a palette that goes from black -> neutral -> white. Specify the palette index where the color should be the supplied value.

func Load

func Load(file string) ([]byte, error)

func LoadGreyPicture

func LoadGreyPicture(path string) (*image.Gray, error)

func LoadPalPicture

func LoadPalPicture(path string) (*image.Paletted, error)

func QueryPerformanceCounter

func QueryPerformanceCounter() (int64, error)

func QueryPerformanceFreq

func QueryPerformanceFreq() (int64, error)

func Run

func Run(fn func())

func RunTimed

func RunTimed(effect TimedEffect)

func RunTimedDur

func RunTimedDur(effect TimedEffect, duration time.Duration)

func RunTimedMusic

func RunTimedMusic(effect TimedEffect, musicFile string)

func RunWriteToDisk

func RunWriteToDisk(fx TimedEffect, n int, path string)

func SetRenderSize

func SetRenderSize(w, h int)

func ToGray

func ToGray(img image.Image) *image.Gray

Types

type LoadFn

type LoadFn func(name string) ([]byte, error)

type MusicPlayer

type MusicPlayer interface {
	Start(func(duration time.Duration))
	Pos() time.Duration
}

type Options

type Options struct {
	ScreenSize image.Rectangle
}

type ProgressiveEffect

type ProgressiveEffect interface {
	Reset(o Options)
	Render() image.Image
}

type TimedEffect

type TimedEffect interface {
	Render(t float64) image.Image
}

Jump to

Keyboard shortcuts

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