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

image.h

00001 00003 // This software is distributed as part of the Improla library. 00004 // Improla is a GUI framework for image processing. 00005 // 00006 // Copyright (c) 2004, B. R. Siva Chandra, India 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation; either version 2 00011 // of the License, or (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 // 00022 // In case you would like to contact the author, use the following e-mail 00023 // address: sivachandra_br@yahoo.com 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 { // Start of namespace brace. 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; // Use this array if the you are using an RGB image. 00234 double *Green; // Use this array if the you are using an RGB image. 00235 double *Blue; // Use this array if the you are using an RGB image. 00236 00237 double *Intensity; // Use this array if you are using an GRAY_SCALE image. 00238 }; 00239 00240 } // End of namespace brace. 00241 00242 #endif // __IMAGE_H__ 00243

Generated on Mon Nov 22 11:12:41 2004 for ImprolaLib by doxygen 1.3.7