|
AnimaEngine
1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
|
Functions | |
| int | Ncgr_Parse (const u8 *data, size_t size, NcgrImage *out_image) |
| Parses character graphics tiles from raw binary stream. More... | |
| void | Ncgr_Free (NcgrImage *image) |
| Deallocates local buffers inside NcgrImage structure. More... | |
| void | Ncgr_PrintInfo (const NcgrImage *image) |
| Debug prints character graphics metadata to stdout. More... | |
| static int | GetPixelIndex4bpp (const u8 *tile, int x, int y) |
| static int | GetPixelIndex8bpp (const u8 *tile, int x, int y) |
| int | Ncgr_GetPixelIndex (const NcgrImage *image, int tile_index, int x, int y) |
| Retrieves the color index offset for a pixel coordinate inside a specific 8x8 tile. More... | |
| void | Ncgr_BlitObjToCanvas (const NcgrImage *image, const NclrPalette *palette, RgbaColor *canvas, int canvas_width, int canvas_height, int dst_x, int dst_y, int tile_index, int obj_width, int obj_height, int palette_index, int flip_h, int flip_v) |
| Blits a sub-sprite object onto an RGBA canvas. More... | |
| void | Ncgr_BlitObjToCanvasWithTileStride (const NcgrImage *image, const NclrPalette *palette, RgbaColor *canvas, int canvas_width, int canvas_height, int dst_x, int dst_y, int tile_index, int obj_width, int obj_height, int palette_index, int flip_h, int flip_v, int tile_stride) |
| Blits a sub-sprite object onto canvas using specific width tile character stride constraints. More... | |
| int | Ncgr_RenderTilesToImage (const NcgrImage *image, const NclrPalette *palette, int tiles_per_row, RgbaColor **out_pixels, int *out_width, int *out_height) |
| Renders sequential list of tiles directly to a grid sheet RGBA image. More... | |
|
static |
|
static |
| void Ncgr_BlitObjToCanvas | ( | const NcgrImage * | image, |
| const NclrPalette * | palette, | ||
| RgbaColor * | canvas, | ||
| int | canvas_width, | ||
| int | canvas_height, | ||
| int | dst_x, | ||
| int | dst_y, | ||
| int | tile_index, | ||
| int | obj_width, | ||
| int | obj_height, | ||
| int | palette_index, | ||
| int | flip_h, | ||
| int | flip_v | ||
| ) |
Blits a sub-sprite object onto an RGBA canvas.
| image | Pointer to NCGR image. |
| palette | Palette resource containing colors. |
| canvas | Destination RGBA pixel canvas buffer. |
| canvas_width | Width of destination canvas in pixels. |
| canvas_height | Height of destination canvas in pixels. |
| dst_x | Horizontal canvas offset coordinates to start rendering. |
| dst_y | Vertical canvas offset coordinates to start rendering. |
| tile_index | Initial NCGR tile index. |
| obj_width | Width of active sub-sprite in pixels. |
| obj_height | Height of active sub-sprite in pixels. |
| palette_index | Palette page offset selection. |
| flip_h | 1 to mirror graphics horizontally. |
| flip_v | 1 to mirror graphics vertically. |
| void Ncgr_BlitObjToCanvasWithTileStride | ( | const NcgrImage * | image, |
| const NclrPalette * | palette, | ||
| RgbaColor * | canvas, | ||
| int | canvas_width, | ||
| int | canvas_height, | ||
| int | dst_x, | ||
| int | dst_y, | ||
| int | tile_index, | ||
| int | obj_width, | ||
| int | obj_height, | ||
| int | palette_index, | ||
| int | flip_h, | ||
| int | flip_v, | ||
| int | tile_stride | ||
| ) |
Blits a sub-sprite object onto canvas using specific width tile character stride constraints.
| image | Pointer to NCGR image. |
| palette | Palette resource. |
| canvas | Destination RGBA canvas buffer. |
| canvas_width | Canvas width in pixels. |
| canvas_height | Canvas height in pixels. |
| dst_x | Horizontal canvas offset. |
| dst_y | Vertical canvas offset. |
| tile_index | Initial NCGR tile index. |
| obj_width | Width of active sub-sprite. |
| obj_height | Height of active sub-sprite. |
| palette_index | Palette page offset. |
| flip_h | 1 to mirror horizontally. |
| flip_v | 1 to mirror vertically. |
| tile_stride | Width stride (in tiles) of NCGR image data. |
| void Ncgr_Free | ( | NcgrImage * | image | ) |
Deallocates local buffers inside NcgrImage structure.
| image | Pointer to NCGR image. |
| int Ncgr_GetPixelIndex | ( | const NcgrImage * | image, |
| int | tile_index, | ||
| int | x, | ||
| int | y | ||
| ) |
Retrieves the color index offset for a pixel coordinate inside a specific 8x8 tile.
| image | Pointer to NCGR image. |
| tile_index | Index of the target tile. |
| x | Horizontal pixel coordinate relative to tile origin (0 to 7). |
| y | Vertical pixel coordinate relative to tile origin (0 to 7). |
Parses character graphics tiles from raw binary stream.
| data | Raw binary input. |
| size | Input stream size in bytes. |
| out_image | Destination struct. |
| void Ncgr_PrintInfo | ( | const NcgrImage * | image | ) |
Debug prints character graphics metadata to stdout.
| image | Pointer to NCGR image. |
| int Ncgr_RenderTilesToImage | ( | const NcgrImage * | image, |
| const NclrPalette * | palette, | ||
| int | tiles_per_row, | ||
| RgbaColor ** | out_pixels, | ||
| int * | out_width, | ||
| int * | out_height | ||
| ) |
Renders sequential list of tiles directly to a grid sheet RGBA image.
| image | Pointer to NCGR image. |
| palette | Palette resource. |
| tiles_per_row | Grid width columns. |
| out_pixels | Output destination RGBA pixels buffer. |
| out_width | Width of generated sheet image. |
| out_height | Height of generated sheet image. |