Wavelet and Image class library  1.3.2
Functions
ppmlib.h File Reference
#include "WImage/miscdefs.h"
#include <stdio.h>
Include dependency graph for ppmlib.h:

Go to the source code of this file.

Functions

pixelppm_read (const char *fname, int *height, int *width, int *cmax)
int ppm_write (const char *fname, pixel *pic, int height, int width, int cmax)
pixelppm_fromStream (FILE *in, int *height, int *width, int *cmax)
int ppm_toStream (FILE *out, pixel *pic, int height, int width, int cmax)

Function Documentation

pixel* ppm_fromStream ( FILE *  in,
int *  height,
int *  width,
int *  cmax 
)

Read a PPM file from an open stream.

Parameters:
inthe open input stream
heightthe number of pixel rows, returned by the function
widththe number of pixel cols, returned by the function
cmaxthe number of colors, returned by the function
Returns:
an array containing the pixels as RGB triples if successful else NULL
int ppm_toStream ( FILE *  out,
pixel pic,
int  height,
int  width,
int  cmax 
)

Write a PPM file to an open stream

Parameters:
outthe open output stream
picthe image as an array of RGB triples
heightthe number of pixel rows
widththe number of pixel cols
cmaxthe maximum color value
Returns:
0 if successful else -1
int ppm_write ( const char *  fname,
pixel pic,
int  height,
int  width,
int  cmax 
)

Write a PPM file to the filesystem

Parameters:
fnamethe filename
picthe image as an array of RGB triples
heightthe number of pixel rows
widththe number of pixel cols
cmaxthe maximum color value
Returns:
0 if successful else -1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines