Documentation ¶
Overview ¶
Package pix provides models and helpers to work with paletted pixel graphics.
Index ¶
- func ClipNamedUnique(lt *ids.ListTable[ids.Clip, Clip, *Clip], img ids.Img, name string) error
- type Clip
- type ClipTable
- type Color
- type Feat
- type Frame
- type Img
- type ImgTable
- type Mark
- type Pal
- type PalTable
- type Pic
- type PicTable
- type Pix
- type Pixel
- type Spot
- type SpotTable
- type Sys
- func (s *Sys) DelClip(id ids.Clip) error
- func (s *Sys) DelImg(id ids.Img) error
- func (s *Sys) DelPal(id ids.Pal) error
- func (s *Sys) DelSpot(id ids.Spot) error
- func (s *Sys) GetClip(img ids.Img, name string) *Clip
- func (s *Sys) NewClip(req Clip) (*Clip, error)
- func (s *Sys) NewImg(a Img) (*Img, error)
- func (s *Sys) NewPal(name string) (*Pal, error)
- func (s *Sys) NewSpot(a Spot) (*Spot, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clip ¶
type Clip struct { ID ids.Clip `json:"id"` Name string `json:"name"` Img ids.Img `json:"img"` geo.Dim Seq []Frame `json:"seq"` Loop bool `json:"loop,omitempty"` }
Clip is a named sequence of frames for animation.
func (*Clip) MarshalBinary ¶
func (*Clip) UnmarshalBinary ¶
type Color ¶
type Color uint32
func Shades ¶
Shades returns a list of four different shades of the given color. From lightest to darkest: lighter, color, darker and outline
func (Color) MarshalText ¶
func (*Color) UnmarshalText ¶
type Frame ¶
type Frame struct { Pic ids.Pic `json:"pic"` Dur uint `json:"dur,omitempty"` Marks []Mark `json:"marks,omitempty"` }
Frame represents a specific picture for a given duration.
type Img ¶
type Img struct { ID ids.Img `json:"id"` Name string `json:"name"` Kind string `json:"kind"` geo.Dim Pal ids.Pal `json:"pal"` }
func (*Img) MarshalBinary ¶
func (*Img) UnmarshalBinary ¶
type Pal ¶
type Pal struct { ID ids.Pal `json:"id"` Name string `json:"name"` Kind string `json:"kind"` Feats []*Feat `json:"feats"` }
func (*Pal) MarshalBinary ¶
func (*Pal) UnmarshalBinary ¶
type Pic ¶
Pic represents a picture as part of an asset.
func (*Pic) MarshalBinary ¶
func (*Pic) UnmarshalBinary ¶
type Spot ¶
type Spot struct { ID ids.Spot `json:"id"` Name string `json:"name"` Color uint32 `json:"color"` geo.Dim }
func (*Spot) MarshalBinary ¶
func (*Spot) UnmarshalBinary ¶
Click to show internal directories.
Click to hide internal directories.