Bsoft 2.1.4
Bernard's software package
rwPNM.cpp File Reference

Functions for reading and writing PBM, PGM and PPM files. More...

#include "rwPNM.h"
#include "utilities.h"
#include <fstream>

Functions

char * pnm_next_item (char *aptr)
 
unsigned char * pnm_read_data (ifstream *fimg, Bimage *p)
 
int readPNM (Bimage *p, int readdata, int img_select)
 Reading a PNM type file. A simple image format. PBM bit image format. PGM grayscale image format. PPM RGB color image format. File format extensions: .pbm, .pgm, .ppm The header contains ascii text indicating the image and element sizes. Data types: byte, unsigned short. More...
 
int writePNM (Bimage *p)
 Writing a PNM type file. A simple image format. More...
 

Variables

int verbose
 

Detailed Description

Functions for reading and writing PBM, PGM and PPM files.

Author
Bernard Heymann
Date
Created: 20110317
Modified: 20120211

Function Documentation

◆ pnm_next_item()

char * pnm_next_item ( char *  aptr)

◆ pnm_read_data()

unsigned char * pnm_read_data ( ifstream *  fimg,
Bimage p 
)

◆ readPNM()

int readPNM ( Bimage p,
int  readdata,
int  img_select 
)

Reading a PNM type file. A simple image format. PBM bit image format. PGM grayscale image format. PPM RGB color image format. File format extensions: .pbm, .pgm, .ppm The header contains ascii text indicating the image and element sizes. Data types: byte, unsigned short.

Parameters
*pthe image structure.
readdataflag to activate reading of image data.
img_selectimage selection in multi-image file (-1 = all images).
Returns
int 0, <0 on error.

◆ writePNM()

int writePNM ( Bimage p)

Writing a PNM type file. A simple image format.

Parameters
*pthe image structure.
Returns
int 0, <0 on error.

Variable Documentation

◆ verbose

int verbose
extern