🌌 SpectraShell
Current path:
usr
/
include
/
👤 Create WP Admin
⬆️
Go up: /usr
✏️ Editing: gif_lib.h
/****************************************************************************** gif_lib.h - service library for decoding and encoding GIF images SPDX-License-Identifier: MIT *****************************************************************************/ #ifndef _GIF_LIB_H_ #define _GIF_LIB_H_ 1 #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GIFLIB_MAJOR 5 #define GIFLIB_MINOR 2 #define GIFLIB_RELEASE 1 #define GIF_ERROR 0 #define GIF_OK 1 #include <stddef.h> #include <stdbool.h> #define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */ #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1 #define GIF_VERSION_POS 3 /* Version first character in stamp. */ #define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */ #define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */ typedef unsigned char GifPixelType; typedef unsigned char *GifRowType; typedef unsigned char GifByteType; typedef unsigned int GifPrefixType; typedef int GifWord; typedef struct GifColorType { GifByteType Red, Green, Blue; } GifColorType; typedef struct ColorMapObject { int ColorCount; int BitsPerPixel; bool SortFlag; GifColorType *Colors; /* on malloc(3) heap */ } ColorMapObject; typedef struct GifImageDesc { GifWord Left, Top, Width, Height; /* Current image dimensions. */ bool Interlace; /* Sequential/Interlaced lines. */ ColorMapObject *ColorMap; /* The local color map */ } GifImageDesc; typedef struct ExtensionBlock { int ByteCount; GifByteType *Bytes; /* on malloc(3) heap */ int Function; /* The block function code */ #define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */ #define COMMENT_EXT_FUNC_CODE 0xfe /* comment */ #define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */ #define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */ #define APPLICATION_EXT_FUNC_CODE 0xff /* application block (GIF89) */ } ExtensionBlock; typedef struct SavedImage { GifImageDesc ImageDesc; GifByteType *RasterBits; /* on malloc(3) heap */ int ExtensionBlockCount; /* Count of extensions before image */ ExtensionBlock *ExtensionBlocks; /* Extensions before image */ } SavedImage; typedef struct GifFileType { GifWord SWidth, SHeight; /* Size of virtual canvas */ GifWord SColorResolution; /* How many colors can we generate? */ GifWord SBackGroundColor; /* Background color for virtual canvas */ GifByteType AspectByte; /* Used to compute pixel aspect ratio */ ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */ int ImageCount; /* Number of current image (both APIs) */ GifImageDesc Image; /* Current image (low-level API) */ SavedImage *SavedImages; /* Image sequence (high-level API) */ int ExtensionBlockCount; /* Count extensions past last image */ ExtensionBlock *ExtensionBlocks; /* Extensions past last image */ int Error; /* Last error condition reported */ void *UserData; /* hook to attach user data (TVT) */ void *Private; /* Don't mess with this! */ } GifFileType; #define GIF_ASPECT_RATIO(n) ((n)+15.0/64.0) typedef enum { UNDEFINED_RECORD_TYPE, SCREEN_DESC_RECORD_TYPE, IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */ EXTENSION_RECORD_TYPE, /* Begin with '!' */ TERMINATE_RECORD_TYPE /* Begin with ';' */ } GifRecordType; /* func type to read gif data from arbitrary sources (TVT) */ typedef int (*InputFunc) (GifFileType *, GifByteType *, int); /* func type to write gif data to arbitrary targets. * Returns count of bytes written. (MRB) */ typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int); /****************************************************************************** GIF89 structures ******************************************************************************/ typedef struct GraphicsControlBlock { int DisposalMode; #define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */ #define DISPOSE_DO_NOT 1 /* Leave image in place */ #define DISPOSE_BACKGROUND 2 /* Set area too background color */ #define DISPOSE_PREVIOUS 3 /* Restore to previous content */ bool UserInputFlag; /* User confirmation required before disposal */ int DelayTime; /* pre-display delay in 0.01sec units */ int TransparentColor; /* Palette index for transparency, -1 if none */ #define NO_TRANSPARENT_COLOR -1 } GraphicsControlBlock; /****************************************************************************** GIF encoding routines ******************************************************************************/ /* Main entry points */ GifFileType *EGifOpenFileName(const char *GifFileName, const bool GifTestExistence, int *Error); GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); int EGifSpew(GifFileType * GifFile); const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); #define E_GIF_SUCCEEDED 0 #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ #define E_GIF_ERR_WRITE_FAILED 2 #define E_GIF_ERR_HAS_SCRN_DSCR 3 #define E_GIF_ERR_HAS_IMAG_DSCR 4 #define E_GIF_ERR_NO_COLOR_MAP 5 #define E_GIF_ERR_DATA_TOO_BIG 6 #define E_GIF_ERR_NOT_ENOUGH_MEM 7 #define E_GIF_ERR_DISK_IS_FULL 8 #define E_GIF_ERR_CLOSE_FAILED 9 #define E_GIF_ERR_NOT_WRITEABLE 10 /* These are legacy. You probably do not want to call them directly */ int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth, const int GifHeight, const int GifColorRes, const int GifBackGround, const ColorMapObject *GifColorMap); int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop, const int GifWidth, const int GifHeight, const bool GifInterlace, const ColorMapObject *GifColorMap); void EGifSetGifVersion(GifFileType *GifFile, const bool gif89); int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel); int EGifPutComment(GifFileType *GifFile, const char *GifComment); int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode); int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen, const void *GifExtension); int EGifPutExtensionTrailer(GifFileType *GifFile); int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, const int GifExtLen, const void *GifExtension); int EGifPutCode(GifFileType *GifFile, int GifCodeSize, const GifByteType *GifCodeBlock); int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock); /****************************************************************************** GIF decoding routines ******************************************************************************/ /* Main entry points */ GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); int DGifSlurp(GifFileType * GifFile); GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); #define D_GIF_SUCCEEDED 0 #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ #define D_GIF_ERR_READ_FAILED 102 #define D_GIF_ERR_NOT_GIF_FILE 103 #define D_GIF_ERR_NO_SCRN_DSCR 104 #define D_GIF_ERR_NO_IMAG_DSCR 105 #define D_GIF_ERR_NO_COLOR_MAP 106 #define D_GIF_ERR_WRONG_RECORD 107 #define D_GIF_ERR_DATA_TOO_BIG 108 #define D_GIF_ERR_NOT_ENOUGH_MEM 109 #define D_GIF_ERR_CLOSE_FAILED 110 #define D_GIF_ERR_NOT_READABLE 111 #define D_GIF_ERR_IMAGE_DEFECT 112 #define D_GIF_ERR_EOF_TOO_SOON 113 /* These are legacy. You probably do not want to call them directly */ int DGifGetScreenDesc(GifFileType *GifFile); int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType); int DGifGetImageHeader(GifFileType *GifFile); int DGifGetImageDesc(GifFileType *GifFile); int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen); int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel); int DGifGetExtension(GifFileType *GifFile, int *GifExtCode, GifByteType **GifExtension); int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension); int DGifGetCode(GifFileType *GifFile, int *GifCodeSize, GifByteType **GifCodeBlock); int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock); int DGifGetLZCodes(GifFileType *GifFile, int *GifCode); const char *DGifGetGifVersion(GifFileType *GifFile); /****************************************************************************** Error handling and reporting. ******************************************************************************/ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ /***************************************************************************** Everything below this point is new after version 1.2, supporting `slurp mode' for doing I/O in two big belts with all the image-bashing in core. ******************************************************************************/ /****************************************************************************** Color map handling from gif_alloc.c ******************************************************************************/ extern ColorMapObject *GifMakeMapObject(int ColorCount, const GifColorType *ColorMap); extern void GifFreeMapObject(ColorMapObject *Object); extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, const ColorMapObject *ColorIn2, GifPixelType ColorTransIn2[]); extern int GifBitSize(int n); /****************************************************************************** Support for the in-core structures allocation (slurp mode). ******************************************************************************/ extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]); extern int GifAddExtensionBlock(int *ExtensionBlock_Count, ExtensionBlock **ExtensionBlocks, int Function, unsigned int Len, unsigned char ExtData[]); extern void GifFreeExtensions(int *ExtensionBlock_Count, ExtensionBlock **ExtensionBlocks); extern SavedImage *GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom); extern void GifFreeSavedImages(GifFileType *GifFile); /****************************************************************************** 5.x functions for GIF89 graphics control blocks ******************************************************************************/ int DGifExtensionToGCB(const size_t GifExtensionLength, const GifByteType *GifExtension, GraphicsControlBlock *GCB); size_t EGifGCBToExtension(const GraphicsControlBlock *GCB, GifByteType *GifExtension); int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex, GraphicsControlBlock *GCB); int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, GifFileType *GifFile, int ImageIndex); /****************************************************************************** The library's internal utility font ******************************************************************************/ #define GIF_FONT_WIDTH 8 #define GIF_FONT_HEIGHT 8 extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; extern void GifDrawText8x8(SavedImage *Image, const int x, const int y, const char *legend, const int color); extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w, const int d, const int color); extern void GifDrawRectangle(SavedImage *Image, const int x, const int y, const int w, const int d, const int color); extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y, const char *legend, const int border, const int bg, const int fg); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _GIF_LIB_H */ /* end */
Save
Upload
📁
Create Folder
📁
arpa
📁
asm
📁
asm-generic
📁
bind9
📁
bits
📁
blkid
📁
brotli
📁
c++
📁
coredumper
📁
drm
📁
e2p
📁
et
📁
event2
📁
ext2fs
📁
finclude
📁
fontconfig
📁
freetype2
📁
fstrm
📁
fwctl
📁
gdbm
📁
gio-unix-2.0
📁
GL
📁
glib-2.0
📁
gnu
📁
google
📁
graphite2
📁
gssapi
📁
gssrpc
📁
harfbuzz
📁
json-c
📁
kadm5
📁
krb5
📁
libexslt
📁
libltdl
📁
libmount
📁
libpng16
📁
libxml2
📁
libxslt
📁
linux
📁
lzma
📁
misc
📁
mtd
📁
ncurses
📁
ncursesw
📁
net
📁
netash
📁
netatalk
📁
netax25
📁
neteconet
📁
netinet
📁
netipx
📁
netiucv
📁
netpacket
📁
netrom
📁
netrose
📁
nfs
📁
openssl
📁
pcp
📁
protobuf-c
📁
protocols
📁
python3.9
📁
rdma
📁
rpc
📁
scsi
📁
security
📁
selinux
📁
sepol
📁
sound
📁
sys
📁
sysprof-4
📁
unicode
📁
video
📁
webp
📁
X11
📁
xcb
📁
xen
📄
a.out.h
|
✏️ Edit
📄
aio.h
|
✏️ Edit
📄
aliases.h
|
✏️ Edit
📄
alloca.h
|
✏️ Edit
📄
ar.h
|
✏️ Edit
📄
argp.h
|
✏️ Edit
📄
argz.h
|
✏️ Edit
📄
assert.h
|
✏️ Edit
📄
autosprintf.h
|
✏️ Edit
📄
byteswap.h
|
✏️ Edit
📄
bzlib.h
|
✏️ Edit
📄
complex.h
|
✏️ Edit
📄
com_err.h
|
✏️ Edit
📄
cpio.h
|
✏️ Edit
📄
cpuidle.h
|
✏️ Edit
📄
crypt.h
|
✏️ Edit
📄
ctype.h
|
✏️ Edit
📄
curses.h
|
✏️ Edit
📄
cursesapp.h
|
✏️ Edit
📄
cursesf.h
|
✏️ Edit
📄
cursesm.h
|
✏️ Edit
📄
cursesp.h
|
✏️ Edit
📄
cursesw.h
|
✏️ Edit
📄
cursslk.h
|
✏️ Edit
📄
dbm.h
|
✏️ Edit
📄
dirent.h
|
✏️ Edit
📄
dlfcn.h
|
✏️ Edit
📄
elf.h
|
✏️ Edit
📄
endian.h
|
✏️ Edit
📄
entities.h
|
✏️ Edit
📄
envz.h
|
✏️ Edit
📄
err.h
|
✏️ Edit
📄
errno.h
|
✏️ Edit
📄
error.h
|
✏️ Edit
📄
eti.h
|
✏️ Edit
📄
etip.h
|
✏️ Edit
📄
evdns.h
|
✏️ Edit
📄
event.h
|
✏️ Edit
📄
evhttp.h
|
✏️ Edit
📄
evrpc.h
|
✏️ Edit
📄
evutil.h
|
✏️ Edit
📄
execinfo.h
|
✏️ Edit
📄
expat.h
|
✏️ Edit
📄
expat_config.h
|
✏️ Edit
📄
expat_external.h
|
✏️ Edit
📄
fcntl.h
|
✏️ Edit
📄
features-time64.h
|
✏️ Edit
📄
features.h
|
✏️ Edit
📄
fenv.h
|
✏️ Edit
📄
ffi-x86_64.h
|
✏️ Edit
📄
ffi.h
|
✏️ Edit
📄
ffitarget-x86_64.h
|
✏️ Edit
📄
ffitarget.h
|
✏️ Edit
📄
FlexLexer.h
|
✏️ Edit
📄
fmtmsg.h
|
✏️ Edit
📄
fnmatch.h
|
✏️ Edit
📄
form.h
|
✏️ Edit
📄
fpu_control.h
|
✏️ Edit
📄
fstab.h
|
✏️ Edit
📄
fstrm.h
|
✏️ Edit
📄
fts.h
|
✏️ Edit
📄
ftw.h
|
✏️ Edit
📄
gconv.h
|
✏️ Edit
📄
gd.h
|
✏️ Edit
📄
gdbm.h
|
✏️ Edit
📄
gdcache.h
|
✏️ Edit
📄
gdfontg.h
|
✏️ Edit
📄
gdfontl.h
|
✏️ Edit
📄
gdfontmb.h
|
✏️ Edit
📄
gdfonts.h
|
✏️ Edit
📄
gdfontt.h
|
✏️ Edit
📄
gdfx.h
|
✏️ Edit
📄
gdpp.h
|
✏️ Edit
📄
gd_color_map.h
|
✏️ Edit
📄
gd_errors.h
|
✏️ Edit
📄
gd_io.h
|
✏️ Edit
📄
gelf.h
|
✏️ Edit
📄
getopt.h
|
✏️ Edit
📄
gettext-po.h
|
✏️ Edit
📄
gif_lib.h
|
✏️ Edit
📄
glob.h
|
✏️ Edit
📄
gnu-versions.h
|
✏️ Edit
📄
gnumake.h
|
✏️ Edit
📄
gpg-error.h
|
✏️ Edit
📄
gpgrt.h
|
✏️ Edit
📄
grp.h
|
✏️ Edit
📄
gshadow.h
|
✏️ Edit
📄
gssapi.h
|
✏️ Edit
📄
iconv.h
|
✏️ Edit
📄
idn-free.h
|
✏️ Edit
📄
idn-int.h
|
✏️ Edit
📄
idna.h
|
✏️ Edit
📄
ieee754.h
|
✏️ Edit
📄
ifaddrs.h
|
✏️ Edit
📄
inttypes.h
|
✏️ Edit
📄
jconfig-64.h
|
✏️ Edit
📄
jconfig.h
|
✏️ Edit
📄
jerror.h
|
✏️ Edit
📄
jmorecfg.h
|
✏️ Edit
📄
jpegint.h
|
✏️ Edit
📄
jpeglib.h
|
✏️ Edit
📄
kdb.h
|
✏️ Edit
📄
keyutils.h
|
✏️ Edit
📄
krad.h
|
✏️ Edit
📄
krb5.h
|
✏️ Edit
📄
langinfo.h
|
✏️ Edit
📄
lastlog.h
|
✏️ Edit
📄
libaio.h
|
✏️ Edit
📄
libelf.h
|
✏️ Edit
📄
libgen.h
|
✏️ Edit
📄
libintl.h
|
✏️ Edit
📄
libtasn1.h
|
✏️ Edit
📄
limits.h
|
✏️ Edit
📄
link.h
|
✏️ Edit
📄
lmdb.h
|
✏️ Edit
📄
locale.h
|
✏️ Edit
📄
ltdl.h
|
✏️ Edit
📄
lzma.h
|
✏️ Edit
📄
malloc.h
|
✏️ Edit
📄
math.h
|
✏️ Edit
📄
maxminddb.h
|
✏️ Edit
📄
maxminddb_config-64.h
|
✏️ Edit
📄
maxminddb_config.h
|
✏️ Edit
📄
mcheck.h
|
✏️ Edit
📄
memory.h
|
✏️ Edit
📄
menu.h
|
✏️ Edit
📄
mntent.h
|
✏️ Edit
📄
monetary.h
|
✏️ Edit
📄
mqueue.h
|
✏️ Edit
📄
ncurses.h
|
✏️ Edit
📄
ncurses_dll.h
|
✏️ Edit
📄
nc_tparm.h
|
✏️ Edit
📄
ndbm.h
|
✏️ Edit
📄
netdb.h
|
✏️ Edit
📄
nlist.h
|
✏️ Edit
📄
nl_types.h
|
✏️ Edit
📄
nss.h
|
✏️ Edit
📄
obstack.h
|
✏️ Edit
📄
panel.h
|
✏️ Edit
📄
paths.h
|
✏️ Edit
📄
pcre.h
|
✏️ Edit
📄
pcre2.h
|
✏️ Edit
📄
pcre2posix.h
|
✏️ Edit
📄
pcrecpp.h
|
✏️ Edit
📄
pcrecpparg.h
|
✏️ Edit
📄
pcreposix.h
|
✏️ Edit
📄
pcre_scanner.h
|
✏️ Edit
📄
pcre_stringpiece.h
|
✏️ Edit
📄
png.h
|
✏️ Edit
📄
pngconf.h
|
✏️ Edit
📄
pnglibconf.h
|
✏️ Edit
📄
poll.h
|
✏️ Edit
📄
powercap.h
|
✏️ Edit
📄
pr29.h
|
✏️ Edit
📄
printf.h
|
✏️ Edit
📄
proc_service.h
|
✏️ Edit
📄
profile.h
|
✏️ Edit
📄
pthread.h
|
✏️ Edit
📄
pty.h
|
✏️ Edit
📄
punycode.h
|
✏️ Edit
📄
pwd.h
|
✏️ Edit
📄
regex.h
|
✏️ Edit
📄
regexp.h
|
✏️ Edit
📄
resolv.h
|
✏️ Edit
📄
re_comp.h
|
✏️ Edit
📄
sched.h
|
✏️ Edit
📄
search.h
|
✏️ Edit
📄
semaphore.h
|
✏️ Edit
📄
setjmp.h
|
✏️ Edit
📄
sgtty.h
|
✏️ Edit
📄
shadow.h
|
✏️ Edit
📄
signal.h
|
✏️ Edit
📄
spawn.h
|
✏️ Edit
📄
stab.h
|
✏️ Edit
📄
stdc-predef.h
|
✏️ Edit
📄
stdint.h
|
✏️ Edit
📄
stdio.h
|
✏️ Edit
📄
stdio_ext.h
|
✏️ Edit
📄
stdlib.h
|
✏️ Edit
📄
string.h
|
✏️ Edit
📄
stringprep.h
|
✏️ Edit
📄
strings.h
|
✏️ Edit
📄
syscall.h
|
✏️ Edit
📄
sysexits.h
|
✏️ Edit
📄
syslog.h
|
✏️ Edit
📄
tar.h
|
✏️ Edit
📄
term.h
|
✏️ Edit
📄
termcap.h
|
✏️ Edit
📄
termio.h
|
✏️ Edit
📄
termios.h
|
✏️ Edit
📄
term_entry.h
|
✏️ Edit
📄
tgmath.h
|
✏️ Edit
📄
threads.h
|
✏️ Edit
📄
thread_db.h
|
✏️ Edit
📄
tic.h
|
✏️ Edit
📄
tiff.h
|
✏️ Edit
📄
tiffconf-64.h
|
✏️ Edit
📄
tiffconf.h
|
✏️ Edit
📄
tiffio.h
|
✏️ Edit
📄
tiffio.hxx
|
✏️ Edit
📄
tiffvers.h
|
✏️ Edit
📄
time.h
|
✏️ Edit
📄
tld.h
|
✏️ Edit
📄
ttyent.h
|
✏️ Edit
📄
uchar.h
|
✏️ Edit
📄
ucontext.h
|
✏️ Edit
📄
ulimit.h
|
✏️ Edit
📄
unctrl.h
|
✏️ Edit
📄
unistd.h
|
✏️ Edit
📄
utime.h
|
✏️ Edit
📄
utmp.h
|
✏️ Edit
📄
utmpx.h
|
✏️ Edit
📄
values.h
|
✏️ Edit
📄
verto-module.h
|
✏️ Edit
📄
verto.h
|
✏️ Edit
📄
wait.h
|
✏️ Edit
📄
wchar.h
|
✏️ Edit
📄
wctype.h
|
✏️ Edit
📄
wordexp.h
|
✏️ Edit
📄
zconf.h
|
✏️ Edit
📄
zdict.h
|
✏️ Edit
📄
zlib.h
|
✏️ Edit
📄
zstd.h
|
✏️ Edit
📄
zstd_errors.h
|
✏️ Edit