Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Image Class Reference

#include <image.H>

List of all members.

Public Member Functions

 Image ()
 Image (Cstr_ptr &file)
 Image (uint w, uint h, uint bpp, uchar *data, bool nd=1)
 Image (uint w, uint h, uint bpp)
virtual ~Image ()
void set (int w, int h, uint bpp, uchar *data, bool nd=1)
void freedata ()
void clear ()
bool resize (uint w, uint h, uint b)
bool resize (uint w, uint h)
int copy_tile (const Image &tile, uint i, uint j)
uint width () const
uint height () const
uint bpp () const
uint size () const
uint row_size () const
mlib::Point2i dims () const
uchardata () const
ucharrow (int k) const
ucharcopy ()
uchar pixel (uint x, uint y) const
uint pixel_rgba (uint x, uint y) const
uint pixel_r (uint x, uint y) const
uint pixel_g (uint x, uint y) const
uint pixel_b (uint x, uint y) const
uint pixel_a (uint x, uint y) const
bool empty () const
bool expand_power2 ()
int resize_rows_mult_4 ()
int load_file (char *file)
int read_png (char *file)
int read_png (FILE *fp)
int write_png (char *file) const
int read_pnm (char *file)
int read_pgm (istream &in, bool ascii)
int read_ppm (istream &in, bool ascii)
int write_pnm (char *file) const

Static Public Member Functions

static int write_png (int w, int h, uint bpp, uchar *data, Cstr_ptr &file)

Protected Types

enum  { PNG_BYTES_TO_CHECK = 8 }

Protected Member Functions

FILE * open_png (char *file)

Protected Attributes

uint _width
uint _height
uint _bpp
uchar_data
bool _no_delete


Detailed Description

Definition at line 33 of file image.H.


Member Enumeration Documentation

anonymous enum [protected]
 

Enumerator:
PNG_BYTES_TO_CHECK 

Definition at line 41 of file image.H.


Constructor & Destructor Documentation

Image::Image  )  [inline]
 

Definition at line 45 of file image.H.

Image::Image Cstr_ptr &  file  )  [inline]
 

Definition at line 46 of file image.H.

References load_file().

Image::Image uint  w,
uint  h,
uint  bpp,
uchar data,
bool  nd = 1
[inline]
 

Definition at line 55 of file image.H.

References set().

Image::Image uint  w,
uint  h,
uint  bpp
[inline]
 

Definition at line 58 of file image.H.

References resize().

virtual Image::~Image  )  [inline, virtual]
 

Definition at line 62 of file image.H.

References clear().


Member Function Documentation

uint Image::bpp  )  const [inline]
 

Definition at line 119 of file image.H.

References _bpp.

Referenced by TEXTUREgl::bpp_to_format(), TEXTURE::expand_power2(), PaperEffect::get_texture(), TEXTUREgl::load_texture(), RefImage::read_file(), XToonTexture::update_tex(), and ToonTexture_1D::update_tex().

void Image::clear void   )  [inline]
 

Definition at line 84 of file image.H.

References _bpp, _height, _no_delete, _width, and freedata().

Referenced by TEXTUREgl::copy_texture(), read_pgm(), read_png(), read_ppm(), set(), and ~Image().

uchar * Image::copy  ) 
 

Definition at line 25 of file image.C.

References _data, empty(), err_ret(), and size().

Referenced by PaperEffect::get_texture(), TEXTUREgl::load_texture(), XToonTexture::update_tex(), and ToonTexture_1D::update_tex().

int Image::copy_tile const Image tile,
uint  i,
uint  j
 

Definition at line 60 of file image.C.

References _bpp, _height, _width, err_msg(), row(), and row_size().

Referenced by VIEW::screen_grab().

uchar* Image::data  )  const [inline]
 

Definition at line 123 of file image.H.

References _data.

Referenced by RefImage::copy_rgb(), expand_power2(), TEXTUREgl::load_texture(), Recorder::post_draw_CB(), Animator::post_draw_CB(), RefImage::read_file(), and VIEW::screen_grab().

mlib::Point2i Image::dims  )  const [inline]
 

Definition at line 122 of file image.H.

References _height, and _width.

