gifsicle  1.92
About: Gifsicle is a UNIX command-line tool for creating, editing, and getting information about GIF images and animations.
  Fossies Dox: gifsicle-1.92.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gifdiff.c File Reference
#include <config.h>
#include <lcdfgif/gif.h>
#include <lcdf/clp.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
Include dependency graph for gifdiff.c:

Go to the source code of this file.

Macros

#define QUIET_OPT   300
 
#define HELP_OPT   301
 
#define VERSION_OPT   302
 
#define IGNORE_REDUNDANCY_OPT   303
 
#define REDUNDANCY_OPT   304
 
#define IGNORE_BACKGROUND_OPT   305
 
#define BACKGROUND_OPT   306
 
#define TRANSP   (0)
 
#define SAME   0
 
#define DIFFERENT   1
 

Functions

static void combine_colormaps (Gif_Colormap *gfcm, Gif_Colormap *newcm)
 
static void fill_area (uint16_t *data, int l, int t, int w, int h, uint16_t val)
 
static void copy_area (uint16_t *dst, const uint16_t *src, int l, int t, int w, int h)
 
static void expand_bounds (int *lf, int *tp, int *rt, int *bt, const Gif_Image *gfi)
 
static int apply_image (int is_second, Gif_Stream *gfs, int imageno, uint16_t background)
 
static void different (const char *format,...)
 
static void name_loopcount (int loopcount, char *buf)
 
static void name_delay (int delay, char *buf)
 
static void name_color (int color, Gif_Colormap *gfcm, char *buf)
 
int compare (Gif_Stream *s1, Gif_Stream *s2)
 
void short_usage (void)
 
void usage (void)
 
void fatal_error (const char *format,...)
 
void error (const char *format,...)
 
static void gifread_error (Gif_Stream *gfs, Gif_Image *gfi, int is_error, const char *message)
 
static Gif_Streamread_stream (const char **filename)
 
int main (int argc, char *argv[])
 

Variables

const Clp_Option options []
 
const char * program_name
 
static const char * filename1
 
static const char * filename2
 
static unsigned screen_width
 
static unsigned screen_height
 
static uint16_t * gdata [2]
 
static uint16_t * glast [2]
 
static uint16_t * scratch
 
static uint16_t * line
 
static int brief
 
static int ignore_redundancy
 
static int ignore_background
 
static Clp_Parserclp
 
static int was_different
 
static int gifread_error_count
 

Macro Definition Documentation

◆ BACKGROUND_OPT

#define BACKGROUND_OPT   306

Definition at line 27 of file gifdiff.c.

◆ DIFFERENT

#define DIFFERENT   1

Definition at line 188 of file gifdiff.c.

◆ HELP_OPT

#define HELP_OPT   301

Definition at line 22 of file gifdiff.c.

◆ IGNORE_BACKGROUND_OPT

#define IGNORE_BACKGROUND_OPT   305

Definition at line 26 of file gifdiff.c.

◆ IGNORE_REDUNDANCY_OPT

#define IGNORE_REDUNDANCY_OPT   303

Definition at line 24 of file gifdiff.c.

◆ QUIET_OPT

#define QUIET_OPT   300

Definition at line 21 of file gifdiff.c.

◆ REDUNDANCY_OPT

#define REDUNDANCY_OPT   304

Definition at line 25 of file gifdiff.c.

◆ SAME

#define SAME   0

Definition at line 187 of file gifdiff.c.

◆ TRANSP

#define TRANSP   (0)

Definition at line 47 of file gifdiff.c.

◆ VERSION_OPT

#define VERSION_OPT   302

Definition at line 23 of file gifdiff.c.

Function Documentation

◆ apply_image()

◆ combine_colormaps()

static void combine_colormaps ( Gif_Colormap gfcm,
Gif_Colormap newcm 
)
static

Definition at line 62 of file gifdiff.c.

References Gif_Colormap::col, Gif_AddColor(), Gif_Colormap::ncol, and Gif_Color::pixel.

Referenced by compare().

◆ compare()

◆ copy_area()

static void copy_area ( uint16_t *  dst,
const uint16_t *  src,
int  l,
int  t,
int  w,
int  h 
)
static

Definition at line 84 of file gifdiff.c.

References screen_width.

Referenced by apply_image().

◆ different()

static void different ( const char *  format,
  ... 
)
static

Definition at line 192 of file gifdiff.c.

References brief, and was_different.

Referenced by compare().

