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

Portable Pixmap (PPM) format writer utilities and color structures. More...

#include "common.h"

Go to the source code of this file.

Data Structures

struct  RgbaColor
 32-bit RGBA color representation struct. More...
 

Typedefs

typedef struct RgbaColor RgbaColor
 32-bit RGBA color representation struct. More...
 

Functions

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...
 

Detailed Description

Portable Pixmap (PPM) format writer utilities and color structures.

Typedef Documentation

◆ RgbaColor

typedef struct RgbaColor RgbaColor

32-bit RGBA color representation struct.

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.