rcrt::Image Class Reference

#include <Image.h>

Collaboration diagram for rcrt::Image:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Image (int resX, int resY)
 Image ()
 ~Image ()
RGBAColoroperator[] (int y)
int getWidth () const
 get image dimansion x
int getHeight () const
 get image dimansion y
RGBAColorgetPixel (int x, int y)
 Get pixel value on certain position.
void setPixel (const RGBAColor &p, int x, int y)
 Set pixel on certain position.
void setPixel (const RGBColor &p, int x, int y)
void WritePPM (const char *fileName)
 Write content of the image as ppm file.
bool ReadPPM (const char *fileName)
 Read image from ppm file.
bool ReadPNG (const char *fileName)
void WritePNG (const char *fileName)
bool LoadImage (const char *fileName)
void ToneMapping (float Ldmax)

Private Attributes

int resX
int resY
RGBAColorpixel


Detailed Description

Definition at line 10 of file Image.h.


Constructor & Destructor Documentation

rcrt::Image::Image ( int  resX,
int  resY 
) [inline]

Definition at line 16 of file Image.h.

References pixel.

rcrt::Image::Image (  )  [inline]

Definition at line 21 of file Image.h.

References pixel.

rcrt::Image::~Image (  )  [inline]

Definition at line 26 of file Image.h.

References pixel.


Member Function Documentation

RGBAColor* rcrt::Image::operator[] ( int  y  )  [inline]

Definition at line 31 of file Image.h.

References pixel, and resX.

int rcrt::Image::getWidth (  )  const [inline]

get image dimansion x

Definition at line 37 of file Image.h.

References resX.

Referenced by rcrt::ImageTexture::getBump(), rcrt::ImageTexture::getColor(), and rcrt::StereoMetaTracer::trace().

int rcrt::Image::getHeight (  )  const [inline]

get image dimansion y

Definition at line 40 of file Image.h.

References resY.

Referenced by rcrt::ImageTexture::getBump(), rcrt::ImageTexture::getColor(), and rcrt::StereoMetaTracer::trace().

RGBAColor& rcrt::Image::getPixel ( int  x,
int  y 
) [inline]

Get pixel value on certain position.

Definition at line 43 of file Image.h.

References pixel, and resX.

Referenced by rcrt::ImageTexture::getBump(), rcrt::ImageTexture::getColor(), ToneMapping(), rcrt::ThreadedMetaTracer::trace(), rcrt::StereoMetaTracer::trace(), rcrt::ThreadedMetaTracer::traceJob(), and WritePNG().

void rcrt::Image::setPixel ( const RGBAColor p,
int  x,
int  y 
) [inline]

Set pixel on certain position.

Definition at line 53 of file Image.h.

References pixel, and resX.

Referenced by ReadPNG(), ToneMapping(), rcrt::TracingStrategy::trace(), rcrt::ThreadedMetaTracer::trace(), rcrt::SuperMetaTracer::trace(), rcrt::RayCaster::trace(), rcrt::DebugTracer::trace(), and rcrt::ThreadedMetaTracer::traceJob().

void rcrt::Image::setPixel ( const RGBColor p,
int  x,
int  y 
) [inline]

Definition at line 59 of file Image.h.

References pixel, and resX.

void rcrt::Image::WritePPM ( const char *  fileName  ) 

Write content of the image as ppm file.

Definition at line 130 of file Image.cpp.

References resX, and resY.

bool rcrt::Image::ReadPPM ( const char *  fileName  ) 

Read image from ppm file.

Definition at line 62 of file Image.cpp.

References rcrt::eatComments(), rcrt::eatWhitespace(), pixel, resX, and resY.

Referenced by LoadImage().

bool rcrt::Image::ReadPNG ( const char *  fileName  ) 

Read image from png file The image will be converted to float r,g,b

Definition at line 149 of file Image.cpp.

References pixel, read_png(), resX, resY, and setPixel().

Referenced by LoadImage().

void rcrt::Image::WritePNG ( const char *  fileName  ) 

Write image content as RGB png file.

Definition at line 209 of file Image.cpp.

References rcrt::RGBAColor::b(), rcrt::RGBAColor::g(), getPixel(), rcrt::RGBAColor::r(), resX, resY, and write_png().

Referenced by rcrtAnim(), testDispl1(), testLoaders(), testPhoton(), testPhotonRCRT(), and testQuad().

bool rcrt::Image::LoadImage ( const char *  fileName  ) 

Load image from file. This function will check the file extension and use appropriate function

Definition at line 9 of file Image.cpp.

References ReadPNG(), and ReadPPM().

void rcrt::Image::ToneMapping ( float  Ldmax  ) 

Definition at line 240 of file Image.cpp.

References rcrt::RGBAColor::a(), rcrt::RGBAColor::b(), rcrt::RGBAColor::g(), getPixel(), rcrt::RGBAColor::r(), resX, resY, and setPixel().


Member Data Documentation

int rcrt::Image::resX [private]

Definition at line 12 of file Image.h.

Referenced by getPixel(), getWidth(), operator[](), ReadPNG(), ReadPPM(), setPixel(), ToneMapping(), WritePNG(), and WritePPM().

int rcrt::Image::resY [private]

Definition at line 12 of file Image.h.

Referenced by getHeight(), ReadPNG(), ReadPPM(), ToneMapping(), WritePNG(), and WritePPM().

RGBAColor* rcrt::Image::pixel [private]

Definition at line 13 of file Image.h.

Referenced by getPixel(), Image(), operator[](), ReadPNG(), ReadPPM(), setPixel(), and ~Image().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:33:18 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3