◆ error()

void error ( const char *  format,
  ... 
)

◆ expand_bounds()

static void expand_bounds ( int *  lf,
int *  tp,
int *  rt,
int *  bt,
const Gif_Image gfi 
)
static

Definition at line 93 of file gifdiff.c.

References Gif_Image::height, Gif_Image::left, Gif_Image::top, and Gif_Image::width.

Referenced by apply_image().

◆ fatal_error()

void fatal_error ( const char *  format,
  ... 
)

◆ fill_area()

static void fill_area ( uint16_t *  data,
int  l,
int  t,
int  w,
int  h,
uint16_t  val 
)
static

Definition at line 72 of file gifdiff.c.

References screen_width.

Referenced by apply_image(), and compare().

◆ gifread_error()

static void gifread_error ( Gif_Stream gfs,
Gif_Image gfi,
int  is_error,
const char *  message 
)
static

Definition at line 452 of file gifdiff.c.

References error(), Gif_ImageNumber(), gifread_error_count, Gif_Stream::landmark, and Gif_Stream::nimages.

Referenced by read_stream().

◆ main()

◆ name_color()

static void name_color ( int  color,
Gif_Colormap gfcm,
char *  buf 
)
static

Definition at line 226 of file gifdiff.c.

References Gif_Colormap::col, Gif_Color::gfc_blue, Gif_Color::gfc_green, Gif_Color::gfc_red, and TRANSP.

Referenced by compare().

◆ name_delay()

static void name_delay ( int  delay,
char *  buf 
)
static

Definition at line 217 of file gifdiff.c.

Referenced by compare().

◆ name_loopcount()

static void name_loopcount ( int  loopcount,
char *  buf 
)
static

Definition at line 206 of file gifdiff.c.

Referenced by compare().

◆ read_stream()

static Gif_Stream* read_stream ( const char **  filename)
static

◆ short_usage()

void short_usage ( void  )

Definition at line 402 of file gifdiff.c.

Referenced by main().

◆ usage()

void usage ( void  )

Definition at line 408 of file gifdiff.c.

Referenced by main().

Variable Documentation

◆ brief

int brief
static

Definition at line 54 of file gifdiff.c.

Referenced by different(), and main().

◆ clp

◆ filename1

const char* filename1
static

Definition at line 43 of file gifdiff.c.

Referenced by main().

◆ filename2

const char* filename2
static

Definition at line 44 of file gifdiff.c.

Referenced by main().

◆ gdata

uint16_t* gdata[2]
static

Definition at line 49 of file gifdiff.c.

Referenced by apply_image(), and compare().

◆ gifread_error_count

int gifread_error_count
static

Definition at line 449 of file gifdiff.c.

Referenced by gifread_error(), and read_stream().

◆ glast

uint16_t* glast[2]
static

Definition at line 50 of file gifdiff.c.

Referenced by apply_image(), and compare().

◆ ignore_background

int ignore_background
static

Definition at line 56 of file gifdiff.c.

Referenced by compare(), and main().

◆ ignore_redundancy

int ignore_redundancy
static

Definition at line 55 of file gifdiff.c.

Referenced by compare(), and main().

◆ line

uint16_t* line
static

◆ options

const Clp_Option options[]
Initial value:
= {
{ "help", 'h', 301 , 0, 0 },
{ "brief", 'q', 300 , 0, Clp_Negate },
{ "redudancy", 0, 304 , 0, Clp_Negate },
{ "ignore-redundancy", 'w', 303 , 0, Clp_Negate },
{ "bg", 0, 306 , 0, Clp_Negate },
{ "ignore-bg", 0, 305 , 0, Clp_Negate },
{ "background", 0, 306 , 0, Clp_Negate },
{ "ignore-background", 'B', 305 , 0, Clp_Negate },
{ "version", 'v', 302 , 0, 0 }
}

Definition at line 29 of file gifdiff.c.

Referenced by main().

◆ program_name

const char* program_name

Definition at line 41 of file gifdiff.c.

Referenced by error(), fatal_error(), main(), short_usage(), and usage().

◆ scratch

uint16_t* scratch
static

Definition at line 51 of file gifdiff.c.

Referenced by apply_image(), and compare().

◆ screen_height

◆ screen_width

◆ was_different

int was_different
static

Definition at line 189 of file gifdiff.c.

Referenced by compare(), and different().

Clp_Negate
#define Clp_Negate
Option flag: option may be negated.
Definition: clp.h:139