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

iptk::Image Class Reference

#include <image.h>

Collaboration diagram for iptk::Image:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is the basic image class.

An image can be either an 8-bit gray-scale image or a 24-bit RGB image. This class supports loading and saving from a file and also provides pixel access methods. This class also has methods which can retrieve properties of the image like the histogram, minimum pixel, maximum pixel etc.


Public Member Functions

 Image (void)
 Default constructor.

 Image (int width, int height, BitDepth bd)
 Memory initialising constructor.

 Image (const Image &im)
 Copy constructor.

virtual ~Image ()
 Destructor.

virtual void loadFile (const char *fileName)
 File loader.

virtual void saveFile (const char *fileName)
 File saver.

void rgb2gray (void)
 Converts an RGB image into a gray-scale image.

gutk::Size getSize (void)
 Returns the size of the image as a Size object.

double getRed (const gutk::Point &p)
 Returns the Red value from an RGB image.

double getRed (int n, int m)
 Returns the Red value from an RGB image.

double getGreen (const gutk::Point &p)
 Returns the Green value from an RGB image.

double getGreen (int n, int m)
 Returns the Green value from an RGB image.

double getBlue (const gutk::Point &p)
 Returns the Blue value from an RGB image.

double getBlue (int n, int m)
 Returns the Blue value from an RGB image.

double getIntensity (const gutk::Point &p)
 Returns the Intensity value from a gray-scale image.

double getIntensity (int n, int m)
 Returns the Intensity value from a gray-scale image.

void setRed (const gutk::Point &p, const double v)
 Sets the Red value of an RGB image.

void setRed (int n, int m, const double v)
 Sets the Red value of an RGB image.

void setGreen (const gutk::Point &p, const double v)
 Sets the Green value of an RGB image.

void setGreen (int n, int m, const double v)
 Sets the Green value of an RGB image.

void setBlue (const gutk::Point &p, const double v)
 Sets the Blue value of an RGB image.

void setBlue (int n, int m, const double v)
 Sets the Blue value of an RGB image.

void setIntensity (const gutk::Point &p, const double v)
 Sets the Intensity value of a gray-scale image.

void setIntensity (int n, int m, const double v)
 Sets the Intensity value of a gray-scale image.

BitDepth getDepth (void)
 Returns the bit-depth of the image.

mutk::Vector getHistogram (ColourLayer layer)
 Returns the histogram of the image layer specified.

void getMaxPixel (ColourLayer layer, gutk::Point &p, double &val)
 Returns the location and intensity of the pixel with the highest intensity.

void getMinPixel (ColourLayer layer, gutk::Point &p, double &val)
 Returns the location and intensity of the pixel with the lowest intensity.

void adjustIntensity (void)
 Adjust the intensity range of the image.

virtual void operator= (const Image &im)
 Overloaded assignment operator.


Constructor & Destructor Documentation

iptk::Image::Image void   ) 
 

Default constructor.

It does nothing and memory is not initialised.

iptk::Image::Image int  width,
int  height,
BitDepth  bd
 

Memory initialising constructor.

This initialises the memory (and hence an image) required to store an image of size specified by width and height and of bit-depth specified by bd. Use this constructor if you are interested in etching out your own image. The bit-depth can be one of RGB or GRAY_SCALE.

iptk::Image::Image const Image im  ) 
 

Copy constructor.

This is only a reference copier. The new object and the object passed as argument share the same data. But the user should keep in mind that passing an empty object to a function would result in a call by value, where as passing a non-empty object would result in call by reference.

virtual iptk::Image::~Image  )  [virtual]
 

Destructor.

It does take care of the number of references before freeing (actually delete-ing) the memory.


Member Function Documentation

void iptk::Image::adjustIntensity void   ) 
 

Adjust the intensity range of the image.

The intensity values in the image are rescaled so that the maximum value is 255 and the minimum value is 0. If the image is a constant-intensity valued image, then it is left untouched.

double iptk::Image::getBlue int  n,
int  m
 

Returns the Blue value from an RGB image.

Will return 0 for a gray-scale image or if the point (n, m) does not belong to the image.

double iptk::Image::getBlue const gutk::Point p  ) 
 

Returns the Blue value from an RGB image.

Will return 0 for a gray-scale image or if the point p does not belong to the image.

double iptk::Image::getGreen int  n,
int  m
 

Returns the Green value from an RGB image.

Will return 0 for a gray-scale image or if the point (n, m) does not belong to the image.

