Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

misc/image.h

Go to the documentation of this file.
00001 #ifndef MISC_IMAGE_H
00002 #define MISC_IMAGE_H
00003 
00004 /*
00005 
00006   GLT OpenGL C++ Toolkit (LGPL)
00007   Copyright (C) 2000-2002 Nigel Stewart  
00008 
00009   Email: nigels.com@gmail.com   
00010   WWW:   http://www.nigels.com/glt/
00011 
00012   This library is free software; you can redistribute it and/or
00013   modify it under the terms of the GNU Lesser General Public
00014   License as published by the Free Software Foundation; either
00015   version 2.1 of the License, or (at your option) any later version.
00016 
00017   This library is distributed in the hope that it will be useful,
00018   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020   Lesser General Public License for more details.
00021 
00022   You should have received a copy of the GNU Lesser General Public
00023   License along with this library; if not, write to the Free Software
00024   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 */
00027 
00058 #include <glt/config.h>
00059 #include <misc/config.h>
00060 
00061 #ifdef GLT_WIN32
00062 #pragma warning(disable: 4786)      
00063 #endif
00064 
00065 #include <string>
00066 #include <iosfwd>
00067 #include <vector>
00068 
00069 //
00070 // Image Processing
00071 //
00072 
00078 bool isGreyscale(const std::string &rgb);
00079 
00085 bool is256Colors(const std::string &rgb);
00086 
00095 void getChannel(std::string &dest,const std::string &src,const uint32 size,const uint32 channel);
00096 
00105 void rgb2Indexed(std::string &dest,const std::string &rgb);
00106 
00113 void indexed2rgb(std::string &dest,const std::string &indexed);
00114 
00123 void flipImage(std::string &dest,const std::string &src,const int width,const int height);
00124 
00133 void mirrorImage(std::string &dest,const std::string &src,const int width,const int height);
00134 
00141 void adjustGamma(std::string &image,const double gamma);
00142 
00153 void adjustHSV(std::string &image,const int width,const int height,const real hue,const real saturation,const real value);
00154 
00159 bool stitchImages(std::string &image,const int dx,const int dy,const std::vector<std::string> &src,const int lineSize);
00160 
00161 //
00162 // Image decoding
00163 //
00164 
00173 bool decode(uint32 &width,uint32 &height,std::string &image,const std::string &data);
00174 
00186 bool decodePPM(std::string &type,uint32 &width,uint32 &height,std::string &image,const std::string &data);
00187 
00197 bool decodeBMP(uint32 &width,uint32 &height,std::string &image,const std::string &data);
00198 
00208 bool decodeTGA(uint32 &width,uint32 &height,std::string &image,const std::string &data);
00209 
00210 #ifdef GLT_PNG
00211 
00220 bool decodePNG(uint32 &width,uint32 &height,std::string &image,const std::string &data);
00221 
00222 #endif
00223 
00224 //
00225 // Image Encoding
00226 //
00227 
00236 bool encodePPM(std::string &data,const uint32 width,const uint32 height,const std::string &image);
00237 
00247 bool encodeBMP(std::string &data,const uint32 width,const uint32 height,const std::string &image);
00248 
00258 bool encodeTGA(std::string &data,const uint32 width,const uint32 height,const std::string &image);
00259 
00260 #ifdef GLT_PNG
00261 
00270 bool encodePNG(std::string &data,const uint32 &width,const uint32 &height,const std::string &image);
00271 
00272 #endif
00273 
00274 
00275 #endif

Generated on Tue Nov 5 11:11:05 2002 for GLT by doxygen1.2.18