PortablePicture< T > Class Template Reference

A picture that can be loaded from various sources, accessed, and saved to a portable pixmap. More...

#include <PortablePicture.h>

Inheritance diagram for PortablePicture:

Inheritance graph
[legend]
List of all members.

Public Methods

 PortablePicture ()
 Standard constructor.

 PortablePicture (int width_in, int height_in)
 Constructor that takes the width and height in pixels.

void getRange (T &our_min, T &our_max)
 Get the minimum and maximum storable color value. More...

void loadFile (const char *filename)
 loadFile: try to load a picture file. More...

void setDimensions (int width_in, int height_in)
 Sets the width and height of the picture, in pixels.

int getWidth () const
 Gets the width of the image in pixels.

int getHeight () const
 Gets the heightof the image in pixels.

getMaxColor () const
ColorType getInterpolated (float y, float x) const
 Gets a bilinearly interpolated color.

ColorType at (unsigned int y, unsigned int x) const
 Standard accessor method.

ColorType * operator[] (int row)
 Standard accessor method.

void saveAs (const char *filename) const
 Saves the image to a file. More...


Public Attributes

std::vector< ColorType > colorBuffer
 Our actual data.


Detailed Description

template<typename T>
class PortablePicture< T >

A picture that can be loaded from various sources, accessed, and saved to a portable pixmap.

Possible input sources include jpg's, gif's, and bmp's. Uses Microsoft's "IPicture" interface.

Definition at line 115 of file PortablePicture.h.


Member Function Documentation

template<typename T>
void PortablePicture< T >::getRange T &    our_min,
T &    our_max
[inline]
 

Get the minimum and maximum storable color value.

For unsigned byte, this is 0 to 255; for a float, it is 0 and 1.0.

Definition at line 141 of file PortablePicture.h.

Referenced by PortablePicture< unsigned char >::loadFile().

template<typename T>
void PortablePicture< T >::loadFile const char *    filename [inline]
 

loadFile: try to load a picture file.

Right now, this just handles the normal PortableXMaps, with the exception of PBM binary files (ie the "P4" kind), which we don't handle yet.

Definition at line 161 of file PortablePicture.h.

template<typename T>
void PortablePicture< T >::saveAs const char *    filename const [inline]
 

Saves the image to a file.

The "bAscii" param indicates whether the file should be saved as ascii, as opposed to binary. Supported extensions are .pfm, .ppm, and .pgm.

Definition at line 299 of file PortablePicture.h.


The documentation for this class was generated from the following file:
Generated on Tue May 21 03:35:11 2002 for Archimedes by doxygen1.2.15