X-Boost  2.3.8
Functions
pnmio.h File Reference

PNM files I/O. More...

#include "Image.h"

Go to the source code of this file.

Functions

unsigned char * pgm_load (unsigned int &width, unsigned int &height, unsigned int &max, const char *file)
 
unsigned char * ppm_load (unsigned int &width, unsigned int &height, unsigned int &max, const char *file)
 
void pgm_write (const char *filename, const unsigned char *buffer, unsigned int width, unsigned int height, unsigned int max)
 
void pgm_write (const char *filename, const unsigned char *buffer, unsigned int width, unsigned int height, unsigned int max, long stride)
 
bool ppm_write (const char *filename, const unsigned char *buf, unsigned int width, unsigned int height)
 
bool pnm_load (const char *file, Image &out)
 
bool pnm_write (const ImageHandle &in, const char *file)
 

Detailed Description

PNM files I/O.

Function Documentation

unsigned char* pgm_load ( unsigned int &  width,
unsigned int &  height,
unsigned int &  max,
const char *  file 
)

Load a PGM file

Returns
a pointer to image buffer, who have to be freed with delete []
void pgm_write ( const char *  filename,
const unsigned char *  buffer,
unsigned int  width,
unsigned int  height,
unsigned int  max 
)

Dump PGM image

bool pnm_load ( const char *  file,
Image out 
)

load a PGM/PPM image in an Image structure

bool pnm_write ( const ImageHandle in,
const char *  file 
)

save an image as PPM/PGM on disk

unsigned char* ppm_load ( unsigned int &  width,
unsigned int &  height,
unsigned int &  max,
const char *  file 
)

Load a PPM file

Returns
a pointer to image buffer, who have to be freed with delete []
bool ppm_write ( const char *  filename,
const unsigned char *  buf,
unsigned int  width,
unsigned int  height 
)

Dump a PPM image