Documentation ¶
Index ¶
- func DecodeAseString(r io.Reader) string
- func EncodeAseString(w io.Writer, str string)
- type AsepriteCelChunk2005
- type AsepriteCelExtraChunk2006
- type AsepriteCodec
- type AsepriteColorProfileChunk2007
- type AsepriteExternalFilesChunk2008
- type AsepriteExternalFilesChunk2008Entry
- type AsepriteFile
- type AsepriteFrame
- type AsepriteHeader
- type AsepriteLayerChunk2004
- type AsepriteMaskChunk2016
- type AsepriteOldPaletteChunk0004
- type AsepriteOldPaletteChunk0004Packet
- type AsepritePaletteChunk0011
- type AsepritePaletteChunk0011Packet
- type AsepritePaletteChunk2019
- type AsepritePaletteChunk2019Entry
- type AsepritePathChunk2017
- type AsepriteRGB24
- type AsepriteSliceChunk2022
- type AsepriteSliceChunk2022Data
- type AsepriteTagsChunk2018
- type AsepriteTagsChunk2018Tag
- type AsepriteTilesetChunk2023
- type AsepriteUserDatHolder
- type AsepriteUserDataChunk2020
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAseString ¶
func EncodeAseString ¶
Types ¶
type AsepriteCelChunk2005 ¶
type AsepriteCelChunk2005 struct { LayerIndex uint16 X, Y int16 OpacityLevel byte CelType uint16 // + For cel type = 0 (Raw Image Data) WidthInPix, HeightInPix uint16 RawPixData []byte // + For cel type = 1 (Linked Cel) FramePosToLinkWith uint16 // + For cel type = 2 (Compressed Image) // WORD Width in pixels // WORD Height in pixels RawCelData []byte // "Raw Cel" data decompressed from ZLIB (see NOTE.3) // + For cel type = 3 (Compressed Tilemap) WidthInTiles, HeightInTiles uint16 BitsPerTile uint16 // (at the moment it's always 32-bit per tile) BitMaskForTileID uint32 // (e.g. 0x1fffffff for 32-bit tiles) BitMaskForXFlip uint32 BitMaskForYFlip uint32 BitMaskFor90CWRot uint32 Tiles []byte // zlib data (see NOTE.3) Extra *AsepriteCelExtraChunk2006 // contains filtered or unexported fields }
func (*AsepriteCelChunk2005) Decode ¶
func (aseCelChunk *AsepriteCelChunk2005) Decode(r io.Reader)
func (*AsepriteCelChunk2005) Encode ¶
func (aseCelChunk *AsepriteCelChunk2005) Encode(w io.Writer)
type AsepriteCelExtraChunk2006 ¶
type AsepriteCelExtraChunk2006 struct { Flags uint32 PreciseX, PreciseY uint32 WidthCelInSprite uint32 HeightCelInSprite uint32 // contains filtered or unexported fields }
*
- Cel Extra Chunk (0x2006)
- Adds extra information to the latest read cel. *
- DWORD Flags (set to zero)
- 1 = Precise bounds are set
- FIXED Precise X position
- FIXED Precise Y position
- FIXED Width of the cel in the sprite (scaled in real-time)
- FIXED Height of the cel in the sprite
- BYTE[16] For future use (set to zero)
func (*AsepriteCelExtraChunk2006) Decode ¶
func (aseCelExtra *AsepriteCelExtraChunk2006) Decode(r io.Reader)
func (*AsepriteCelExtraChunk2006) Encode ¶
func (aseCelExtra *AsepriteCelExtraChunk2006) Encode(w io.Writer)
type AsepriteColorProfileChunk2007 ¶
type AsepriteColorProfileChunk2007 struct { Type uint16 Flags uint16 FixedGamma uint32 // + If type = ICC: ICCProfileDatLen uint32 ICCProfileDat []byte // contains filtered or unexported fields }
func (*AsepriteColorProfileChunk2007) Decode ¶
func (aseColProfile *AsepriteColorProfileChunk2007) Decode(r io.Reader)
func (AsepriteColorProfileChunk2007) Encode ¶
func (aseColProfile AsepriteColorProfileChunk2007) Encode(w io.Writer)
type AsepriteExternalFilesChunk2008 ¶
type AsepriteExternalFilesChunk2008 struct { NumEntries uint32 // + for each entry ExternalFile []AsepriteExternalFilesChunk2008Entry // contains filtered or unexported fields }
func (*AsepriteExternalFilesChunk2008) Decode ¶
func (aseExtFile *AsepriteExternalFilesChunk2008) Decode(r io.Reader)
func (*AsepriteExternalFilesChunk2008) Encode ¶
func (aseExtFile *AsepriteExternalFilesChunk2008) Encode(w io.Writer)
type AsepriteFile ¶
type AsepriteFile struct { Header AsepriteHeader Frames []AsepriteFrame }
func (*AsepriteFile) DecodeFile ¶
func (aseFile *AsepriteFile) DecodeFile(fName string) error
func (*AsepriteFile) Encode ¶
func (aseFile *AsepriteFile) Encode(w io.Writer)
type AsepriteFrame ¶
type AsepriteFrame struct { BytesThisFrame uint32 MagicNumber uint16 // F1FA ChunksThisFrame uint16 // If this value is FFFF there "may" be more chunks to read FrameDurationMilliseconds uint16 ChunksThisFrameExt uint32 // New field which specifies num chunks. If 0, use old field OldPalettes0004 []AsepriteOldPaletteChunk0004 OldPalettes0011 []AsepritePaletteChunk0011 Layers []AsepriteLayerChunk2004 Cels []AsepriteCelChunk2005 ColorProfiles []AsepriteColorProfileChunk2007 Tags AsepriteTagsChunk2018 Palettes []AsepritePaletteChunk2019 Slices []AsepriteSliceChunk2022 // contains filtered or unexported fields }
func (AsepriteFrame) Encode ¶
func (aseFrame AsepriteFrame) Encode(w io.Writer)
type AsepriteHeader ¶
type AsepriteHeader struct { FileSize uint32 MagicNumber uint16 // A5E0 Frames uint16 WidthInPixels uint16 HeightInPixels uint16 ColorDepth uint16 Flags uint32 Speed uint16 // deprecated, use frame duration from frame header PaletteEntry byte // represents transparent color in all non-background layers (only for indexed sprites) NumberOfColors uint16 // (pixel ratio is "pxel width/pixel height") PixelWidth, PixelHeight byte XPositionOfGrid int16 YPositionOfGrid int16 GridWidth, GridHeight uint16 // contains filtered or unexported fields }
func (*AsepriteHeader) Encode ¶
func (aseHeader *AsepriteHeader) Encode(w io.Writer)
type AsepriteLayerChunk2004 ¶
type AsepriteLayerChunk2004 struct { Flags uint16 LayerType uint16 LayerChildLevel uint16 DefLayerWidthPixels uint16 // (ignored) DefLayerHeightPixels uint16 // (ignored) BlendMode uint16 Opacity byte // only valid if file headre flag field has bit 1 set LayerName string // + if layer type = 2 TilesetIndex uint32 UserData AsepriteUserDataChunk2020 // contains filtered or unexported fields }
func (*AsepriteLayerChunk2004) AddUserData ¶
func (layer *AsepriteLayerChunk2004) AddUserData(userData AsepriteUserDataChunk2020)
func (*AsepriteLayerChunk2004) Decode ¶
func (aseLayerChunk *AsepriteLayerChunk2004) Decode(r io.Reader) error
func (AsepriteLayerChunk2004) Encode ¶
func (aseLayerChunk AsepriteLayerChunk2004) Encode(w io.Writer)
type AsepriteMaskChunk2016 ¶
type AsepriteMaskChunk2016 struct {
X, Y int16
Width, Height uint16
MaskName string
BitMapData []byte
// contains filtered or unexported fields
}
func (*AsepriteMaskChunk2016) Decode ¶
func (aseMask *AsepriteMaskChunk2016) Decode(r io.Reader)
func (*AsepriteMaskChunk2016) Encode ¶
func (aseMask *AsepriteMaskChunk2016) Encode(w io.Writer)
type AsepriteOldPaletteChunk0004 ¶
type AsepriteOldPaletteChunk0004 struct { NumberOfPackets uint16 // + for each packet Packets []AsepriteOldPaletteChunk0004Packet }
*
- Then each chunk format is:
- DWORD Chunk size
- WORD Chunk type
- BYTE[] Chunk data *
- ----------------- *
- Ignore this chunk if you find the new palette chunk (0x2019) Aseprite v1.1 saves both chunks 0x0004 and 0x2019 just for backward compatibility.
- WORD Number of packets
- + For each packet
- BYTE Number of palette entries to skip from the last packet (start from 0)
- BYTE Number of colors in the packet (0 means 256)
- + For each color in the packet
- BYTE Red (0-255)
- BYTE Green (0-255)
- BYTE Blue (0-255)
func (*AsepriteOldPaletteChunk0004) Decode ¶
func (asePaletteChunk *AsepriteOldPaletteChunk0004) Decode(r io.Reader)
func (AsepriteOldPaletteChunk0004) Encode ¶
func (asePaletteChunk AsepriteOldPaletteChunk0004) Encode(w io.Writer)
type AsepriteOldPaletteChunk0004Packet ¶
type AsepriteOldPaletteChunk0004Packet struct { NumPalletteEntriesToSkip byte // from thee last packet (start from 0) NumColorsInThePacket byte // 0 means 256 // + for each color in the packet Colors []AsepriteRGB24 }
type AsepritePaletteChunk0011 ¶
type AsepritePaletteChunk0011 struct { NumberOfPackets uint16 // + for each packet Packets []AsepritePaletteChunk0011Packet }
func (*AsepritePaletteChunk0011) Decode ¶
func (asePaletteChunk *AsepritePaletteChunk0011) Decode(r io.Reader)
func (AsepritePaletteChunk0011) Encode ¶
func (asePaletteChunk AsepritePaletteChunk0011) Encode(w io.Writer)
type AsepritePaletteChunk0011Packet ¶
type AsepritePaletteChunk0011Packet struct { NumPalletteEntriesToSkip byte // start from 0 NumColorsInThePacket byte // 0 means 256 // + for each color in the packet Colors []AsepriteRGB24 // but using colors in the range 0-63 }
type AsepritePaletteChunk2019 ¶
type AsepritePaletteChunk2019 struct { PaletteSize uint32 FirstColIndexToChange uint32 LastColIndexToChange uint32 // + For each palette entry in [from,to] range (to-from+1 entries) PaletteEntries []AsepritePaletteChunk2019Entry // contains filtered or unexported fields }
func (*AsepritePaletteChunk2019) Decode ¶
func (asePaletteChunk *AsepritePaletteChunk2019) Decode(r io.Reader)
func (AsepritePaletteChunk2019) Encode ¶
func (asePaletteChunk AsepritePaletteChunk2019) Encode(w io.Writer)
type AsepritePaletteChunk2019Entry ¶
type AsepritePaletteChunk2019Entry struct { EntryFlags uint16 R, G, B, A byte // + If has name bit in entry flags ColorName string }
func (*AsepritePaletteChunk2019Entry) Decode ¶
func (asePaletteEntry *AsepritePaletteChunk2019Entry) Decode(r io.Reader)
func (AsepritePaletteChunk2019Entry) Encode ¶
func (asePaletteEntry AsepritePaletteChunk2019Entry) Encode(w io.Writer)
type AsepritePathChunk2017 ¶
type AsepritePathChunk2017 struct{}
type AsepriteSliceChunk2022 ¶
type AsepriteSliceChunk2022 struct { NumSliceKeys uint32 Flags uint32 Name string // + For each slice key SliceKeysData []AsepriteSliceChunk2022Data UserData AsepriteUserDataChunk2020 // contains filtered or unexported fields }
func (*AsepriteSliceChunk2022) AddUserData ¶
func (sliceChunk *AsepriteSliceChunk2022) AddUserData(userDat AsepriteUserDataChunk2020)
func (*AsepriteSliceChunk2022) Decode ¶
func (aseSlice *AsepriteSliceChunk2022) Decode(r io.Reader)
func (AsepriteSliceChunk2022) Encode ¶
func (aseSlice AsepriteSliceChunk2022) Encode(w io.Writer)
type AsepriteSliceChunk2022Data ¶
type AsepriteSliceChunk2022Data struct { FrameNumber uint32 SliceXOriginCoords int32 SliceYOriginCoords int32 SliceWidth, SliceHeight uint32 // + If flags have bit 1 CenterX, CenterY int32 CenterWidth, CenterHeight uint32 // + If flags have bit 2 PivotX, PivotY int32 // contains filtered or unexported fields }
func (*AsepriteSliceChunk2022Data) Decode ¶
func (aseSliceDat *AsepriteSliceChunk2022Data) Decode(r io.Reader)
func (AsepriteSliceChunk2022Data) Encode ¶
func (aseSliceDat AsepriteSliceChunk2022Data) Encode(w io.Writer)
type AsepriteTagsChunk2018 ¶
type AsepriteTagsChunk2018 struct { NumTags uint16 Tags []AsepriteTagsChunk2018Tag UserData []AsepriteUserDataChunk2020 // contains filtered or unexported fields }
*
- Tags Chunk (0x2018)
- After the tags chunk, you can write one user data chunk for each tag. E.g. if there are 10 tags, you can then write 10 user data chunks one for each tag. *
- WORD Number of tags
- BYTE[8] For future (set to zero)
- + For each tag
- WORD From frame
- WORD To frame
- BYTE Loop animation direction
- 0 = Forward
- 1 = Reverse
- 2 = Ping-pong
- BYTE[8] For future (set to zero)
- BYTE[3] RGB values of the tag color
- Deprecated, used only for backward compatibility with Aseprite v1.2.x
- The color of the tag is the one in the user data field following
- the tags chunk
- BYTE Extra byte (zero)
- STRING Tag name
func (*AsepriteTagsChunk2018) AddUserData ¶
func (tagsChunk *AsepriteTagsChunk2018) AddUserData(userDat AsepriteUserDataChunk2020)
func (*AsepriteTagsChunk2018) Decode ¶
func (aseTags *AsepriteTagsChunk2018) Decode(r io.Reader)
func (AsepriteTagsChunk2018) Encode ¶
func (aseTags AsepriteTagsChunk2018) Encode(w io.Writer)
type AsepriteTagsChunk2018Tag ¶
type AsepriteTagsChunk2018Tag struct {
FromFrame, ToFrame uint16
LoopAnimDirection byte
TagColor [3]byte // deprecated
ExtraByte byte // (zero)
TagName string
// contains filtered or unexported fields
}
func (*AsepriteTagsChunk2018Tag) Decode ¶
func (aseTag *AsepriteTagsChunk2018Tag) Decode(r io.Reader)
func (AsepriteTagsChunk2018Tag) Encode ¶
func (aseTag AsepriteTagsChunk2018Tag) Encode(w io.Writer)
type AsepriteTilesetChunk2023 ¶
type AsepriteTilesetChunk2023 struct { TilesetID uint32 Flags uint32 NumTiles uint32 TileWidth, TileHeight uint16 BaseIndex int16 Name string // + If flag 1 is set ExternalFileID uint32 TilesetIDInExternalFile uint32 // + If flag 2 is set CompressedDatLen uint32 CompressedTilesetImg []byte // contains filtered or unexported fields }
func (*AsepriteTilesetChunk2023) Decode ¶
func (aseTileset *AsepriteTilesetChunk2023) Decode(r io.Reader)
type AsepriteUserDatHolder ¶
type AsepriteUserDatHolder interface {
AddUserData(AsepriteUserDataChunk2020)
}
type AsepriteUserDataChunk2020 ¶
type AsepriteUserDataChunk2020 struct { Flags uint32 // + If flags have bit 1 Text string // + If flags have bit 2 R, G, B, A byte }
func (*AsepriteUserDataChunk2020) Decode ¶
func (aseUserDat *AsepriteUserDataChunk2020) Decode(r io.Reader)
func (AsepriteUserDataChunk2020) Encode ¶
func (aseUserDat AsepriteUserDataChunk2020) Encode(w io.Writer)
Click to show internal directories.
Click to hide internal directories.