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

PNMImage Class Reference

#include <pnmImage.h>

Inheritance diagram for PNMImage:

PNMImageHeader List of all members.

Public Member Functions

INLINE PNMImage ()
INLINE PNMImage (const Filename &filename, PNMFileType *type=NULL)
INLINE PNMImage (int x_size, int y_size, int num_channels=3, xelval maxval=255, PNMFileType *type=NULL)
INLINE PNMImage (const PNMImage &copy)
INLINE void operator= (const PNMImage &copy)
INLINE ~PNMImage ()
INLINE xelval clamp_val (int input_value) const
INLINE xelval to_val (double input_value) const
INLINE double from_val (xelval input_value) const
void clear ()
void clear (int x_size, int y_size, int num_channels=3, xelval maxval=255, PNMFileType *type=NULL)
void copy_from (const PNMImage &copy)
void copy_header_from (const PNMImageHeader &header)
INLINE void fill (double red, double green, double blue)
INLINE void fill (double gray=0.0)
void fill_val (xelval red, xelval green, xelval blue)
INLINE void fill_val (xelval gray=0)
INLINE void alpha_fill (double alpha=0.0)
void alpha_fill_val (xelval alpha=0)
bool read (const Filename &filename, PNMFileType *type=NULL)
bool read (PNMReader *reader)
bool write (const Filename &filename, PNMFileType *type=NULL) const
bool write (PNMWriter *writer) const
INLINE bool is_valid () const
INLINE void set_num_channels (int num_channels)
void set_color_type (ColorType color_type)
INLINE void add_alpha ()
INLINE void remove_alpha ()
INLINE void make_grayscale ()
void make_grayscale (double rc, double gc, double bc)
INLINE void make_rgb ()
void set_maxval (xelval maxval)
INLINE const xelget_xel_val (int x, int y) const
INLINE void set_xel_val (int x, int y, const xel &value)
INLINE void set_xel_val (int x, int y, xelval r, xelval g, xelval b)
INLINE void set_xel_val (int x, int y, xelval gray)
INLINE xelval get_red_val (int x, int y) const
INLINE xelval get_green_val (int x, int y) const
INLINE xelval get_blue_val (int x, int y) const
INLINE xelval get_gray_val (int x, int y) const
INLINE xelval get_alpha_val (int x, int y) const
INLINE void set_red_val (int x, int y, xelval r)
INLINE void set_green_val (int x, int y, xelval g)
INLINE void set_blue_val (int x, int y, xelval b)
INLINE void set_gray_val (int x, int y, xelval gray)
INLINE void set_alpha_val (int x, int y, xelval a)
xelval get_channel_val (int x, int y, int channel) const
void set_channel_val (int x, int y, int channel, xelval value)
INLINE RGBColord get_xel (int x, int y) const
INLINE void set_xel (int x, int y, const RGBColord &value)
INLINE void set_xel (int x, int y, double r, double g, double b)
INLINE void set_xel (int x, int y, double gray)
INLINE double get_red (int x, int y) const
INLINE double get_green (int x, int y) const
INLINE double get_blue (int x, int y) const
INLINE double get_gray (int x, int y) const
INLINE double get_alpha (int x, int y) const
INLINE void set_red (int x, int y, double r)
INLINE void set_green (int x, int y, double g)
INLINE void set_blue (int x, int y, double b)
INLINE void set_gray (int x, int y, double gray)
INLINE void set_alpha (int x, int y, double a)
INLINE double get_channel (int x, int y, int channel) const
INLINE void set_channel (int x, int y, int channel, double value)
INLINE double get_bright (int x, int y) const
INLINE double get_bright (int x, int y, double rc, double gc, double bc) const
INLINE double get_bright (int x, int y, double rc, double gc, double bc, double ac) const
INLINE void blend (int x, int y, const RGBColord &val, double alpha)
void blend (int x, int y, double r, double g, double b, double alpha)
INLINE xeloperator[] (int y)
INLINE const xeloperator[] (int y) const
void copy_sub_image (const PNMImage &copy, int xto, int yto, int xfrom=0, int yfrom=0, int x_size=-1, int y_size=-1)
INLINE void box_filter (double radius=1.0)
INLINE void gaussian_filter (double radius=1.0)
void box_filter_from (double radius, const PNMImage &copy)
void gaussian_filter_from (double radius, const PNMImage &copy)
void quick_filter_from (const PNMImage &copy, int xborder=0, int yborder=0)