double iptk::Image::getGreen const gutk::Point p  ) 
 

Returns the Green value from an RGB image.

Will return 0 for a gray-scale image or if the point p does not belong to the image.

mutk::Vector iptk::Image::getHistogram ColourLayer  layer  ) 
 

Returns the histogram of the image layer specified.

An empty Vector object of 256 dimensions is returned if the image is empty or if an invalid image layer is specified.

double iptk::Image::getIntensity int  n,
int  m
 

Returns the Intensity value from a gray-scale image.

Will return 0 for an RGB image or if the point (n, m) does not belong to the image.

double iptk::Image::getIntensity const gutk::Point p  ) 
 

Returns the Intensity value from a gray-scale image.

Will return 0 for an RGB image or if the point p does not belong to the image.

void iptk::Image::getMaxPixel ColourLayer  layer,
gutk::Point p,
double &  val
 

Returns the location and intensity of the pixel with the highest intensity.

The layer from which the pixel should be selected has to be specified in the layer argument. The location is returned in p and the intensity value is returned in val.

void iptk::Image::getMinPixel ColourLayer  layer,
gutk::Point p,
double &  val
 

Returns the location and intensity of the pixel with the lowest intensity.

The layer from which the pixel should be selected has to be specified in the layer argument. The location is returned in p and the intensity value is returned in val.

double iptk::Image::getRed int  n,
int  m
 

Returns the Red value from an RGB image.

Will return 0 for a gray-scale image or if the point (n, m) does not belong to the image.

double iptk::Image::getRed const gutk::Point p  ) 
 

Returns the Red value from an RGB image.

Will return 0 for a gray-scale image or if the point p does not belong to the image.

gutk::Size iptk::Image::getSize void   ) 
 

Returns the size of the image as a Size object.

Returns (0, 0) if the image is not yet set. Note that the returned Size object will have width for number of columns and height for number of rows in the image.

virtual void iptk::Image::loadFile const char *  fileName  )  [virtual]
 

File loader.

Loads image from a file. The fileName parameter is to indicate the file name from which it has to be loaded. It uses C-style file pointers for doing its job. You will most often use this fucntion after you create an Image object like:

                            Image A;
                            A.loadFile("fileName");
        

virtual void iptk::Image::operator= const Image im  )  [virtual]
 

Overloaded assignment operator.

This also, like the copy consructor, only a reference copier. The following two statements are equivalent.

                            Image B(A); 
                            Image B = A;
        

void iptk::Image::rgb2gray void   ) 
 

Converts an RGB image into a gray-scale image.

Does not do anything if the image is already a gray-scale image.

virtual void iptk::Image::saveFile const char *  fileName  )  [virtual]
 

File saver.

Save image to a file whose name is provided by the fileName parameter. It uses C-style file pointers for doing its job.

void iptk::Image::setBlue int  n,
int  m,
const double  v
 

Sets the Blue value of an RGB image.

Does nothing if the image is gray-scale or if the point (n, m) does not belong to the image.

void iptk::Image::setBlue const gutk::Point p,
const double  v
 

Sets the Blue value of an RGB image.

Does nothing if the image is gray-scale or if the point p does not belong to the image.

void iptk::Image::setGreen int  n,
int  m,
const double  v
 

Sets the Green value of an RGB image.

Does nothing if the image is gray-scale or if the point (n, m) does not belong to the image.

void iptk::Image::setGreen const gutk::Point p,
const double  v
 

Sets the Green value of an RGB image.

Does nothing if the image is gray-scale or if the point p does not belong to the image.

void iptk::Image::setIntensity int  n,
int  m,
const double  v
 

Sets the Intensity value of a gray-scale image.

Does nothing if the image is gray-scale or if the point (n, m) does not belong to the image.

void iptk::Image::setIntensity const gutk::Point p,
const double  v
 

Sets the Intensity value of a gray-scale image.

Does nothing if the image is gray-scale or if the point p does not belong to the image.

void iptk::Image::setRed int  n,
int  m,
const double  v
 

Sets the Red value of an RGB image.

Does nothing if the image is gray-scale or if the point (n, m) does not belong to the image.

void iptk::Image::setRed const gutk::Point p,
const double  v
 

Sets the Red value of an RGB image.

Does nothing if the image is gray-scale or if the point p does not belong to the image.


The documentation for this class was generated from the following file:
Generated on Mon Nov 22 11:12:42 2004 for ImprolaLib by doxygen 1.3.7