GrafX2 2.9.3227
The ultimate 256-color painting program
giformat.c File Reference

Saving and loading GIF. More...

#include <stdlib.h>
#include <string.h>
#include "struct.h"
#include "global.h"
#include "oldies.h"
#include "io.h"
#include "loadsave.h"
#include "loadsavefuncs.h"
#include "gfx2mem.h"
#include "gfx2log.h"
+ Include dependency graph for giformat.c:

Data Structures

struct  T_GIF_LSDB
 Logical Screen Descriptor Block. More...
 
struct  T_GIF_IDB
 Image Descriptor Block. More...
 
struct  T_GIF_GCE
 Graphic Control Extension. More...
 
struct  T_GIF_context
 
struct  gif_alphabet
 

Macros

#define MIN(a, b)   ((a)<(b)?(a):(b))
 
#define MAX(a, b)   ((a)>(b)?(a):(b))
 
#define GIF_INVALID_CODE   (65535)
 

Enumerations

enum  DISPOSAL_METHOD { DISPOSAL_METHOD_UNDEFINED = 0 , DISPOSAL_METHOD_DO_NOT_DISPOSE = 1 , DISPOSAL_METHOD_RESTORE_BGCOLOR = 2 , DISPOSAL_METHOD_RESTORE_PREVIOUS = 3 }
 

Functions

void Test_GIF (T_IO_Context *context, FILE *file)
 Test if a file is GIF format. More...
 
static word GIF_get_next_code (FILE *GIF_file, T_GIF_context *gif)
 Reads the next code (GIF.nb_bits bits) More...
 
static void GIF_new_pixel (T_IO_Context *context, T_GIF_context *gif, T_GIF_IDB *idb, int is_transparent, byte color)
 Put a new pixel. More...
 
void Load_GIF (T_IO_Context *context)
 Load GIF file. More...
 
static void GIF_empty_buffer (FILE *file, T_GIF_context *gif, byte *GIF_buffer)
 Flush the buffer. More...
 
static void GIF_set_code (FILE *GIF_file, T_GIF_context *gif, byte *GIF_buffer, word Code)
 Write a code (GIF_nb_bits bits) More...
 
static byte GIF_next_pixel (T_IO_Context *context, T_GIF_context *gif, T_GIF_IDB *idb)
 Read the next pixel. More...
 
void Save_GIF (T_IO_Context *context)
 Save a GIF file. More...
 

Detailed Description

Saving and loading GIF.

Macro Definition Documentation

◆ MIN

#define MIN (   a,
 
)    ((a)<(b)?(a):(b))

◆ MAX

#define MAX (   a,
 
)    ((a)>(b)?(a):(b))

◆ GIF_INVALID_CODE

#define GIF_INVALID_CODE   (65535)