File: gif_lib_private.h

package info (click to toggle)
pytorch-vision 0.21.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,228 kB
  • sloc: python: 65,904; cpp: 11,406; ansic: 2,459; java: 550; sh: 265; xml: 79; objc: 56; makefile: 33
file content (72 lines) | stat: -rw-r--r-- 2,639 bytes parent folder | download | duplicates (2)
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
/****************************************************************************

gif_lib_private.h - internal giflib routines and structures

SPDX-License-Identifier: MIT

****************************************************************************/

#ifndef _GIF_LIB_PRIVATE_H
#define _GIF_LIB_PRIVATE_H

#include "gif_hash.h"
#include "gif_lib.h"

#ifndef SIZE_MAX
#define SIZE_MAX UINTPTR_MAX
#endif

#define EXTENSION_INTRODUCER 0x21
#define DESCRIPTOR_INTRODUCER 0x2c
#define TERMINATOR_INTRODUCER 0x3b

#define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
#define LZ_BITS 12

#define FLUSH_OUTPUT 4096 /* Impossible code, to signal flush. */
#define FIRST_CODE 4097   /* Impossible code, to signal first. */
#define NO_SUCH_CODE 4098 /* Impossible code, to signal empty. */

#define FILE_STATE_WRITE 0x01
#define FILE_STATE_SCREEN 0x02
#define FILE_STATE_IMAGE 0x04
#define FILE_STATE_READ 0x08

#define IS_READABLE(Private) (Private->FileState & FILE_STATE_READ)
#define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE)

typedef struct GifFilePrivateType {
	GifWord FileState, FileHandle, /* Where all this data goes to! */
	    BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */
	    ClearCode,    /* The CLEAR LZ code. */
	    EOFCode,      /* The EOF LZ code. */
	    RunningCode,  /* The next code algorithm can generate. */
	    RunningBits,  /* The number of bits required to represent
	                     RunningCode. */
	    MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits.
	               */
	    LastCode, /* The code before the current code. */
	    CrntCode, /* Current algorithm code. */
	    StackPtr, /* For character stack (see below). */
	    CrntShiftState;           /* Number of bits in CrntShiftDWord. */
	unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */
	unsigned long PixelCount;     /* Number of pixels in image. */
	FILE *File;                   /* File as stream. */
	InputFunc Read;               /* function to read gif input (TVT) */
	OutputFunc Write;             /* function to write gif output (MRB) */
	GifByteType Buf[256];         /* Compressed input is buffered here. */
	GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */
	GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */
	GifPrefixType Prefix[LZ_MAX_CODE + 1];
	GifHashTableType *HashTable;
	bool gif89;
} GifFilePrivateType;

#ifndef HAVE_REALLOCARRAY
extern void *openbsd_reallocarray(void *optr, size_t nmemb, size_t size);
#define reallocarray openbsd_reallocarray
#endif

#endif /* _GIF_LIB_PRIVATE_H */

/* end */