Referenced by TEXTUREgl::get_size().

bool Image::empty  )  const [inline]
 

Definition at line 138 of file image.H.

References _bpp, _data, _height, and _width.

Referenced by copy(), TEXTURE::expand_image(), expand_power2(), PaperEffect::get_texture(), TEXTURE::load_image(), TEXTUREgl::load_texture(), resize_rows_mult_4(), TEXTURE::set_image(), XToonTexture::update_tex(), and ToonTexture_1D::update_tex().

bool Image::expand_power2  ) 
 

Definition at line 329 of file image.C.

References _bpp, _data, _height, _width, data(), empty(), err_ret(), getPower2Size(), and set().

Referenced by TEXTURE::expand_image(), and TEXTURE::expand_power2().

void Image::freedata  )  [inline]
 

Definition at line 77 of file image.H.

References _data, and _no_delete.

Referenced by clear(), and TEXTUREgl::load_texture().

uint Image::height  )  const [inline]
 

Definition at line 118 of file image.H.

References _height.

Referenced by TEXTURE::expand_image(), PaperEffect::get_texture(), TEXTUREgl::load_texture(), main(), TexMemRefImage::read_FB(), RefImage::read_file(), TexMemRefImage::resize(), VIEW::screen_grab(), XToonTexture::update_tex(), and ToonTexture_1D::update_tex().

int Image::load_file char *  file  ) 
 

Definition at line 103 of file image.C.

References ERR_INCL_ERRNO, ERR_LEV_INFO, err_mesg(), read_png(), and read_pnm().

Referenced by PaperEffect::get_texture(), Image(), TEXTURE::load_image(), RefImage::read_file(), XToonTexture::update_tex(), and ToonTexture_1D::update_tex().

FILE * Image::open_png char *  file  )  [protected]
 

Definition at line 364 of file image.C.

References err_ret(), and PNG_BYTES_TO_CHECK.

Referenced by read_png().

uchar Image::pixel uint  x,
uint  y
const [inline]
 

Definition at line 127 of file image.H.

References _bpp, _height, _width, and row().

Referenced by main().

uint Image::pixel_a uint  x,
uint  y
const
 

Definition at line 682 of file image.C.

References pixel_rgba(), and rgba_to_a().

uint Image::pixel_b uint  x,
uint  y
const
 

Definition at line 676 of file image.C.

References pixel_rgba(), and rgba_to_b().

uint Image::pixel_g uint  x,
uint  y
const
 

Definition at line 670 of file image.C.

References pixel_rgba(), and rgba_to_g().

uint Image::pixel_r uint  x,
uint  y
const
 

Definition at line 664 of file image.C.

References pixel_rgba(), and rgba_to_r().

uint Image::pixel_rgba uint  x,
uint  y
const
 

Definition at line 632 of file image.C.

References _bpp, _height, _width, build_rgba(), err_msg(), and row().

Referenced by pixel_a(), pixel_b(), pixel_g(), and pixel_r().

int Image::read_pgm istream &  in,
bool  ascii
 

Definition at line 175 of file image.C.

References _bpp, _data, _height, _no_delete, _width, clear(), eat_whitespace(), err_ret(), pnm_read_int(), and row().

Referenced by read_pnm().

int Image::read_png FILE *  fp  ) 
 

Definition at line 419 of file image.C.

References _bpp, _data, _height, _no_delete, _width, clear(), err_msg(), err_ret(), PNG_BYTES_TO_CHECK, and size().

int Image::read_png char *  file  ) 
 

Definition at line 401 of file image.C.

References err_msg(), and open_png().

Referenced by load_file(), and main().

int Image::read_pnm char *  file  ) 
 

Definition at line 135 of file image.C.

References err_ret(), read_pgm(), and read_ppm().

Referenced by load_file().

int Image::read_ppm istream &  in,
bool  ascii
 

Definition at line 233 of file image.C.

References _bpp, _data, _height, _no_delete, _width, clear(), eat_whitespace(), err_ret(), pnm_read_int(), and row().

Referenced by read_pnm().

bool Image::resize uint  w,
uint  h
[inline]
 

Definition at line 112 of file image.H.

