Documentation ¶
Index ¶
- type Acell
- type Animation
- type Frame
- type Header
- type NANR
- type NARC
- func (narc *NARC) FileCount() int
- func (narc *NARC) Open(n int) (readerSize, error)
- func (narc *NARC) OpenNANR(n int) (*NANR, error)
- func (narc *NARC) OpenNCER(n int) (*NCER, error)
- func (narc *NARC) OpenNCGR(n int) (*NCGR, error)
- func (narc *NARC) OpenNCLR(n int) (*NCLR, error)
- func (narc *NARC) OpenNMAR(n int) (*NMAR, error)
- func (narc *NARC) OpenNMCR(n int) (*NMCR, error)
- func (narc *NARC) OpenRaw(n int) (*io.SectionReader, error)
- type NCER
- type NCGR
- func (ncgr *NCGR) Bounds() image.Rectangle
- func (ncgr *NCGR) Decrypt()
- func (ncgr *NCGR) DecryptReverse()
- func (ncgr *NCGR) Image(pal color.Palette) *image.Paletted
- func (ncgr *NCGR) IsTiled() bool
- func (ncgr *NCGR) Pixels() []byte
- func (ncgr *NCGR) Tile(i, w, h int, pal color.Palette) image.Image
- func (ncgr *NCGR) TiledImage(pal color.Palette) *Tiled
- type NCLR
- type NMAR
- type NMCR
- type RGB15
- type ReadSeekerAt
- type Tiled
- func (t *Tiled) At(x, y int) color.Color
- func (t *Tiled) Bounds() image.Rectangle
- func (t *Tiled) ColorIndexAt(x, y int) uint8
- func (t *Tiled) ColorModel() color.Model
- func (t *Tiled) PixOffset(x, y int) int
- func (t *Tiled) Set(x, y int, c color.Color)
- func (t *Tiled) SetColorIndex(x, y int, index uint8)
- func (t *Tiled) Tile(n, width, height int) *Tiled
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acell ¶
type Acell struct { LoopStart int PlayMode int // invalid, forward, forward loop, forward-reverse, forward-reverse loop Frames []Frame }
An animated cell.
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
func NewAnimation ¶
type Frame ¶
type Frame struct { Duration int // 60 fps Cell int Rotate uint16 // angle in units of (tau/65536) radians ScaleX int32 // in units of 1/4096 ScaleY int32 // in units of 1/4096 X int Y int }
A frame of an animated cell.
type Header ¶
type Header struct { Magic [4]byte BOM uint16 Version uint16 Size uint32 HeaderSize uint16 ChunkCount uint16 }
A Header is the common header used in all nitro formats.
type NANR ¶
type NANR struct { Cells []Acell // contains filtered or unexported fields }
An NANR (nitro animation resource) sequences cells into animations.
type NARC ¶
type NARC struct {
// contains filtered or unexported fields
}
An NARC (nitro archive) holds files.
func ReadNARC ¶
func ReadNARC(r ReadSeekerAt) (*NARC, error)
TODO: Rewrite to only need io.ReaderAt?
func (*NARC) Open ¶
Open opens the nth file in the archive. It will attempt to decompress compressed files.
type NCER ¶
type NCER struct {
// contains filtered or unexported fields
}
An NCER (nitro cell resource) describes a bank of cells. Cells define subregions of an NCGR.
type NCGR ¶
type NCGR struct { Data []byte // contains filtered or unexported fields }
An NCGR (nitro character graphic resource) stores pixel data.
func (*NCGR) Decrypt ¶
func (ncgr *NCGR) Decrypt()
Decrypt decrypts the pixel data in the NCGR. This method is used for Pokémon and trainer sprites in D/P and HG/SS.
func (*NCGR) DecryptReverse ¶
func (ncgr *NCGR) DecryptReverse()
DecryptReverse decrypts the pixel data in the NCGR. This method is used for Pokémon sprites in Pt.
type NCLR ¶
type NCLR struct { Colors []RGB15 // contains filtered or unexported fields }
An NCLR (nitro color resource) defines a color palette.
type NMCR ¶
type NMCR struct {
// contains filtered or unexported fields
}
A NMCR (nitro multi cell resource) composes animated cells.
type RGB15 ¶
type RGB15 uint16
RGB15 represents a 15-bit color.Color, having five bits each of red, green, and blue.
type Tiled ¶
type Tiled struct { Pix []uint8 Stride int // number of tiles per row Rect image.Rectangle Palette color.Palette }
Tiled is an image.Image whose pixels are stored as a sequence of 8x8 tiles. Since it is conceptually one-dimensional, its bounds may be undefined.
func (*Tiled) ColorIndexAt ¶
func (*Tiled) ColorModel ¶
func (*Tiled) SetColorIndex ¶
func (*Tiled) Tile ¶
Tile returns an image representing a portion of t. The upper left tile of the returned image will be the nth tile in t, and the tiles following the nth tile will fill the remaining width and height of the returned image from left to right, top to bottom. The returned value shares pixels with the original image.