Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

deanimate.c File Reference

Declares functions to deanimate GIF images on the fly. More...


Functions

void buf_free (struct binbuffer *buf)
int buf_extend (struct binbuffer *buf, size_t length)
int buf_copy (struct binbuffer *src, struct binbuffer *dst, size_t length)
unsigned char buf_getbyte (struct binbuffer *src, size_t offset)
int gif_skip_data_block (struct binbuffer *buf)
int gif_extract_image (struct binbuffer *src, struct binbuffer *dst)
int gif_deanimate (struct binbuffer *src, struct binbuffer *dst, int get_first_image)

Variables

const char deanimate_rcs [] = "$Id: deanimate.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
const char deanimate_h_rcs [] = DEANIMATE_H_VERSION


Detailed Description

Declares functions to deanimate GIF images on the fly.

Functions declared include: gif_deanimate, buf_free, buf_copy, buf_getbyte, gif_skip_data_block, and gif_extract_image

Log:
deanimate.c,v
Revision 2.0 2002/06/04 14:34:21 jongfoster Moving source files to src/

Revision 1.12 2002/05/12 21:36:29 jongfoster Correcting function comments

Revision 1.11 2002/03/26 22:29:54 swa we have a new homepage!

Revision 1.10 2002/03/24 13:25:43 swa name change related issues

Revision 1.9 2002/03/13 00:27:04 jongfoster Killing warnings

Revision 1.8 2002/03/09 19:42:47 jongfoster Fixing more warnings

Revision 1.7 2002/03/08 17:46:04 jongfoster Fixing int/size_t warnings

Revision 1.6 2002/03/07 03:46:17 oes Fixed compiler warnings

Revision 1.5 2001/09/10 10:16:06 oes Silenced compiler warnings

Revision 1.4 2001/07/18 12:28:49 oes

Revision 1.3 2001/07/15 13:57:50 jongfoster Adding includes string.h and miscutil.h

Revision 1.2 2001/07/13 13:46:20 oes Introduced GIF deanimation feature


Function Documentation

int buf_copy struct binbuffer *    src,
struct binbuffer *    dst,
size_t    length
 

Safely copies a given amount of bytes from one struct binbuffer to another, advancing the offsets appropriately.

Parameters:
src  Pointer to the source binbuffer
dst  Pointer to the destination binbuffer
length  Number of bytes to be copied
Returns:
0 on success, 1 on failiure.

int buf_extend struct binbuffer *    buf,
size_t    length
 

Ensure that a given binbuffer can hold a given amount of bytes, by reallocating its buffer if necessary.

Allocate new mem in chunks of 1024 bytes, so we don't have to realloc() too often.

Parameters:
buf  Pointer to the binbuffer
length  Desired minimum size
Returns:
0 on success, 1 on failiure.

void buf_free struct binbuffer *    buf
 

Safely frees a struct binbuffer.

Parameters:
buf  Pointer to the binbuffer to be freed
Returns:
N/A

unsigned char buf_getbyte struct binbuffer *    src,
size_t    offset
 

Safely gets a byte from a given binbuffer at a given offset.

Parameters:
src  Pointer to the source binbuffer
offset  Offset to the desired byte
Returns:
The byte on success, or 0 on failiure

int gif_deanimate struct binbuffer *    src,
struct binbuffer *    dst,
int    get_first_image
 

Deanimate a given GIF image, i.e.

given a GIF with an (optional) image block and an arbitrary number of image extension blocks, produce an output GIF with only one image block that contains the last image (extenstion) block of the original. Also strip Comments, Application extenstions, etc.

Parameters:
src  Pointer to the source binbuffer
dst  Pointer to the destination binbuffer
get_first_image  Flag: If set, get the first image If unset (default), get the last
Returns:
0 on success, or 1 on failiure

int gif_extract_image struct binbuffer *    src,
struct binbuffer *    dst
 

Safely extracts an image data block from a given struct binbuffer that contains a GIF image and whose offset is positioned at the start of a data block into a given destination binbuffer.

Parameters:
src  Pointer to the source binbuffer
dst  Pointer to the destination binbuffer
Returns:
0 on success, or 1 on failiure

int gif_skip_data_block struct binbuffer *    buf
 

Safely advances the offset of a given struct binbuffer that contains a GIF image and whose offset is positioned at the start of a data block, behind that block.

Parameters:
buf  Pointer to the binbuffer
Returns:
0 on success, or 1 on failiure


Variable Documentation

const char deanimate_h_rcs[] = DEANIMATE_H_VERSION
 

Version information about deanimate.h.

const char deanimate_rcs[] = "$Id: deanimate.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
 

Version information about deanimate.c.


Generated on Tue Jun 4 18:54:49 2002 for Privoxy 3.1.1 by doxygen1.2.15