Documentation ¶
Overview ¶
Package spr implements decoding of Dark Omen's .SPR sprite files.
The method used in this decoder is based off the method from the Dark Omen Wiki at http://wiki.dark-omen.org/do/DO/Updated_Sprite_Format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads and decodes a sprite from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
type Frame ¶
type Frame struct { // Type provides information about how to interpret the frame image. Type FrameType // Image is the decoded frame data converted into a non-alpha-premultiplied // 32-bit color image. Image *image.NRGBA }
A Frame contains an in-memory representation of the image.
type FrameType ¶
type FrameType uint8
FrameType provides information about how to interpret the frame image.
const ( // FrameTypeRepeat indicates this frame is a repeat of a previous frame. FrameTypeRepeat FrameType = iota // FrameTypeFlipHorizontally indicates this frame should be flipped // horizontally. FrameTypeFlipHorizontally // FrameTypeFlipVertically indicates this frame should be flipped // vertically. FrameTypeFlipVertically // FrameTypeFlipHorizontallyAndVertically indicates this frame should be // flipped horizontally and vertically. FrameTypeFlipHorizontallyAndVertically // FrameTypeNormal indicates this is a normal frame. FrameTypeNormal // FrameTypeEmpty indicates the frame is empty. // There is no frame or palette data associated with this frame. // The frame's width and height are 0. FrameTypeEmpty )
Click to show internal directories.
Click to hide internal directories.