Private Member Functions

INLINE void allocate_array ()
INLINE void allocate_alpha ()
INLINE xelrow (int row) const
INLINE xelvalalpha_row (int row) const
void setup_rc ()

Private Attributes

xel_array
xelval_alpha
double _default_rc
double _default_gc
double _default_bc

Constructor & Destructor Documentation

INLINE PNMImage::PNMImage  ) 
 

INLINE PNMImage::PNMImage const Filename &  filename,
PNMFileType type = NULL
 

INLINE PNMImage::PNMImage int  x_size,
int  y_size,
int  num_channels = 3,
xelval  maxval = 255,
PNMFileType type = NULL
 

INLINE PNMImage::PNMImage const PNMImage &  copy  ) 
 

INLINE PNMImage::~PNMImage  ) 
 


Member Function Documentation

INLINE void PNMImage::add_alpha  ) 
 

Referenced by alpha_fill_val().

INLINE void PNMImage::allocate_alpha  )  [private]
 

Referenced by clear(), copy_header_from(), and set_color_type().

INLINE void PNMImage::allocate_array  )  [private]
 

Referenced by clear(), and copy_header_from().

INLINE void PNMImage::alpha_fill double  alpha = 0.0  ) 
 

void PNMImage::alpha_fill_val xelval  alpha = 0  ) 
 

Definition at line 139 of file pnmImage.cxx.

References add_alpha(), alpha, PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), is_valid(), set_alpha_val(), x, and y.

INLINE xelval* PNMImage::alpha_row int  row  )  const [private]
 

void PNMImage::blend int  x,
int  y,
double  r,
double  g,
double  b,
double  alpha
 

Definition at line 465 of file pnmImage.cxx.

References alpha, b, g, get_alpha(), get_blue(), get_green(), get_red(), get_xel(), PNMImageHeader::has_alpha(), r, RGBColord, set_alpha(), set_xel(), x, and y.

INLINE void PNMImage::blend int  x,
int  y,
const RGBColord val,
double  alpha
 

INLINE void PNMImage::box_filter double  radius = 1.0  ) 
 

void PNMImage::box_filter_from double  radius,
const PNMImage &  copy
 

Definition at line 445 of file pnm-image-filter.cxx.

References box_filter_impl(), filter_image(), and width.

INLINE xelval PNMImage::clamp_val int  input_value  )  const
 

void PNMImage::clear int  x_size,
int  y_size,
int  num_channels = 3,
xelval  maxval = 255,
PNMFileType type = NULL
 

Definition at line 54 of file pnmImage.cxx.

References _alpha, _array, PNMImageHeader::_maxval, PNMImageHeader::_num_channels, PNMImageHeader::_type, PNMImageHeader::_x_size, PNMImageHeader::_y_size, allocate_alpha(), allocate_array(), clear(), PNMImageHeader::has_alpha(), setup_rc(), type, and xelval.

void PNMImage::clear  ) 
 

Definition at line 31 of file pnmImage.cxx.

References _alpha, _array, PNMImageHeader::_maxval, PNMImageHeader::_num_channels, PNMImageHeader::_type, PNMImageHeader::_x_size, PNMImageHeader::_y_size, NULL, and xelval.

Referenced by clear(), copy_from(), copy_header_from(), read(), and PixelBuffer::store().

void PNMImage::copy_from const PNMImage &  copy  ) 
 

