File: gif2png.h

package info (click to toggle)
gif2png 2.5.8-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 880 kB
  • ctags: 428
  • sloc: ansic: 2,958; sh: 1,929; xml: 836; python: 248; makefile: 85
file content (79 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download
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
/* See the file COPYING for conditions of use */

/* get png type definitions */
#include "png.h"

#include <stdbool.h>

#define GIFterminator ';'
#define GIFextension '!'
#define GIFimage ','

#define GIFcomment 0xfe
#define GIFapplication 0xff
#define GIFplaintext 0x01
#define GIFgraphicctl 0xf9

#define MAXCMSIZE 256

typedef unsigned char byte;

typedef png_color GifColor;

struct GIFimagestruct {
  GifColor colors[MAXCMSIZE];
  unsigned long color_count[MAXCMSIZE];
  int offset_x;
  int offset_y;
  png_uint_32 width;
  png_uint_32 height;
  int trans;
  bool interlace;
};

struct GIFelement {
  struct GIFelement *next;
  char GIFtype;
  byte *data;
  size_t allocated_size;
  size_t size;
  /* only used if GIFtype==GIFimage */
  struct GIFimagestruct *imagestruct;
};

extern struct gif_scr{
  unsigned int  Width;
  unsigned int  Height;
  GifColor      ColorMap[MAXCMSIZE];
  bool          ColorMap_present;
  unsigned int  BitPixel;
  unsigned int  ColorResolution;
  int           Background;
  unsigned int  AspectRatio;
} GifScreen;

int ReadGIF(FILE *);
int MatteGIF(GifColor);

void allocate_element(void);
void store_block(char *, size_t);
void allocate_image(void);
void set_size(size_t);

void *xalloc(size_t);
void *xrealloc(void *, size_t);
void fix_current(void);
void free_mem(void);

int interlace_line(int height, int line);
int inv_interlace_line(int height, int line);

extern struct GIFelement first;
extern struct GIFelement *current;
extern bool recover;

extern const char version[];
extern const char compile_info[];

extern int skip_pte;