Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pnmimage/pnmimage_base.h File Reference

#include "pandabase.h"
#include <string>

Go to the source code of this file.

Compounds

struct  pixel

Defines

#define PGM_BIGGRAYS
#define PGM_MAXMAXVAL   65535
#define PNM_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)   { (p).r = (red); (p).g = (grn); (p).b = (blu); }
#define PPM_EQUAL(p, q)   ( (p).r == (q).r && (p).g == (q).g && (p).b == (q).b )
#define PNM_ASSIGN1(x, v)   PPM_ASSIGN(x,0,0,v)
#define PPM_DEPTH(newp, p, oldmaxval, newmaxval)

Typedefs

typedef unsigned short gray
typedef gray pixval
typedef pixel xel
typedef gray xelval

Functions

EXPCL_PANDA void pm_message (const char *format,...)
 Outputs the given printf-style message to the user and returns.

EXPCL_PANDA void pm_error (const char *format,...)
 Outputs the given printf-style message to the user and terminates messily.

EXPCL_PANDA int pm_maxvaltobits (int maxval)
 Returns the number of bits sufficient to hold the indicated maxval value.

EXPCL_PANDA int pm_bitstomaxval (int bits)
 Returns the highest maxval that can be represented in the indicated number of bits.

EXPCL_PANDA char * pm_allocrow (int cols, int size)
 Allocates a row of cols * size bytes.

EXPCL_PANDA void pm_freerow (char *itrow)
 Frees the row previously allocated withm pm_allocrow().

EXPCL_PANDA int pm_readbigshort (istream *in, short *sP)
EXPCL_PANDA int pm_writebigshort (ostream *out, short s)
EXPCL_PANDA int pm_readbiglong (istream *in, long *lP)
EXPCL_PANDA int pm_writebiglong (ostream *out, long l)
EXPCL_PANDA int pm_readlittleshort (istream *in, short *sP)
EXPCL_PANDA int pm_writelittleshort (ostream *out, short s)
EXPCL_PANDA int pm_readlittlelong (istream *in, long *lP)
EXPCL_PANDA int pm_writelittlelong (ostream *out, long l)

Variables

const double lumin_red = 0.299
const double lumin_grn = 0.587
const double lumin_blu = 0.114


Detailed Description

Definition in file pnmimage_base.h.


Define Documentation

#define PGM_BIGGRAYS
 

Definition at line 38 of file pnmimage_base.h.

#define PGM_MAXMAXVAL   65535
 

Definition at line 42 of file pnmimage_base.h.

#define PNM_ASSIGN1 x,
 )     PPM_ASSIGN(x,0,0,v)
 

Definition at line 70 of file pnmimage_base.h.

Referenced by PNMFileTypeJPG::Reader::read_data(), and PNMFileTypeJPG2000::Reader::read_data().

#define PNM_MAXMAXVAL   PGM_MAXMAXVAL
 

Definition at line 48 of file pnmimage_base.h.

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

Definition at line 68 of file pnmimage_base.h.

Referenced by PNMImage::add_alpha(), BMPreadrow(), PNMFileTypeJPG::Reader::read_data(), PNMFileTypeJPG2000::Reader::read_data(), and PNMImage::remove_alpha().

#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) )

Definition at line 72 of file pnmimage_base.h.

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

Definition at line 69 of file pnmimage_base.h.

Referenced by ppm_addtocolorhist(), ppm_colorhisttocolorhash(), ppm_computecolorhash(), and ppm_lookupcolor().

#define PPM_GETB  )     ((p).b)
 

Definition at line 62 of file pnmimage_base.h.

Referenced by BMPwriterow(), PNMImage::get_xel_val(), PNMImage::make_rgb(), ppm_colorhisttocolorhash(), PNMFileTypeSoftImage::Reader::read_row(), PNMFileTypeTIFF::Writer::Writer(), PNMFileTypeIMG::Writer::Writer(), and PNMFileTypeAlias::Writer::Writer().

#define PPM_GETG  )     ((p).g)
 

Definition at line 61 of file pnmimage_base.h.

Referenced by BMPwriterow(), ppm_colorhisttocolorhash(), PNMFileTypeTIFF::Writer::Writer(), and PNMFileTypeIMG::Writer::Writer().

#define PPM_GETR  )     ((p).r)
 

Definition at line 60 of file pnmimage_base.h.

Referenced by BMPwriterow(), PNMImage::make_grayscale(), ppm_colorhisttocolorhash(), PNMFileTypeTIFF::Writer::Writer(), and PNMFileTypeIMG::Writer::Writer().

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

Definition at line 66 of file pnmimage_base.h.

Referenced by PNMImage::get_red_val(), and PNMImage::set_xel_val().

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

Definition at line 65 of file pnmimage_base.h.

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

Definition at line 64 of file pnmimage_base.h.

