Sprite sheet grid composition and PNG drawing pipeline.
More...
#include "common.h"
#include "ppm.h"
#include "ncgr.h"
#include "nclr.h"
#include "ncer.h"
Go to the source code of this file.
|
| int | PngPipeline_TilePreview (const char *ncgr_path, const char *nclr_path, const char *out_path) |
| | Renders NCGR tiles in order to a standard PNG preview file. More...
|
| |
| int | PngPipeline_CropToAlpha (const RgbaColor *pixels, int width, int height, RgbaColor **out_pixels, int *out_width, int *out_height) |
| | Crops transparent borders around a pixel frame buffer. More...
|
| |
| int | PngPipeline_CroppedSprite (const char *ncgr_path, const char *nclr_path, const char *out_path) |
| | Renders the first cell frame from NCGR tiles, cropped to its alpha bounding box, and saves it. More...
|
| |
| int | PngPipeline_ExactNcgr (const char *ncgr_path, const char *nclr_path, const char *out_path) |
| | Renders the exact tile character page layout defined by NCGR and exports as PNG. More...
|
| |
| int | PngPipeline_CellPreviews (const char *ncgr_path, const char *ncer_path, const char *nclr_path, const char *out_dir) |
| | Renders all individual cells in NCGR as static PNGs. More...
|
| |
| int | PngPipeline_CombineSideBySide (const RgbaColor *front, int front_w, int front_h, const RgbaColor *back, int back_w, int back_h, RgbaColor **out_combined, int *out_combined_w, int *out_combined_h) |
| | Stitches two RGBA images side-by-side into a single combined buffer. More...
|
| |
| int | PngPipeline_CombineToGrid (const NcerFile *ncer, const NcgrImage *ncgr, const NclrPalette *palette, RgbaColor **out_combined, int *out_combined_w, int *out_combined_h) |
| | Recomposes and stitches all frames defined in NCER cells side-by-side in a single grid sheet. More...
|
| |
Sprite sheet grid composition and PNG drawing pipeline.
◆ PNG_PATH_BUFFER_SIZE
| #define PNG_PATH_BUFFER_SIZE 4096 |
Maximum buffer size for generating output PNG file paths.
◆ PngPipeline_CellPreviews()
| int PngPipeline_CellPreviews |
( |
const char * |
ncgr_path, |
|
|
const char * |
ncer_path, |
|
|
const char * |
nclr_path, |
|
|
const char * |
out_dir |
|
) |
| |
Renders all individual cells in NCGR as static PNGs.
- Parameters
-
| ncgr_path | Path to NCGR file. |
| ncer_path | Path to NCER cell resource. |
| nclr_path | Path to NCLR palette file. |
| out_dir | Directory path to write output PNGs. |
- Returns
- 0 on success; negative value on failure.
◆ PngPipeline_CombineSideBySide()
| int PngPipeline_CombineSideBySide |
( |
const RgbaColor * |
front, |
|
|
int |
front_w, |
|
|
int |
front_h, |
|
|
const RgbaColor * |
back, |
|
|
int |
back_w, |
|
|
int |
back_h, |
|
|
RgbaColor ** |
out_combined, |
|
|
int * |
out_combined_w, |
|
|
int * |
out_combined_h |
|
) |
| |
Stitches two RGBA images side-by-side into a single combined buffer.
- Parameters
-
| front | Front frame RGBA pixels buffer. |
| front_w | Front frame width. |
| front_h | Front frame height. |
| back | Back frame RGBA pixels buffer. |
| back_w | Back frame width. |
| back_h | Back frame height. |
| out_combined | Destination combined RGBA pixels buffer (allocated within function). |
| out_combined_w | Width of stitched image. |
| out_combined_h | Height of stitched image. |
- Returns
- 0 on success; negative value on memory failure.
◆ PngPipeline_CombineToGrid()
Recomposes and stitches all frames defined in NCER cells side-by-side in a single grid sheet.
- Parameters
-
| ncer | NCER resource file. |
| ncgr | NCGR graphics resource. |
| palette | NCLR palette resource. |
| out_combined | Destination combined RGBA pixels buffer (allocated within function). |
| out_combined_w | Width of stitched spritesheet image. |
| out_combined_h | Height of stitched spritesheet image. |
- Returns
- 0 on success; negative value on failure.
◆ PngPipeline_CroppedSprite()
| int PngPipeline_CroppedSprite |
( |
const char * |
ncgr_path, |
|
|
const char * |
nclr_path, |
|
|
const char * |
out_path |
|
) |
| |
Renders the first cell frame from NCGR tiles, cropped to its alpha bounding box, and saves it.
- Parameters
-
| ncgr_path | Path to NCGR file. |
| nclr_path | Path to NCLR file. |
| out_path | Destination file path. |
- Returns
- 0 on success; negative value on failure.
◆ PngPipeline_CropToAlpha()
| int PngPipeline_CropToAlpha |
( |
const RgbaColor * |
pixels, |
|
|
int |
width, |
|
|
int |
height, |
|
|
RgbaColor ** |
out_pixels, |
|
|
int * |
out_width, |
|
|
int * |
out_height |
|
) |
| |
Crops transparent borders around a pixel frame buffer.
- Parameters
-
| pixels | Source RGBA pixels buffer. |
| width | Input canvas width. |
| height | Input canvas height. |
| out_pixels | Output cropped RGBA buffer (allocated within function). |
| out_width | Width of cropped image. |
| out_height | Height of cropped image. |
- Returns
- 0 on success; negative value on empty or transparent input.
◆ PngPipeline_ExactNcgr()
| int PngPipeline_ExactNcgr |
( |
const char * |
ncgr_path, |
|
|
const char * |
nclr_path, |
|
|
const char * |
out_path |
|
) |
| |
Renders the exact tile character page layout defined by NCGR and exports as PNG.
- Parameters
-
| ncgr_path | Path to NCGR file. |
| nclr_path | Path to NCLR file. |
| out_path | Destination file path. |
- Returns
- 0 on success; negative value on failure.
◆ PngPipeline_TilePreview()
| int PngPipeline_TilePreview |
( |
const char * |
ncgr_path, |
|
|
const char * |
nclr_path, |
|
|
const char * |
out_path |
|
) |
| |
Renders NCGR tiles in order to a standard PNG preview file.
- Parameters
-
| ncgr_path | Path to the NCGR file. |
| nclr_path | Path to the NCLR palette file. |
| out_path | Destination file path. |
- Returns
- 0 on success; negative value on error.