Definition at line 82 of file pnmImage.cxx.

References _alpha, _array, PNMImageHeader::_x_size, PNMImageHeader::_y_size, clear(), copy_header_from(), PNMImageHeader::has_alpha(), is_valid(), and xelval.

void PNMImage::copy_header_from const PNMImageHeader header  ) 
 

Definition at line 104 of file pnmImage.cxx.

References allocate_alpha(), allocate_array(), clear(), PNMImageHeader::has_alpha(), PNMImageHeader::operator=(), and setup_rc().

Referenced by copy_from(), and read().

void PNMImage::copy_sub_image const PNMImage &  copy,
int  xto,
int  yto,
int  xfrom = 0,
int  yfrom = 0,
int  x_size = -1,
int  y_size = -1
 

Definition at line 510 of file pnmImage.cxx.

References get_alpha(), PNMImageHeader::get_x_size(), get_xel(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), set_alpha(), set_xel(), x, and y.

Referenced by event_T().

INLINE void PNMImage::fill double  gray = 0.0  ) 
 

INLINE void PNMImage::fill double  red,
double  green,
double  blue
 

Referenced by GLGraphicsStateGuardian::build_phony_mipmap_level(), CRGraphicsStateGuardian::build_phony_mipmap_level(), and event_T().

INLINE void PNMImage::fill_val xelval  gray = 0  ) 
 

void PNMImage::fill_val xelval  red,
xelval  green,
xelval  blue
 

Definition at line 123 of file pnmImage.cxx.

References blue, PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), green, is_valid(), set_xel_val(), x, and y.

INLINE double PNMImage::from_val xelval  input_value  )  const
 

INLINE void PNMImage::gaussian_filter double  radius = 1.0  ) 
 

void PNMImage::gaussian_filter_from double  radius,
const PNMImage &  copy
 

Definition at line 459 of file pnm-image-filter.cxx.

References filter_image(), gaussian_filter_impl(), and width.

INLINE double PNMImage::get_alpha int  x,
int  y
const
 

Referenced by blend(), copy_sub_image(), and Texture::read().

INLINE xelval PNMImage::get_alpha_val int  x,
int  y
const
 

Referenced by get_channel_val(), PixelBuffer::load(), and set_maxval().

INLINE double PNMImage::get_blue int  x,
int  y
const
 

Referenced by blend().

INLINE xelval PNMImage::get_blue_val int  x,
int  y
const
 

Referenced by get_channel_val(), PixelBuffer::load(), and set_maxval().

INLINE double PNMImage::get_bright int  x,
int  y,
double  rc,
double  gc,
double  bc,
double  ac
const
 

INLINE double PNMImage::get_bright int  x,
int  y,
double  rc,
double  gc,
double  bc
const
 

INLINE double PNMImage::get_bright int  x,
int  y
const
 

Referenced by make_grayscale(), and set_color_type().

INLINE double PNMImage::get_channel int  x,
int  y,
int  channel
const
 

xelval PNMImage::get_channel_val int  x,
int  y,
int  channel
const
 

Definition at line 393 of file pnmImage.cxx.

References PNMImageHeader::_num_channels, get_alpha_val(), get_blue_val(), get_green_val(), PNMImageHeader::get_num_channels(), get_red_val(), x, and y.

Referenced by Texture::read().

INLINE double PNMImage::get_gray int  x,
int  y
const
 

Referenced by Texture::read().

INLINE xelval PNMImage::get_gray_val int  x,
int  y
const
 

Referenced by PixelBuffer::load(), set_color_type(), and set_maxval().

INLINE double PNMImage::get_green int  x,
int  y
const
 

Referenced by blend().

INLINE xelval PNMImage::get_green_val int  x,
int  y
const
 

Referenced by get_channel_val(), PixelBuffer::load(), and set_maxval().

INLINE double PNMImage::get_red int  x,
int  y
const
 

