AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Functions
png_writer.h File Reference

libpng file output utility wrapper. More...

#include "common.h"
#include "ppm.h"

Go to the source code of this file.

Functions

int Png_WriteRgbaImage (const char *path, const RgbaColor *pixels, int width, int height)
 Writes an RGBA pixel buffer to a standard PNG file. More...
 
int Png_WriteRgbaImageScaled (const char *path, const RgbaColor *pixels, int width, int height, int scale)
 Writes an RGBA pixel buffer scaled by a scaling factor to a PNG. More...
 

Detailed Description

libpng file output utility wrapper.

Function Documentation

◆ Png_WriteRgbaImage()

int Png_WriteRgbaImage ( const char *  path,
const RgbaColor pixels,
int  width,
int  height 
)

Writes an RGBA pixel buffer to a standard PNG file.

Parameters
pathFile path to save the PNG.
pixelsSource RGBA pixels buffer.
widthWidth of image.
heightHeight of image.
Returns
0 on success; negative value on file open or libpng initialization error.

◆ Png_WriteRgbaImageScaled()

int Png_WriteRgbaImageScaled ( const char *  path,
const RgbaColor pixels,
int  width,
int  height,
int  scale 
)

Writes an RGBA pixel buffer scaled by a scaling factor to a PNG.

Parameters
pathFile path to save.
pixelsSource RGBA pixels.
widthCanvas width before scaling.
heightCanvas height before scaling.
scaleBilinear scale multiplier.
Returns
0 on success; negative value on error.