pngsheet

package module
v0.0.0-...-b7725a0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: LGPL-3.0 Imports: 8 Imported by: 3

README

pngsheet

pngsheet is a PNG file that contains a sprite sheet with animations. It additionally contains two metadata chunks, a supplementary palette in sPLT and an animation control section in zTXt with the keyword fctrl and "compression scheme" 0xFF.

For GBA rips, the sPLT section is expected to contain groups of 16 colors.

The fctrl section is structured as follows:

left:       int16
top:        int16
right:      int16
bottom:     int16
originX:    int16
originY:    int16
delay:      uint8
action:     0x00 "next" | 0x01 "loop" | 0x03 "stop"

Each animation is delimited by a non-"next" action.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFormat = errors.New("invalid format")

Functions

This section is empty.

Types

type Animation

type Animation struct {
	Frames    []*Frame
	IsLooping bool
}

type Frame

type Frame struct {
	Index  int
	Rect   image.Rectangle
	Origin image.Point
}

type Info

type Info struct {
	SuggestedPalettes map[string]color.Palette
	Frames            []*Frame
	Animations        []*Animation
}

func Load

func Load(f io.ReadSeeker) (image.Image, *Info, error)

func LoadInfo

func LoadInfo(f io.Reader) (*Info, error)

Directories

Path Synopsis
tools

Jump to

Keyboard shortcuts

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