Panda3D
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
pnmimage_base.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "pandabase.h"
#include "pnotify.h"

Go to the source code of this file.

Classes

struct  pixel
 

Macros

#define PGM_BIGGRAYS
 
#define PGM_MAXMAXVAL   65535
 
#define PNM_ASSIGN1(x, v)   PPM_ASSIGN(x,0,0,v)
 
#define PNM_MAXMAXVAL   PGM_MAXMAXVAL
 
#define PPM_ASSIGN(p, red, grn, blu)   { (p).r = (red); (p).g = (grn); (p).b = (blu); }
 
#define PPM_DEPTH(newp, p, oldmaxval, newmaxval)
 
#define PPM_EQUAL(p, q)   ( (p).r == (q).r && (p).g == (q).g && (p).b == (q).b )
 
#define PPM_GETB(p)   ((p).b)
 
#define PPM_GETG(p)   ((p).g)
 
#define PPM_GETR(p)   ((p).r)
 
#define PPM_PUTB(p, blu)   ((p).b = (blu))
 
#define PPM_PUTG(p, grn)   ((p).g = (grn))
 
#define PPM_PUTR(p, red)   ((p).r = (red))
 

Typedefs

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

Functions

EXPCL_PANDA_PNMIMAGE char * pm_allocrow (int cols, int size)
 Allocates a row of cols * size bytes.
 
EXPCL_PANDA_PNMIMAGE int pm_bitstomaxval (int bits)
 Returns the highest maxval that can be represented in the indicated number of bits.
 
EXPCL_PANDA_PNMIMAGE void pm_error (const char *format,...)
 Outputs the given printf-style message to the user and terminates messily.
 
EXPCL_PANDA_PNMIMAGE void pm_freerow (char *itrow)
 Frees the row previously allocated withm pm_allocrow().
 
EXPCL_PANDA_PNMIMAGE int pm_maxvaltobits (int maxval)
 Returns the number of bits sufficient to hold the indicated maxval value.
 
EXPCL_PANDA_PNMIMAGE void pm_message (const char *format,...)
 Outputs the given printf-style message to the user and returns.
 
EXPCL_PANDA_PNMIMAGE int pm_readbiglong (std::istream *in, long *lP)
 
EXPCL_PANDA_PNMIMAGE int pm_readbigshort (std::istream *in, short *sP)
 
EXPCL_PANDA_PNMIMAGE int pm_readlittlelong (std::istream *in, long *lP)
 
EXPCL_PANDA_PNMIMAGE int pm_readlittleshort (std::istream *in, short *sP)
 
EXPCL_PANDA_PNMIMAGE int pm_writebiglong (std::ostream *out, long l)
 
EXPCL_PANDA_PNMIMAGE int pm_writebigshort (std::ostream *out, short s)
 
EXPCL_PANDA_PNMIMAGE int pm_writelittlelong (std::ostream *out, long l)
 
EXPCL_PANDA_PNMIMAGE int pm_writelittleshort (std::ostream *out, short s)
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2000-06-14

Definition in file pnmimage_base.h.

Macro Definition Documentation

◆ PGM_BIGGRAYS

#define PGM_BIGGRAYS

Definition at line 29 of file pnmimage_base.h.

◆ PGM_MAXMAXVAL

#define PGM_MAXMAXVAL   65535

Definition at line 33 of file pnmimage_base.h.

◆ PNM_ASSIGN1

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

Definition at line 104 of file pnmimage_base.h.

◆ PNM_MAXMAXVAL

#define PNM_MAXMAXVAL   PGM_MAXMAXVAL

Definition at line 39 of file pnmimage_base.h.

◆ PPM_ASSIGN

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

Definition at line 102 of file pnmimage_base.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) )

Definition at line 106 of file pnmimage_base.h.

◆ PPM_EQUAL

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

Definition at line 103 of file pnmimage_base.h.

◆ PPM_GETB

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

Definition at line 96 of file pnmimage_base.h.

◆ PPM_GETG

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

Definition at line 95 of file pnmimage_base.h.

◆ PPM_GETR

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

Definition at line 94 of file pnmimage_base.h.

◆ PPM_PUTB

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

Definition at line 100 of file pnmimage_base.h.

◆ PPM_PUTG

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

Definition at line 99 of file pnmimage_base.h.

◆ PPM_PUTR

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

Definition at line 98 of file pnmimage_base.h.

Typedef Documentation

◆ gray

typedef unsigned short gray

Definition at line 32 of file pnmimage_base.h.

◆ pixval

typedef gray pixval

Definition at line 88 of file pnmimage_base.h.

◆ xel

typedef pixel xel

Definition at line 89 of file pnmimage_base.h.

◆ xelval

typedef gray xelval

Definition at line 90 of file pnmimage_base.h.

Function Documentation

◆ pm_allocrow()

EXPCL_PANDA_PNMIMAGE char * pm_allocrow ( int cols,
int size )

Allocates a row of cols * size bytes.

Definition at line 103 of file pnmimage_base.cxx.

◆ pm_bitstomaxval()

EXPCL_PANDA_PNMIMAGE int pm_bitstomaxval ( int bits)

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

Definition at line 95 of file pnmimage_base.cxx.

Referenced by pm_maxvaltobits().

◆ pm_error()

EXPCL_PANDA_PNMIMAGE 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 54 of file pnmimage_base.cxx.

◆ pm_freerow()

EXPCL_PANDA_PNMIMAGE void pm_freerow ( char * itrow)

Frees the row previously allocated withm pm_allocrow().

Definition at line 111 of file pnmimage_base.cxx.

◆ pm_maxvaltobits()

EXPCL_PANDA_PNMIMAGE int pm_maxvaltobits ( int maxval)

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

Definition at line 81 of file pnmimage_base.cxx.

References pm_bitstomaxval().

◆ pm_message()

EXPCL_PANDA_PNMIMAGE void pm_message ( const char * format,
... )

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

Definition at line 30 of file pnmimage_base.cxx.

◆ pm_readbiglong()

EXPCL_PANDA_PNMIMAGE int pm_readbiglong ( std::istream * in,
long * lP )

Definition at line 134 of file pnmimage_base.cxx.

◆ pm_readbigshort()

EXPCL_PANDA_PNMIMAGE int pm_readbigshort ( std::istream * in,
short * sP )

Definition at line 120 of file pnmimage_base.cxx.

◆ pm_readlittlelong()

EXPCL_PANDA_PNMIMAGE int pm_readlittlelong ( std::istream * in,
long * lP )

Definition at line 162 of file pnmimage_base.cxx.

◆ pm_readlittleshort()

EXPCL_PANDA_PNMIMAGE int pm_readlittleshort ( std::istream * in,
short * sP )

Definition at line 148 of file pnmimage_base.cxx.

◆ pm_writebiglong()

EXPCL_PANDA_PNMIMAGE int pm_writebiglong ( std::ostream * out,
long l )

Definition at line 141 of file pnmimage_base.cxx.

◆ pm_writebigshort()

EXPCL_PANDA_PNMIMAGE int pm_writebigshort ( std::ostream * out,
short s )

Definition at line 127 of file pnmimage_base.cxx.

◆ pm_writelittlelong()

EXPCL_PANDA_PNMIMAGE int pm_writelittlelong ( std::ostream * out,
long l )

Definition at line 169 of file pnmimage_base.cxx.

◆ pm_writelittleshort()

EXPCL_PANDA_PNMIMAGE int pm_writelittleshort ( std::ostream * out,
short s )

Definition at line 155 of file pnmimage_base.cxx.