Referenced by blend().

INLINE xelval PNMImage::get_red_val int  x,
int  y
const
 

Referenced by get_channel_val(), PixelBuffer::load(), and set_maxval().

INLINE RGBColord PNMImage::get_xel int  x,
int  y
const
 

Referenced by blend(), and copy_sub_image().

INLINE const xel& PNMImage::get_xel_val int  x,
int  y
const
 

INLINE bool PNMImage::is_valid  )  const
 

Referenced by alpha_fill_val(), GLGraphicsStateGuardian::build_phony_mipmap_level(), CRGraphicsStateGuardian::build_phony_mipmap_level(), copy_from(), fill_val(), FUNCTION_NAME(), and write().

void PNMImage::make_grayscale double  rc,
double  gc,
double  bc
 

Definition at line 326 of file pnmImage.cxx.

References PNMImageHeader::_num_channels, get_bright(), PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), PNMImageHeader::is_grayscale(), set_gray(), setup_rc(), x, and y.

INLINE void PNMImage::make_grayscale  ) 
 

INLINE void PNMImage::make_rgb  ) 
 

INLINE void PNMImage::operator= const PNMImage &  copy  ) 
 

INLINE const xel* PNMImage::operator[] int  y  )  const
 

INLINE xel* PNMImage::operator[] int  y  ) 
 

void PNMImage::quick_filter_from const PNMImage &  copy,
int  xborder = 0,
int  yborder = 0
 

Definition at line 567 of file pnm-image-filter.cxx.

References box_filter_region(), PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), set_alpha_val(), and xelval.

Referenced by GLGraphicsStateGuardian::build_phony_mipmap_level(), CRGraphicsStateGuardian::build_phony_mipmap_level(), consider_rescale(), DXTextureContext7::CreateTexture(), and Texture::read().

bool PNMImage::read PNMReader reader  ) 
 

Definition at line 185 of file pnmImage.cxx.

References _alpha, _array, PNMImageHeader::_type, PNMImageHeader::_y_size, clear(), copy_header_from(), NULL, reader(), and setup_rc().

bool PNMImage::read const Filename &  filename,
PNMFileType type = NULL
 

Definition at line 161 of file pnmImage.cxx.

References clear(), PNMImageHeader::make_reader(), NULL, reader(), and type.

Referenced by GLGraphicsStateGuardian::build_phony_mipmap_level(), CRGraphicsStateGuardian::build_phony_mipmap_level(), Texture::read(), and PixelBuffer::read().

INLINE void PNMImage::remove_alpha  ) 
 

INLINE xel* PNMImage::row int  row  )  const [private]
 

INLINE void PNMImage::set_alpha int  x,
int  y,
double  a
 

Referenced by blend(), copy_sub_image(), and PixelBuffer::store().

INLINE void PNMImage::set_alpha_val int  x,
int  y,
xelval  a
 

Referenced by alpha_fill_val(), quick_filter_from(), set_channel_val(), and set_maxval().

INLINE void PNMImage::set_blue int  x,
int  y,
double  b
 

Referenced by PixelBuffer::store().

INLINE void PNMImage::set_blue_val int  x,
int  y,
xelval  b
 

Referenced by set_channel_val(), and set_maxval().

INLINE void PNMImage::set_channel int  x,
int  y,
int  channel,
double  value
 

void PNMImage::set_channel_val int  x,
int  y,
int  channel,
xelval  value
 

Definition at line 428 of file pnmImage.cxx.

References PNMImageHeader::_num_channels, set_alpha_val(), set_blue_val(), set_green_val(), set_red_val(), x, and y.

void PNMImage::set_color_type ColorType  color_type  ) 
 

Definition at line 276 of file pnmImage.cxx.

References _alpha, PNMImageHeader::_num_channels, PNMImageHeader::_x_size, PNMImageHeader::_y_size, allocate_alpha(), get_bright(), PNMImageHeader::get_color_type(), get_gray_val(), PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), PNMImageHeader::is_grayscale(), NULL, set_gray(), set_xel_val(), setup_rc(), x, xelval, and y.

