Main Page | Data Structures | File List | Data Fields | Globals

mr_pnm_io.h File Reference

Go to the source code of this file.

Data Structures

struct  MrPNMImage

Defines

#define MR_PBM_ASCII   1
#define MR_PGM_ASCII   2
#define MR_PPM_ASCII   3
#define MR_PBM_RAW   4
#define MR_PGM_RAW   5
#define MR_PPM_RAW   6
#define MR_PNM_ELIBC   0
#define MR_PNM_EMAGIC   1
#define MR_PNM_EITEMS   2
#define MR_PNM_EDATA   3
#define MR_PNM_ESIZE   4
#define MR_PNM_EMAXVAL   5

Typedefs

typedef MrPNMImage MrPNMImage

Functions

MrPNMImagemr_pnm_new ()
void mr_pnm_free (MrPNMImage *img)
MrPNMImagemr_pnm_new_from_file (const char *filename)
int mr_pnm_write_to_file (MrPNMImage *image, const char *filename)
void mr_pnm_draw_rectangle (MrPNMImage *image, unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned char r, unsigned char g, unsigned char b, short int fill)
 Draw a rectangle on a PNM image.
void mr_pnm_draw_horizontal_line (MrPNMImage *image, unsigned int x, unsigned int y, unsigned int len, unsigned char r, unsigned char g, unsigned char b)
 Draw a horizontal line on a PNM image.

Variables

int mr_pnm_errno


Define Documentation

#define MR_PBM_ASCII   1
 

Map magic number to PNM type

#define MR_PBM_RAW   4
 

#define MR_PGM_ASCII   2
 

#define MR_PGM_RAW   5
 

#define MR_PNM_EDATA   3
 

data format

#define MR_PNM_EITEMS   2
 

width/height/maxval format

#define MR_PNM_ELIBC   0
 

error from a libc function call : see errno

#define MR_PNM_EMAGIC   1
 

magic number

#define MR_PNM_EMAXVAL   5
 

max color value

#define MR_PNM_ESIZE   4
 

image/file size

#define MR_PPM_ASCII   3
 

#define MR_PPM_RAW   6
 


Typedef Documentation

typedef struct MrPNMImage MrPNMImage
 


Function Documentation

void mr_pnm_draw_horizontal_line MrPNMImage image,
unsigned int  x,
unsigned int  y,
unsigned int  len,
unsigned char  r,
unsigned char  g,
unsigned char  b
 

Draw a horizontal line on a PNM image.

Parameters:
image the image where draw
x x coordinate of the left extremity
y y coordinate of the left extremity
len the length of the line
r value for the red channel
g value for the green channel
b value for the blue channel

void mr_pnm_draw_rectangle MrPNMImage image,
unsigned int  x,
unsigned int  y,
unsigned int  w,
unsigned int  h,
unsigned char  r,
unsigned char  g,
unsigned char  b,
short int  fill
 

Draw a rectangle on a PNM image.

Parameters:
image the image where draw
x x coordinate of the upper left corner of the rectangle
y y coordinate of the upper left corner of the rectangle
w width of the rectangle
h height of the rectangle
r value for the red channel
g value for the green channel
b value for the blue channel
fill 1 : the rectangle is filled

void mr_pnm_free MrPNMImage img  ) 
 

Destroy a pnm image structure. !!! also destroy the pixels data !!! !!! you can call it with NULL parameter !!!

MrPNMImage* mr_pnm_new  ) 
 

Create a pnm image structure with fields sets to 0.

MrPNMImage* mr_pnm_new_from_file const char *  filename  ) 
 

Get a PNM type image from the specified file. Returns: The PNM image structure or NULL in case of errors.

int mr_pnm_write_to_file MrPNMImage image,
const char *  filename
 

Write a PNM image to a file. Returns: 0 if successfull -1 in case of errors.


Variable Documentation

int mr_pnm_errno
 

Integer to indicates what went wrong (i.e. errno). Its value is significant only when the call returned an error (usually -1).


Generated on Sun Apr 9 17:29:41 2006 for MusicReco by  doxygen 1.4.4