#include <image.h>
Collaboration diagram for iptk::Image:
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. |
|
Default constructor. It does nothing and memory is not initialised. |
|
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. |
|
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. |
|
Destructor. It does take care of the number of references before freeing (actually delete-ing) the memory. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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"); |
|
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; |
|
Converts an RGB image into a gray-scale image. Does not do anything if the image is already a gray-scale image. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |