image.h

Go to the documentation of this file.
00001 /*
00002  * File: image.h - abstract class Image
00003  * Project: GED - bitmap editor (ICP)
00004  * Author: Kamil Dudka, xdudka00
00005  * Team: xdudka00, xfilak01, xhefka00, xhradi08
00006  * Created: 2006-03-10
00007  */
00008 
00009 #ifndef IMAGE_H
00010 #define IMAGE_H
00011 
00012 #include <string>
00013 #include "framebuffer.h"
00014 #include "command.h"
00015 
00019 class Image: public FrameBuffer, public CmdHistory {
00020 public:
00026         static Image *readImageFromFile (const char *szFileName);
00027         virtual ~Image() { }
00028 
00033         virtual void save (const std::string &fileName) = 0;
00034 
00038         bool bNew () const { return _bNewImage; }
00039 
00043         std::string name () const { return _fileName; }
00044 
00048         std::string filePattern () const;
00049 
00054         void name (const std::string &name) { _fileName=name; }
00055 
00062         Image &operator<< (Cmd *pCmd) {
00063                 CmdHistory::operator<< (pCmd);
00064                 pCmd->exec();
00065 
00066                 return *this;
00067         }
00068 
00073         class ErrUnknownFF { };
00074 
00078         class ErrLoad { };
00079 
00083         class ErrSave { };
00084 
00085 protected:
00090         Image (const BoxSize &size);
00091 
00096         Image (const std::string &fileName): _fileName (fileName), _bNewImage (false) { }
00097 
00098 private:
00099         std::string _fileName;          
00100         bool _bNewImage;                
00101 };
00102 
00106 class PluginImage: public Image {
00107 public:
00113         PluginImage (const std::string &fileName, const std::string pluginName);
00114 
00119         virtual void save (const std::string &fileName);
00120 
00121 private:
00122         std::string _strPluginName;     
00123 };
00124 
00125 #endif

Generated on Wed Aug 29 00:01:04 2007 for GED 2006 by  doxygen 1.5.2