Referenced by PNMImage::set_xel_val().


Typedef Documentation

typedef unsigned short gray
 

Definition at line 41 of file pnmimage_base.h.

Referenced by PNMImage::from_val(), PNMImage::get_red_val(), and PNMImage::remove_alpha().

typedef gray pixval
 

Definition at line 54 of file pnmimage_base.h.

Referenced by PNMFileTypeBMP::Writer::Writer().

typedef pixel xel
 

Definition at line 55 of file pnmimage_base.h.

typedef gray xelval
 

Definition at line 56 of file pnmimage_base.h.

Referenced by PNMImage::clear(), PNMImage::fill(), PNMImage::get_xel_val(), PNMImageHeader::is_grayscale(), PNMImage::make_rgb(), PNMImage::operator=(), PNMImage::quick_filter_from(), PNMFileTypeJPG::Reader::read_data(), PNMFileTypeJPG2000::Reader::read_data(), PNMImage::set_blue(), PNMImage::set_color_type(), PNMImage::set_green(), PNMImage::set_xel_val(), PNMFileTypeTIFF::Writer::Writer(), and PNMImage::~PNMImage().


Function Documentation

EXPCL_PANDA char* pm_allocrow int  cols,
int  size
 

Allocates a row of cols * size bytes.

Definition at line 135 of file pnmimage_base.cxx.

References writer().

EXPCL_PANDA int pm_bitstomaxval int  bits  ) 
 

Returns the highest maxval that can be represented in the indicated number of bits.

Definition at line 123 of file pnmimage_base.cxx.

EXPCL_PANDA void pm_error const char *  format,
... 
 

Outputs the given printf-style message to the user and terminates messily.

Minimize use of this function.

Definition at line 71 of file pnmimage_base.cxx.

Referenced by BMPEncode(), BMPEncode24(), BMPlenfileheader(), BMPleninfoheader(), BMPlenline(), BMPlenrgbtable(), BMPreadbits(), BMPreadinfoheader(), BMPwritebits(), BMPwriteinfoheader(), BMPwritergb(), colorstobpp(), GetByte(), GetLong(), GetShort(), ppm_alloccolorhash(), ppm_colorhashtocolorhist(), ppm_colorhisttocolorhash(), ppm_computecolorhash(), put_byte(), PutByte(), PutLong(), PutShort(), PNMFileTypeTGA::Reader::Reader(), and readto().

EXPCL_PANDA void pm_freerow char *  itrow  ) 
 

Frees the row previously allocated withm pm_allocrow().

Definition at line 147 of file pnmimage_base.cxx.

Referenced by PNMFileTypeTGA::Reader::read_data().

EXPCL_PANDA int pm_maxvaltobits int  maxval  ) 
 

Returns the number of bits sufficient to hold the indicated maxval value.

Definition at line 104 of file pnmimage_base.cxx.

EXPCL_PANDA void pm_message const char *  format,
... 
 

Outputs the given printf-style message to the user and returns.

Definition at line 40 of file pnmimage_base.cxx.

Referenced by BMPreadinfoheader().

EXPCL_PANDA int pm_readbiglong istream *  in,
long *  lP
 

Definition at line 170 of file pnmimage_base.cxx.

References reader().

EXPCL_PANDA int pm_readbigshort istream *  in,
short *  sP
 

Definition at line 156 of file pnmimage_base.cxx.

References reader().

EXPCL_PANDA int pm_readlittlelong istream *  in,
long *  lP
 

Definition at line 198 of file pnmimage_base.cxx.

EXPCL_PANDA int pm_readlittleshort istream *  in,
short *  sP
 

Definition at line 184 of file pnmimage_base.cxx.

EXPCL_PANDA int pm_writebiglong ostream *  out,
long  l
 

Definition at line 177 of file pnmimage_base.cxx.

References writer().

Referenced by write_uchar_SI().

EXPCL_PANDA int pm_writebigshort ostream *  out,
short  s
 

Definition at line 163 of file pnmimage_base.cxx.

References writer().

Referenced by put_byte().

EXPCL_PANDA int pm_writelittlelong ostream *  out,
long  l
 

Definition at line 205 of file pnmimage_base.cxx.

Referenced by PutLong().

EXPCL_PANDA int pm_writelittleshort ostream *  out,
short  s
 

Definition at line 191 of file pnmimage_base.cxx.

Referenced by PutShort().


Variable Documentation

const double lumin_blu = 0.114 [static]
 

Definition at line 104 of file pnmimage_base.h.

const double lumin_grn = 0.587 [static]
 

Definition at line 103 of file pnmimage_base.h.

const double lumin_red = 0.299 [static]
 

Definition at line 102 of file pnmimage_base.h.


Generated on Fri May 2 00:46:05 2003 for Panda by doxygen1.3