INLINE void PNMImage::set_gray int  x,
int  y,
double  gray
 

Referenced by make_grayscale(), set_color_type(), and PixelBuffer::store().

INLINE void PNMImage::set_gray_val int  x,
int  y,
xelval  gray
 

Referenced by set_maxval().

INLINE void PNMImage::set_green int  x,
int  y,
double  g
 

Referenced by PixelBuffer::store().

INLINE void PNMImage::set_green_val int  x,
int  y,
xelval  g
 

Referenced by set_channel_val(), and set_maxval().

void PNMImage::set_maxval xelval  maxval  ) 
 

Definition at line 347 of file pnmImage.cxx.

References PNMImageHeader::_maxval, get_alpha_val(), get_blue_val(), get_gray_val(), get_green_val(), get_red_val(), PNMImageHeader::get_x_size(), PNMImageHeader::get_y_size(), PNMImageHeader::has_alpha(), PNMImageHeader::is_grayscale(), set_alpha_val(), set_blue_val(), set_gray_val(), set_green_val(), set_red_val(), x, xelval, and y.

INLINE void PNMImage::set_num_channels int  num_channels  ) 
 

Referenced by consider_downgrade().

INLINE void PNMImage::set_red int  x,
int  y,
double  r
 

Referenced by PixelBuffer::store().

INLINE void PNMImage::set_red_val int  x,
int  y,
xelval  r
 

Referenced by set_channel_val(), and set_maxval().

INLINE void PNMImage::set_xel int  x,
int  y,
double  gray
 

INLINE void PNMImage::set_xel int  x,
int  y,
double  r,
double  g,
double  b
 

INLINE void PNMImage::set_xel int  x,
int  y,
const RGBColord value
 

Referenced by blend(), and copy_sub_image().

INLINE void PNMImage::set_xel_val int  x,
int  y,
xelval  gray
 

INLINE void PNMImage::set_xel_val int  x,
int  y,
xelval  r,
xelval  g,
xelval  b
 

INLINE void PNMImage::set_xel_val int  x,
int  y,
const xel value
 

Referenced by fill_val(), and set_color_type().

void PNMImage::setup_rc  )  [private]
 

Definition at line 560 of file pnmImage.cxx.

References _default_bc, _default_gc, _default_rc, and PNMImageHeader::is_grayscale().

Referenced by clear(), copy_header_from(), make_grayscale(), read(), and set_color_type().

INLINE xelval PNMImage::to_val double  input_value  )  const
 

bool PNMImage::write PNMWriter writer  )  const
 

Definition at line 246 of file pnmImage.cxx.

References _alpha, _array, PNMImageHeader::_y_size, is_valid(), NULL, and writer().

bool PNMImage::write const Filename &  filename,
PNMFileType type = NULL
const
 

Definition at line 222 of file pnmImage.cxx.

References is_valid(), PNMImageHeader::make_writer(), NULL, type, and writer().

Referenced by Texture::write(), and PixelBuffer::write().


Member Data Documentation

xelval* PNMImage::_alpha [private]
 

Definition at line 201 of file pnmImage.h.

Referenced by clear(), copy_from(), read(), set_color_type(), and write().

xel* PNMImage::_array [private]
 

Definition at line 200 of file pnmImage.h.

Referenced by clear(), copy_from(), read(), and write().

double PNMImage::_default_bc [private]
 

Definition at line 202 of file pnmImage.h.

Referenced by setup_rc().

double PNMImage::_default_gc [private]
 

Definition at line 202 of file pnmImage.h.

Referenced by setup_rc().

double PNMImage::_default_rc [private]
 

Definition at line 202 of file pnmImage.h.

Referenced by setup_rc().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:13:16 2003 for Panda by doxygen1.3