References _bpp, and resize().

bool Image::resize uint  w,
uint  h,
uint  b
[inline]
 

Definition at line 90 of file image.H.

References _bpp, _data, _height, _no_delete, _width, err_ret(), and size().

Referenced by RefImage::copy_rgb(), TEXTURE::expand_power2(), Image(), resize(), and AUX_JOB::set_size().

int Image::resize_rows_mult_4  ) 
 

Definition at line 39 of file image.C.

References _bpp, _height, _width, empty(), err_ret(), row(), row_size(), and set().

uchar* Image::row int  k  )  const [inline]
 

Definition at line 124 of file image.H.

References _data, and row_size().

Referenced by copy_tile(), pixel(), pixel_rgba(), read_pgm(), read_ppm(), resize_rows_mult_4(), and write_png().

uint Image::row_size  )  const [inline]
 

Definition at line 121 of file image.H.

References _bpp, and _width.

Referenced by copy_tile(), resize_rows_mult_4(), and row().

void Image::set int  w,
int  h,
uint  bpp,
uchar data,
bool  nd = 1
[inline]
 

Definition at line 64 of file image.H.

References _bpp, _data, _height, _no_delete, _width, clear(), and err_msg().

Referenced by expand_power2(), Image(), resize_rows_mult_4(), and TEXTURE::set_image().

uint Image::size  )  const [inline]
 

Definition at line 120 of file image.H.

References _bpp, _height, and _width.

Referenced by copy(), read_png(), and resize().

uint Image::width  )  const [inline]
 

Definition at line 117 of file image.H.

References _width.

Referenced by TEXTURE::expand_image(), PaperEffect::get_texture(), TEXTUREgl::load_texture(), main(), TexMemRefImage::read_FB(), RefImage::read_file(), TexMemRefImage::resize(), VIEW::screen_grab(), XToonTexture::update_tex(), and ToonTexture_1D::update_tex().

static int Image::write_png int  w,
int  h,
uint  bpp,
uchar data,
Cstr_ptr &  file
[inline, static]
 

Definition at line 155 of file image.H.

References write_png().

int Image::write_png char *  file  )  const
 

Definition at line 539 of file image.C.

References _bpp, _data, _height, _width, err_msg(), err_ret(), Config::get_var_dbl(), and row().

Referenced by Recorder::post_draw_CB(), Animator::post_draw_CB(), VIEW::screen_grab(), RefImage::write_file(), and write_png().

int Image::write_pnm char *  file  )  const
 

Definition at line 290 of file image.C.

References _bpp, _data, _height, _width, and err_msg().

Referenced by VIEW::screen_grab().


Member Data Documentation

uint Image::_bpp [protected]
 

Definition at line 37 of file image.H.

Referenced by bpp(), clear(), copy_tile(), empty(), expand_power2(), pixel(), pixel_rgba(), read_pgm(), read_png(), read_ppm(), resize(), resize_rows_mult_4(), row_size(), set(), size(), write_png(), and write_pnm().

uchar* Image::_data [protected]
 

Definition at line 38 of file image.H.

Referenced by copy(), data(), empty(), expand_power2(), freedata(), read_pgm(), read_png(), read_ppm(), resize(), row(), set(), write_png(), and write_pnm().

uint Image::_height [protected]
 

Definition at line 36 of file image.H.

Referenced by clear(), copy_tile(), dims(), empty(), expand_power2(), height(), pixel(), pixel_rgba(), read_pgm(), read_png(), read_ppm(), resize(), resize_rows_mult_4(), set(), size(), write_png(), and write_pnm().

bool Image::_no_delete [protected]
 

Definition at line 39 of file image.H.

Referenced by clear(), freedata(), read_pgm(), read_png(), read_ppm(), resize(), and set().

uint Image::_width [protected]
 

Definition at line 35 of file image.H.

Referenced by clear(), copy_tile(), dims(), empty(), expand_power2(), pixel(), pixel_rgba(), read_pgm(), read_png(), read_ppm(), resize(), resize_rows_mult_4(), row_size(), set(), size(), width(), write_png(), and write_pnm().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:46:05 2006 for jot by  doxygen 1.4.4