AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Data Structures | Macros | Typedefs | Enumerations | Functions
gif_pipeline.h File Reference

High-level animation assembly and LZW GIF compilation pipeline. More...

#include "common.h"
#include "ncer.h"
#include "nanr.h"
#include "nmcr.h"
#include "nmar.h"
#include "ncgr.h"
#include "nclr.h"
#include "coords.h"

Go to the source code of this file.

Data Structures

struct  GifExportOptions
 Detailed parameters configuring animation exporting behavior. More...
 

Macros

#define GIF_PATH_BUFFER_SIZE   4096
 

Typedefs

typedef enum GifSideMode GifSideMode
 Sprite perspective/camera rendering selection. More...
 
typedef enum GifPaletteMode GifPaletteMode
 Color variant selection. More...
 
typedef enum GifEyeMode GifEyeMode
 Unused/legacy eye blinking rendering selection. More...
 
typedef struct GifExportOptions GifExportOptions
 Detailed parameters configuring animation exporting behavior. More...
 

Enumerations

enum  GifSideMode { GIF_SIDE_FRONT , GIF_SIDE_BACK , GIF_SIDE_BOTH }
 Sprite perspective/camera rendering selection. More...
 
enum  GifPaletteMode { GIF_PALETTE_NORMAL , GIF_PALETTE_SHINY , GIF_PALETTE_BOTH }
 Color variant selection. More...
 
enum  GifEyeMode { GIF_EYE_OPEN , GIF_EYE_ALL }
 Unused/legacy eye blinking rendering selection. More...
 

Functions

void GifExportOptions_Init (GifExportOptions *options)
 Initializes default values for a GifExportOptions structure. More...
 
int GifPipeline_ExportIdle (const char *out_dir, const char *side_name, const char *animation_name, const char *palette_name, const NcerFile *ncer, const NanrFile *nanr, const NmcrFile *nmcr, const NmarFile *nmar, const NcgrImage *ncgr, const NclrPalette *palette, int default_idle_map, const GifExportOptions *options, int tile_stride, int margin, const int *union_min_x, const int *union_min_y, const int *union_max_x, const int *union_max_y, const CoordFile *coords)
 Assembles and exports a composed animated GIF based on provided resources. More...
 

Detailed Description

High-level animation assembly and LZW GIF compilation pipeline.

Macro Definition Documentation

◆ GIF_PATH_BUFFER_SIZE

#define GIF_PATH_BUFFER_SIZE   4096

Maximum buffer size for generating output GIF filenames.

Typedef Documentation

◆ GifExportOptions

Detailed parameters configuring animation exporting behavior.

◆ GifEyeMode

typedef enum GifEyeMode GifEyeMode

Unused/legacy eye blinking rendering selection.

◆ GifPaletteMode

Color variant selection.

◆ GifSideMode

typedef enum GifSideMode GifSideMode

Sprite perspective/camera rendering selection.

Enumeration Type Documentation

◆ GifEyeMode

enum GifEyeMode

Unused/legacy eye blinking rendering selection.

Enumerator
GIF_EYE_OPEN 

Keep eyes open.

GIF_EYE_ALL 

Process all states.

◆ GifPaletteMode

Color variant selection.

Enumerator
GIF_PALETTE_NORMAL 

Default species colors.

GIF_PALETTE_SHINY 

Alternating rare colors.

GIF_PALETTE_BOTH 

Process/export both normal and shiny variants.

◆ GifSideMode

Sprite perspective/camera rendering selection.

Enumerator
GIF_SIDE_FRONT 

Front view (as seen by player in battle).

GIF_SIDE_BACK 

Back view (as seen by player for their own Pokemon).

GIF_SIDE_BOTH 

Process/export both front and back views.

Function Documentation

◆ GifExportOptions_Init()

void GifExportOptions_Init ( GifExportOptions options)

Initializes default values for a GifExportOptions structure.

Parameters
optionsPointer to options struct to modify.

◆ GifPipeline_ExportIdle()

int GifPipeline_ExportIdle ( const char *  out_dir,
const char *  side_name,
const char *  animation_name,
const char *  palette_name,
const NcerFile ncer,
const NanrFile nanr,
const NmcrFile nmcr,
const NmarFile nmar,
const NcgrImage ncgr,
const NclrPalette palette,
int  default_idle_map,
const GifExportOptions options,
int  tile_stride,
int  margin,
const int *  union_min_x,
const int *  union_min_y,
const int *  union_max_x,
const int *  union_max_y,
const CoordFile coords 
)

Assembles and exports a composed animated GIF based on provided resources.

Parameters
out_dirDirectory path to write output file.
side_nameLabel used in output filename (e.g., "front", "back").
animation_nameLabel representing animation sequence (e.g., "idle", "break").
palette_nameLabel for color variant (e.g., "normal", "shiny").
ncerPointer to the parsed cell resource file (.NCER).
nanrPointer to the parsed animation resource file (.NANR).
nmcrPointer to the parsed multi-cell mapping layout (.NMCR).
nmarPointer to the parsed multi-animation sequence (.NMAR).
ncgrPointer to the parsed character graphics tiles (.NCGR).
palettePointer to the parsed color palette resource (.NCLR).
default_idle_mapDefault layout index for species' base idle frame.
optionsExport configurations.
tile_strideWidth stride (in tiles) of NCGR image data.
marginSafety boundary width in pixels around the composed animation.
union_min_xPrecalculated bounding box minimum horizontal coordinate.
union_min_yPrecalculated bounding box minimum vertical coordinate.
union_max_xPrecalculated bounding box maximum horizontal coordinate.
union_max_yPrecalculated bounding box maximum vertical coordinate.
coordsOptional CoordFile pointers to adjust horizontal/vertical offsets.
Returns
0 on success; negative value on error.