image.h
00001 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00025 
00026 
#ifndef __IMAGE_H__
00027 
#define __IMAGE_H__
00028 
00029 
#include <size.h>
00030 
#include <point.h>
00031 
#include <tntVector.h>
00032 
00033 
namespace iptk
00034 { 
00035 
00039 enum BitDepth 
00040 {
00043     
GRAY_SCALE, 
00044     
00047     
RGB 
00048 };   
00049 
00054 enum ColourLayer 
00055 {
00058     
INTENSITY_LAYER, 
00059     
00062     
RED_LAYER, 
00063     
00066     
GREEN_LAYER, 
00067     
00070     
BLUE_LAYER
00071 };
00072 
00078 class Image
00079 {
00080 
public:
00083     
Image(
void); 
00084     
00090     
Image(
int width, 
int height, 
BitDepth bd); 
00091     
00097     
Image(
const Image &im); 
00098     
00102     
virtual ~Image(); 
00103     
00112     
virtual void loadFile(
const char *fileName); 
00113     
00117     
virtual void saveFile(
const char *fileName); 
00118     
00121     
void rgb2gray(
void);
00122     
00126     
gutk::Size getSize(
void);
00127     
00130     
double getRed(
const gutk::Point &p);
00131     
00134     
double getRed(
int n, 
int m);
00135     
00138     
double getGreen(
const gutk::Point &p);
00139     
00142     
double getGreen(
int n, 
int m);
00143     
00146     
double getBlue(
const gutk::Point &p);
00147     
00150     
double getBlue(
int n, 
int m);
00151     
00154     
double getIntensity(
const gutk::Point &p); 
00155     
00158     
double getIntensity(
int n, 
int m); 
00159     
00162     
void setRed(
const gutk::Point &p, 
const double v);
00163     
00166     
void setRed(
int n, 
int m, 
const double v);
00167     
00170     
void setGreen(
const gutk::Point &p, 
const double v);
00171     
00174     
void setGreen(
int n, 
int m, 
const double v);
00175     
00178     
void setBlue(
const gutk::Point &p, 
const double v);
00179     
00182     
void setBlue(
int n, 
int m, 
const double v);
00183     
00186     
void setIntensity(
const gutk::Point &p, 
const double v); 
00187     
00190     
void setIntensity(
int n, 
int m, 
const double v); 
00191     
00194     
BitDepth getDepth(
void);
00195     
00199     
mutk::Vector getHistogram(
ColourLayer layer);
00200     
00205     
void getMaxPixel(
ColourLayer layer, 
gutk::Point &p, 
double &val);
00206     
00211     
void getMinPixel(
ColourLayer layer, 
gutk::Point &p, 
double &val);
00212     
00217     
void adjustIntensity(
void);
00218     
00226     
virtual void operator=(
const Image &im);
00227     
00228 
private:
00229     
BitDepth *depth;
00230     
int *refCount;
00231     
gutk::Size *size;
00232     
00233     
double *Red;   
00234     
double *Green; 
00235     
double *Blue;  
00236     
00237     
double *Intensity; 
00238 };    
00239 
00240 } 
00241 
00242 
#endif // __IMAGE_H__
00243 
Generated on Mon Nov 22 11:12:41 2004 for ImprolaLib  by
 1.3.7