1 /********************************************************************************
2 *                                                                               *
3 *                         G I F   I m a g e   O b j e c t                       *
4 *                                                                               *
5 *********************************************************************************
6 * Copyright (C) 1998,2005 by Jeroen van der Zijp.   All Rights Reserved.        *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or                 *
9 * modify it under the terms of the GNU Lesser General Public                    *
10 * License as published by the Free Software Foundation; either                  *
11 * version 2.1 of the License, or (at your option) any later version.            *
12 *                                                                               *
13 * This library is distributed in the hope that it will be useful,               *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
16 * Lesser General Public License for more details.                               *
17 *                                                                               *
18 * You should have received a copy of the GNU Lesser General Public              *
19 * License along with this library; if not, write to the Free Software           *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
21 *********************************************************************************
22 * $Id: FXGIFImage.h,v 1.20 2005/01/16 16:06:06 fox Exp $                        *
23 ********************************************************************************/
24 #ifndef FXGIFIMAGE_H
25 #define FXGIFIMAGE_H
26 
27 #ifndef FXIMAGE_H
28 #include "FXImage.h"
29 #endif
30 
31 namespace FX {
32 
33 /// GIF Image class
34 class FXAPI FXGIFImage : public FXImage {
FXDECLARE(FXGIFImage)35   FXDECLARE(FXGIFImage)
36 protected:
37   FXGIFImage(){}
38 private:
39   FXGIFImage(const FXGIFImage&);
40   FXGIFImage &operator=(const FXGIFImage&);
41 public:
42   static const FXchar fileExt[];
43 public:
44 
45   /// Construct an image from memory stream formatted as CompuServe GIF format
46   FXGIFImage(FXApp* a,const void *pix=NULL,FXuint opts=0,FXint w=1,FXint h=1);
47 
48   /// Save pixels into stream in [un]GIF format
49   virtual FXbool savePixels(FXStream& store) const;
50 
51   /// Load pixels from stream in CompuServe GIF format
52   virtual FXbool loadPixels(FXStream& store);
53 
54   /// Destroy
55   virtual ~FXGIFImage();
56   };
57 
58 
59 #ifndef FXLOADGIF
60 #define FXLOADGIF
61 
62 /**
63 * Check if stream contains a GIF, return TRUE if so.
64 */
65 extern FXAPI FXbool fxcheckGIF(FXStream& store);
66 
67 
68 /**
69 * Load an GIF (Graphics Interchange Format) file from a stream.
70 * Upon successful return, the pixel array and size are returned.
71 * If an error occurred, the pixel array is set to NULL.
72 */
73 extern FXAPI FXbool fxloadGIF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
74 
75 
76 /**
77 * Save an GIF (Graphics Interchange Format) file to a stream.
78 */
79 extern FXAPI FXbool fxsaveGIF(FXStream& store,const FXColor *data,FXint width,FXint height,FXbool fast=TRUE);
80 
81 #endif
82 
83 }
84 
85 #endif
86