frame256x288

package module
v0.0.0-...-3f33977 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 10 Imported by: 1

README

go-frame256x288

Package frame256x288 provides a type that represents a 256x288 graphic frame, consisting of 73,728 (= 256 x 288) RGBA color with 8-bits per color channel, for a total of 294,912-bytes altogether, that seamlessly works with Go's built-in "image", "image/color", and "image/draw" packages.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-frame256x288

GoDoc

Documentation

Overview

Package frame256x288 provides a type that represents a 256x288 graphic frame, consisting of 73,728 (= 256 x 288) RGBA color with 8-bits per color channel, for a total of 294,912-bytes altogether, that seamlessly works with Go's built-in "image", "image/color", and "image/draw" packages.

Index

Constants

View Source
const (
	Width  = 256
	Height = 288
	Depth  = rgba32.ByteSize
)
View Source
const ByteSize = Width * Height * Depth

Variables

This section is empty.

Functions

This section is empty.

Types

type Slice

type Slice []uint8

func (Slice) At

func (receiver Slice) At(x, y int) color.Color

func (Slice) Bounds

func (receiver Slice) Bounds() image.Rectangle

func (Slice) ColorModel

func (receiver Slice) ColorModel() color.Model

func (Slice) Draw

func (receiver Slice) Draw(img image.Image) error

func (Slice) Dye

func (receiver Slice) Dye(c color.Color) error

Dye changes the color of all the pixels / pels in this from to ‘color’.

func (Slice) PixOffset

func (receiver Slice) PixOffset(x int, y int) int

func (Slice) Set

func (receiver Slice) Set(x, y int, c color.Color)

Set helps Slice fit the Go built-in draw.Image interface.

Set will change the color of the pixel / pel, in this frame, at (‘x’,‘y’) to ‘color’.

func (Slice) String

func (receiver Slice) String() string

String returns frame serialized in “IMAGE:<base64-encoded-png>” format.

The usefulness of this serialized format is, if you just output that on the Go Playground — https://play.golang.org/ — then it will display it as an image.

Jump to

Keyboard shortcuts

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