w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ppm.h File Reference
#include "pgm.h"
Include dependency graph for ppm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pixel
 

Macros

#define PPM_OVERALLMAXVAL   PGM_OVERALLMAXVAL
 
#define PPM_MAXMAXVAL   PGM_MAXMAXVAL
 
#define PPM_GETR(p)   ((p).r)
 
#define PPM_GETG(p)   ((p).g)
 
#define PPM_GETB(p)   ((p).b)
 
#define PPM_PUTR(p, red)   ((p).r = (red))
 
#define PPM_PUTG(p, grn)   ((p).g = (grn))
 
#define PPM_PUTB(p, blu)   ((p).b = (blu))
 
#define PPM_ASSIGN(p, red, grn, blu)   do { (p).r = (red); (p).g = (grn); (p).b = (blu); } while ( 0 )
 
#define PPM_EQUAL(p, q)   ( (p).r == (q).r && (p).g == (q).g && (p).b == (q).b )
 
#define PPM_MAGIC1   'P'
 
#define PPM_MAGIC2   '3'
 
#define RPPM_MAGIC2   '6'
 
#define PPM_FORMAT   (PPM_MAGIC1 * 256 + PPM_MAGIC2)
 
#define RPPM_FORMAT   (PPM_MAGIC1 * 256 + RPPM_MAGIC2)
 
#define PPM_TYPE   PPM_FORMAT
 
#define PPM_FORMAT_TYPE(f)   ((f) == PPM_FORMAT || (f) == RPPM_FORMAT ? PPM_TYPE : PGM_FORMAT_TYPE(f))
 
#define ppm_allocarray(cols, rows)   ((pixel**) pm_allocarray( cols, rows, sizeof(pixel) ))
 
#define ppm_allocrow(cols)   ((pixel*) pm_allocrow( cols, sizeof(pixel) ))
 
#define ppm_freearray(pixels, rows)   pm_freearray( (char**) pixels, rows )
 
#define ppm_freerow(pixelrow)   pm_freerow( (char*) pixelrow )
 
#define PPM_DEPTH(newp, p, oldmaxval, newmaxval)
 
#define PPM_LUMIN(p)   ( 0.299 * PPM_GETR(p) + 0.587 * PPM_GETG(p) + 0.114 * PPM_GETB(p) )
 

Typedefs

typedef gray pixval
 

Functions

void ppm_init ()
 
pixel ** ppm_readppm ()
 
void ppm_readppminit ()
 
void ppm_readppmrow ()
 
void ppm_writeppm ()
 
void ppm_writeppminit ()
 
void ppm_writeppmrow ()
 
pixel ppm_parsecolor ()
 
char * ppm_colorname ()
 

Variables

pixval ppm_pbmmaxval
 

Macro Definition Documentation

◆ ppm_allocarray

#define ppm_allocarray (   cols,
  rows 
)    ((pixel**) pm_allocarray( cols, rows, sizeof(pixel) ))

Definition at line 71 of file ppm.h.

◆ ppm_allocrow

#define ppm_allocrow (   cols)    ((pixel*) pm_allocrow( cols, sizeof(pixel) ))

Definition at line 72 of file ppm.h.

◆ PPM_ASSIGN

#define PPM_ASSIGN (   p,
  red,
  grn,
  blu 
)    do { (p).r = (red); (p).g = (grn); (p).b = (blu); } while ( 0 )

Definition at line 46 of file ppm.h.

◆ PPM_DEPTH

