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
- type Slice
- func (receiver Slice) At(x, y int) color.Color
- func (receiver Slice) Bounds() image.Rectangle
- func (receiver Slice) ColorModel() color.Model
- func (receiver Slice) Draw(img image.Image) error
- func (receiver Slice) Dye(c color.Color) error
- func (receiver Slice) PixOffset(x int, y int) int
- func (receiver Slice) Set(x, y int, c color.Color)
- func (receiver Slice) String() string
Constants ¶
const ( Width = 256 Height = 288 Depth = rgba32.ByteSize )
const ByteSize = Width * Height * Depth
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slice ¶
type Slice []uint8
func (Slice) ColorModel ¶
func (Slice) Set ¶
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 ¶
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.