/usr/include/wx-2.6/wx/gifdecod.h is in wx2.6-headers 2.6.3.2.2-5ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | /////////////////////////////////////////////////////////////////////////////
// Name: gifdecod.h
// Purpose: wxGIFDecoder, GIF reader for wxImage and wxAnimation
// Author: Guillermo Rodriguez Garcia <guille@iies.es>
// Version: 3.02
// CVS-ID: $Id: gifdecod.h,v 1.16 2005/03/16 16:18:19 ABX Exp $
// Copyright: (c) 1999 Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GIFDECOD_H
#define _WX_GIFDECOD_H
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "gifdecod.h"
#endif
#include "wx/defs.h"
#if wxUSE_STREAMS && wxUSE_GIF
#include "wx/stream.h"
#include "wx/image.h"
// --------------------------------------------------------------------------
// Constants
// --------------------------------------------------------------------------
// Error codes:
// Note that the error code wxGIF_TRUNCATED means that the image itself
// is most probably OK, but the decoder didn't reach the end of the data
// stream; this means that if it was not reading directly from file,
// the stream will not be correctly positioned. the
//
enum
{
wxGIF_OK = 0, /* everything was OK */
wxGIF_INVFORMAT, /* error in gif header */
wxGIF_MEMERR, /* error allocating memory */
wxGIF_TRUNCATED /* file appears to be truncated */
};
// Disposal method
// Experimental; subject to change.
//
enum
{
wxGIF_D_UNSPECIFIED = -1, /* not specified */
wxGIF_D_DONOTDISPOSE = 0, /* do not dispose */
wxGIF_D_TOBACKGROUND = 1, /* restore to background colour */
wxGIF_D_TOPREVIOUS = 2 /* restore to previous image */
};
#define MAX_BLOCK_SIZE 256 /* max. block size */
// --------------------------------------------------------------------------
// wxGIFDecoder class
// --------------------------------------------------------------------------
// internal class for storing GIF image data
class GIFImage
{
public:
// def ctor
GIFImage();
unsigned int w; /* width */
unsigned int h; /* height */
unsigned int left; /* x coord (in logical screen) */
unsigned int top; /* y coord (in logical screen) */
int transparent; /* transparent color (-1 = none) */
int disposal; /* disposal method (-1 = unspecified) */
long delay; /* delay in ms (-1 = unused) */
unsigned char *p; /* bitmap */
unsigned char *pal; /* palette */
GIFImage *next; /* next image */
GIFImage *prev; /* prev image */
DECLARE_NO_COPY_CLASS(GIFImage)
};
class WXDLLEXPORT wxGIFDecoder
{
private:
// logical screen
unsigned int m_screenw; /* logical screen width */
unsigned int m_screenh; /* logical screen height */
int m_background; /* background color (-1 = none) */
// image data
bool m_anim; /* animated GIF */
int m_nimages; /* number of images */
int m_image; /* current image */
GIFImage *m_pimage; /* pointer to current image */
GIFImage *m_pfirst; /* pointer to first image */
GIFImage *m_plast; /* pointer to last image */
// decoder state vars
int m_restbits; /* remaining valid bits */
unsigned int m_restbyte; /* remaining bytes in this block */
unsigned int m_lastbyte; /* last byte read */
unsigned char m_buffer[MAX_BLOCK_SIZE]; /* buffer for reading */
unsigned char *m_bufp; /* pointer to next byte in buffer */
// input stream
wxInputStream *m_f; /* input stream */
private:
int getcode(int bits, int abfin);
int dgif(GIFImage *img, int interl, int bits);
public:
// get data of current frame
int GetFrameIndex() const;
unsigned char* GetData() const;
unsigned char* GetPalette() const;
unsigned int GetWidth() const;
unsigned int GetHeight() const;
unsigned int GetLeft() const;
unsigned int GetTop() const;
int GetDisposalMethod() const;
int GetTransparentColour() const;
long GetDelay() const;
// get global data
unsigned int GetLogicalScreenWidth() const;
unsigned int GetLogicalScreenHeight() const;
int GetBackgroundColour() const;
int GetNumberOfFrames() const;
bool IsAnimation() const;
// move through the animation
bool GoFirstFrame();
bool GoLastFrame();
bool GoNextFrame(bool cyclic = false);
bool GoPrevFrame(bool cyclic = false);
bool GoFrame(int which);
public:
// constructor, destructor, etc.
wxGIFDecoder(wxInputStream *s, bool anim = false);
~wxGIFDecoder();
bool CanRead();
int ReadGIF();
void Destroy();
// convert current frame to wxImage
bool ConvertToImage(wxImage *image) const;
DECLARE_NO_COPY_CLASS(wxGIFDecoder)
};
#endif // wxUSE_STREAM && wxUSE_GIF
#endif // _WX_GIFDECOD_H
|