#define PPM_DEPTH (   newp,
  p,
  oldmaxval,
  newmaxval 
)
Value:
PPM_ASSIGN( (newp), \
( (int) PPM_GETR(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \
( (int) PPM_GETG(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \
( (int) PPM_GETB(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval) )
small capitals from c petite p
Definition: afcover.h:72
#define PPM_GETR(p)
Definition: ppm.h:36
#define PPM_ASSIGN(p, red, grn, blu)
Definition: ppm.h:46
#define PPM_GETG(p)
Definition: ppm.h:37
#define PPM_GETB(p)
Definition: ppm.h:38

Definition at line 95 of file ppm.h.

◆ PPM_EQUAL

#define PPM_EQUAL (   p,
  q 
)    ( (p).r == (q).r && (p).g == (q).g && (p).b == (q).b )

Definition at line 47 of file ppm.h.

◆ PPM_FORMAT

#define PPM_FORMAT   (PPM_MAGIC1 * 256 + PPM_MAGIC2)

Definition at line 57 of file ppm.h.

◆ PPM_FORMAT_TYPE

#define PPM_FORMAT_TYPE (   f)    ((f) == PPM_FORMAT || (f) == RPPM_FORMAT ? PPM_TYPE : PGM_FORMAT_TYPE(f))

Definition at line 64 of file ppm.h.

◆ ppm_freearray

#define ppm_freearray (   pixels,
  rows 
)    pm_freearray( (char**) pixels, rows )

Definition at line 73 of file ppm.h.

◆ ppm_freerow

#define ppm_freerow (   pixelrow)    pm_freerow( (char*) pixelrow )

Definition at line 74 of file ppm.h.

◆ PPM_GETB

#define PPM_GETB (   p)    ((p).b)

Definition at line 38 of file ppm.h.

◆ PPM_GETG

#define PPM_GETG (   p)    ((p).g)

Definition at line 37 of file ppm.h.

◆ PPM_GETR

#define PPM_GETR (   p)    ((p).r)

Definition at line 36 of file ppm.h.

◆ PPM_LUMIN

#define PPM_LUMIN (   p)    ( 0.299 * PPM_GETR(p) + 0.587 * PPM_GETG(p) + 0.114 * PPM_GETB(p) )

Definition at line 104 of file ppm.h.

◆ PPM_MAGIC1

#define PPM_MAGIC1   'P'

Definition at line 54 of file ppm.h.

◆ PPM_MAGIC2

#define PPM_MAGIC2   '3'

Definition at line 55 of file ppm.h.

◆ PPM_MAXMAXVAL

#define PPM_MAXMAXVAL   PGM_MAXMAXVAL

Definition at line 31 of file ppm.h.

◆ PPM_OVERALLMAXVAL

#define PPM_OVERALLMAXVAL   PGM_OVERALLMAXVAL

Definition at line 30 of file ppm.h.

◆ PPM_PUTB

#define PPM_PUTB (   p,
  blu 
)    ((p).b = (blu))

Definition at line 43 of file ppm.h.

◆ PPM_PUTG

#define PPM_PUTG (   p,
  grn 
)    ((p).g = (grn))

Definition at line 42 of file ppm.h.

◆ PPM_PUTR

#define PPM_PUTR (   p,
  red 
)    ((p).r = (red))

Definition at line 41 of file ppm.h.

◆ PPM_TYPE

#define PPM_TYPE   PPM_FORMAT

Definition at line 59 of file ppm.h.

◆ RPPM_FORMAT

#define RPPM_FORMAT   (PPM_MAGIC1 * 256 + RPPM_MAGIC2)

Definition at line 58 of file ppm.h.

◆ RPPM_MAGIC2

#define RPPM_MAGIC2   '6'

Definition at line 56 of file ppm.h.

Typedef Documentation

◆ pixval

typedef gray pixval

Definition at line 9 of file ppm.h.

Function Documentation

◆ ppm_colorname()

char* ppm_colorname ( )

◆ ppm_init()

void ppm_init ( )

◆ ppm_parsecolor()

pixel ppm_parsecolor ( )

◆ ppm_readppm()

pixel** ppm_readppm ( )

◆ ppm_readppminit()

void ppm_readppminit ( )

◆ ppm_readppmrow()

void ppm_readppmrow ( )

◆ ppm_writeppm()

void ppm_writeppm ( )

◆ ppm_writeppminit()

void ppm_writeppminit ( )

◆ ppm_writeppmrow()

void ppm_writeppmrow ( )

Variable Documentation

◆ ppm_pbmmaxval

pixval ppm_pbmmaxval
extern

Definition at line 50 of file libppm1.c.

Referenced by main(), and ppm_readppminit().