inet/zz_image_gif.h

Go to the documentation of this file.
00001 /* libzzinet
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00009 #ifndef zz_image_gif_h
00010 #define zz_image_gif_h
00011 
00012 #include <zz_export.h>
00013 
00014 #ifdef _WIN32
00015 extern "C"
00016 {
00017 #include <gd.h>
00018 }
00019 #else
00020 #include <gd.h>
00021 #endif
00022 
00023 #include "zz_image_color.h"
00024 #include "zz_image_font.h"
00025 
00026 /*
00027         Description:
00028         GIF bild
00029 
00030         Remarks:
00031         Bygger på gd 1.3 av: Boutell com.inc. (opensource)
00032 
00033         Library:
00034         libgd.a libzzinet.a (HPUX) libgd.lib libzzinet.lib (win32)
00035 
00036         Platform:
00037     HPUX, win32
00038 
00039         Author:
00040         Toni Thomsson, toni@tonjac.org
00041 */
00042 class ZZ_API CzzImageGif
00043 {
00044 public:
00045 
00046         /*
00047                 Description:
00048                 Skapar en bild-buffert i minnet
00049 
00050                 Remarks:
00051                 Skapar en "tom" bild av en viss storlek med en
00052                 bakgrundsfärg
00053 
00054                 Throws:
00055                 CzzException
00056         */
00057         CzzImageGif( int width,                         // IN, bredd i pixels
00058                                         int height,                     // IN, höjd i pixels
00059                                         const CzzImageColor& bg_color   // IN, bakgrundsfärg
00060                                         );
00061         /*
00062                 Remarks:
00063                 Skapar en bild mha. en lagrad bild
00064         */
00065         CzzImageGif( const char* file // IN, gif fil
00066                                 );
00067 
00068         /*
00069                 Remarks:
00070                 Kopieringskonstruktor
00071         */
00072         CzzImageGif( const CzzImageGif& obj );
00073 
00074         // Description: Frigör bild bufferten
00075         virtual ~CzzImageGif();
00076 
00077         /*
00078                 Description:
00079                 Skriver ut text i bilden på en viss position
00080 
00081                 Throws:
00082                 CzzException
00083         */
00084         void drawText( int x,                                                   // IN, x-position
00085                                         int y,                                                  // IN, y-position
00086                                         const CzzImageFont& font,                   // IN, font
00087                                         const ZZ_IMAGE_FONT_ORIENTATION& o,     // IN, vertikalt/horisontellt
00088                     const CzzImageColor& color,         // IN, tecken färg
00089                                         const char* text                                    // IN, text
00090                                         );
00091 
00092         /*
00093                 Description:
00094                 Spara bilden till en fil
00095                 
00096                 Throws:
00097                 CzzException
00098         */
00099         void dump( const char* file // IN, sökväg till fil
00100                                 ) const;
00101         
00102         /*
00103                 Description:
00104                 Klistrar in en bild på aktuell bild
00105                 
00106                 Remarks:
00107                 Klistrar in bilden på aktuell bild enligt 
00108                 angiven position och förändring av storlek
00109 
00110                 Throws:
00111                 CzzException
00112         */
00113         void paste( int x,                                              // IN, x-position
00114                                 int y,                                          // IN, y-position
00115                                 int width,                                      // IN, bredd
00116                                 int height,                                     // IN, höjd
00117                                 const CzzImageGif& image        // IN, bild
00118                                 );
00119         
00120         // Description: Bredd i pixels
00121         int getWidth( void ) const;
00122 
00123         // Description: Höjd i pixels
00124         int getHeight( void ) const;
00125 
00126         // Description: Bakgrundsfärg
00127         const CzzImageColor& getBackgroundColor( void ) const;
00128         
00129         /*
00130                 Description:
00131                 Tilldelningsoperator
00132         */
00133         const CzzImageGif& operator=( const CzzImageGif& obj // IN, objekt som skall kopieras
00134                                 );
00135 
00136 protected:
00137 
00138         /*
00139                 Description:
00140                 Ta reda på färgindex som bäst överenstämmer
00141                 med angiven färg
00142 
00143                 Remarks:
00144                 protected
00145         */
00146     int findColor( const CzzImageColor& color );
00147 
00148         /*
00149                 Description:
00150                 Returnerar en pekare till angiven font
00151                                 
00152                 Remarks:
00153                 protected
00154         */
00155     gdFontPtr findFontPtr( const CzzImageFont& font );
00156     
00157 private:
00158 
00159         gdImagePtr m_Image;
00160 };
00161 
00162 #endif // zz_image_gif_h
00163 
00164 
00165 

Generated on Thu Sep 21 21:45:42 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO