AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Functions
ppm.c File Reference
#include "ppm.h"

Functions

static void WritePixel (FILE *f, const RgbaColor *px)
 
int Ppm_WriteRgbImage (const char *path, const RgbaColor *pixels, int width, int height)
 Exports an RGBA buffer to standard PPM format. More...
 
int Ppm_WriteRgbImageScaled (const char *path, const RgbaColor *pixels, int width, int height, int scale)
 Exports an RGBA buffer scaled by an integer factor to standard PPM. More...
 

Function Documentation

◆ Ppm_WriteRgbImage()

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

Exports an RGBA buffer to standard PPM format.

Parameters
pathFile path destination.
pixelsSource RGBA pixels.
widthImage width.
heightImage height.
Returns
0 on success; negative value on file open error.

◆ Ppm_WriteRgbImageScaled()

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

Exports an RGBA buffer scaled by an integer factor to standard PPM.

Parameters
pathFile path destination.
pixelsSource RGBA pixels.
widthCanvas width before scaling.
heightCanvas height before scaling.
scaleInteger scaling multiplier.
Returns
0 on success; negative value on file open error.

◆ WritePixel()

static void WritePixel ( FILE *  f,
const RgbaColor px 
)
static