cl-aseprite
0.1.2Aseprite file format parser
System Information
Definition Index
-
CL-ASEPRITE
- ASEPRITE
- ASE
NOTE: this software is of alpha quality, and the API is subject to change.
cl-asepriteis a high-performance Common Lisp library for parsing.asepritefiles created with Aseprite and LibreSprite programs into meaningful Lisp structures.Aseprite is a proprietary image editor designed for pixel art drawing and animation. It was used in the development of several notable games such as Celeste, Loop Hero, and many others (source: Wikipedia).
LibreSprite is a free and open source fork of Aseprite created after its license changed from GPLv2 to proprietary in 2016.
Key part of the library is
LOAD-SPRITEfunction, which returnsSPRITEstructure, which in turn contains lists ofTAGandLAYERstructures with latter having an array ofCELstructures. See Aseprite docs for details on those entities.In most cases,
CEL'sDATAfield contains an array of 32-bit ABGR pixel data, so to convert it to image just copy it usingCFFIinto proper container, e.g. to the result of call to al_lock_bitmap when using cl-liballegro.-
EXTERNAL STRUCTURE CEL
Representation of cel.
DURATION: duration in millisecondsX: x position of cel dataY: y position of cel dataOPACITY: opacity levelZ-INDEX: z-indexTYPE: one of:IMAGE,:LINKEDor:TILEMAPUSER-DATA: user data stringWIDTH: width in pixels (for:IMAGEtype) or in tiles (for:TILEMAPtype)HEIGHT: height in pixels (for:IMAGEtype) or in tiles (for:TILEMAPtype)DATA: raw data, only for:IMAGEand:TILEMAPtypesFRAME-POSITION: frame position to link with (only for:LINKEDtype)ID-BITMASK: bitmask for tile ID (only for:TILEMAPtype)X-FLIP-BITMASK: bitmask for X flip (only for:TILEMAPtype)Y-FLIP-BITMASK: bitmask for Y flip (only for:TILEMAPtype)DIAGONAL-FLIP-BITMASK: bitmask for diagonal flip (only for:TILEMAPtype)
-
EXTERNAL STRUCTURE LAYER
Representation of layer.
VISIBLEP: whether layer is visibleBACKGROUNDP: whether layer is background layerCONTINUOUSP: whether layer is continuous (prefers linked cels)REFERENCEP: whether layer is reference layerTYPE: one of:IMAGE,:GROUPor:TILEMAPCHILD-LEVEL: relationship with next layer in layers list, see hereBLEND-MODE: keyword indicating blend modeOPACITY: layer opacity. only valid ifSPRITE-HAS-OPACITY-PisTTILESET-INDEX: only for:TILEMAPtypeUSER-DATA: user data stringCELS: array ofCELs, indices correspond to frame numbers
-
EXTERNAL STRUCTURE SPRITE
Representation of sprite.
WIDTH: width in pixelsHEIGHT: height in pixelsCOLOR-DEPTH: color depth in bits per pixel, could be 32 (ABGR), 16 (grayscale) or 8 (indexed)COLOR-PROFILE::SRGBorNIL(corresponding to "None")HAS-OPACITY-P: whether there is opaque colorTRANSPARENT-INDEX: palette entry index for transparent color (only for indexed sprites)COLORS: number of colorsPALETTE: palette as an array of packed ABGR valuesPIXEL-RATIO: pixel width/pixel heightUSER-DATA: user data stringFRAMES: number of frames in each layerLAYERS: plist of spriteLAYERs in reversed orderTAGS: plist of frameTAGs
-
EXTERNAL STRUCTURE TAG
Representation of tag.
FIRST-FRAME: index of first tagged frameLAST-FRAME: index of last tagged frameDIRECTION: one of:FORWARD,:REVERSE,:PING-PONGor:PING-PONG-REVERSEREPEAT: repeat N times. 0 means infinite, 1 once etc.USER-DATA: user data string
-
EXTERNAL FUNCTION LOAD-SPRITE
- FILESPEC
Loads Aseprite file from given
FILESPEC, either path or binary stream.See
SPRITE.