-#include <wx/wx.h>
-
-#include <wx/image.h>
-#include <wx/wfstream.h>
-#include <wx/module.h>
-
-#include <wx/imaggif.h>
-
-/*
-
-FOLLOWING CODE IS BY G.R.G. :
-(except wxInputStream stuff)
-
-*/
-
-/************************************************************************
- READGIF.H - Leer un archivo GIF de 8 bits
- ------------------------------------------------------------------------
- Tratamiento Digital de la Imagen
- ------------------------------------------------------------------------
- Guillermo Rodriguez Garcia
- <guille@iies.es>
-
- Version: 2.0
-*************************************************************************/
-
-typedef struct
-{
- int w; /* width */
- int h; /* height */
- unsigned char *p; /* bitmap */
- unsigned char *pal; /* palette */
-} IMAGEN;
-
-
-/************************************************************************
- READGIF.C - Lee un archivo GIF de 256 colores
- ------------------------------------------------------------------------
- Tratamiento Digital de la Imagen
- ------------------------------------------------------------------------
- Guillermo Rodriguez Garcia
- <guille@iies.es>
-
- Version: 2.0
-*************************************************************************/
-
-
-#include <stdlib.h>
-#include <string.h>
-
-
-/* error codes */
-#define E_OK 0 /* everything was OK */
-#define E_ARCHIVO -1 /* error opening file */
-#define E_FORMATO -2 /* error in gif header */
-#define E_MEMORIA -3 /* error allocating memory */
-
-
-/* This class binding is by VS, so all bugs in it are mine ;-) */
-
-class gifDecoder
-{
- private:
- /* globals */
- int restbits; /* remaining valid bits */
- unsigned int restbyte; /* remaining bytes in this block */
- unsigned int lastbyte; /* last byte read */
-
- wxInputStream *f; /* input file */
-
- public:
- gifDecoder(wxInputStream *s) {f = s;}
- int getcode(int bits);
- int dgif(IMAGEN *img, int interl, int bits);
- int readgif(IMAGEN *img);
-
- private:
- int mygetc() {return (unsigned char)f -> GetC();}
- // This is NEEDED! GetC is char (signed) why we need unsigned value
- // from here
-};
-
-
-
-/* getcode:
- * Reads the next code from the file, with size 'bits'
- * v2.0 - changed to support 'bits' values < 8
- */
-int gifDecoder::getcode(int bits)
-{
- unsigned int mask; /* bit mask */
- unsigned int code; /* code (result) */
-
-
- /* get remaining bits from last byte read */
- mask = (1 << bits) - 1;
- code = (lastbyte >> (8 - restbits)) & mask;
-
- /* keep reading new bytes until needed */
- while (bits > restbits)
- {
- /* if no bytes left in this block, read the next block */
- if (restbyte == 0)
- restbyte = mygetc();