projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Oops - missed one in the last commit.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
modules
/
mod_gif
/
trgt_gif.h
diff --git
a/synfig-core/trunk/src/modules/mod_gif/trgt_gif.h
b/synfig-core/trunk/src/modules/mod_gif/trgt_gif.h
index
9e72a05
..
ae10e31
100644
(file)
--- a/
synfig-core/trunk/src/modules/mod_gif/trgt_gif.h
+++ b/
synfig-core/trunk/src/modules/mod_gif/trgt_gif.h
@@
-1,8
+1,10
@@
-/*! ========================================================================
-** Synfig
-** Template Header File
-** $Id: trgt_gif.h,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $
+/* === S Y N F I G ========================================================= */
+/*! \file trgt_gif.h
+** \brief Template Header
**
**
+** $Id$
+**
+** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** This package is free software; you can redistribute it and/or
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** This package is free software; you can redistribute it and/or
@@
-14,6
+16,7
@@
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** General Public License for more details.
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** General Public License for more details.
+** \endlegal
**
** === N O T E S ===========================================================
**
**
** === N O T E S ===========================================================
**
@@
-54,7
+57,7
@@
private:
bitstream(synfig::SmartFILE file):file(file),pool(0),curr_bit(0),curr_pos(0) {}
unsigned char buffer[256];
int curr_pos;
bitstream(synfig::SmartFILE file):file(file),pool(0),curr_bit(0),curr_pos(0) {}
unsigned char buffer[256];
int curr_pos;
-
+
// Pushes a single bit onto the bit
void push_bit(bool bit)
{
// Pushes a single bit onto the bit
void push_bit(bool bit)
{
@@
-64,8
+67,8
@@
private:
if(curr_bit==8)
empty();
}
if(curr_bit==8)
empty();
}
-
- // Empt
y
s out the current pool into
+
+ // Empt
ie
s out the current pool into
// the buffer. Calls 'dump()' if the
// buffer is full.
void empty()
// the buffer. Calls 'dump()' if the
// buffer is full.
void empty()
@@
-75,9
+78,9
@@
private:
pool=0;
if(curr_pos==255)dump();
}
pool=0;
if(curr_pos==255)dump();
}
-
+
// If there is anything in the
// If there is anything in the
- // buffer or in the pool, it
+ // buffer or in the pool, it
// dumps it to the filestream.
// Buffer and pool are cleared.
void dump()
// dumps it to the filestream.
// Buffer and pool are cleared.
void dump()
@@
-91,7
+94,7
@@
private:
curr_pos=0;
}
}
curr_pos=0;
}
}
-
+
// Pushes a symbol of the given size
// onto the bitstream.
void push_value(int value, int size)
// Pushes a symbol of the given size
// onto the bitstream.
void push_value(int value, int size)
@@
-109,24
+112,24
@@
private:
int code; // lzwcode
struct lzwcode* kids; // children of this node
struct lzwcode* next; // siblings of this node
int code; // lzwcode
struct lzwcode* kids; // children of this node
struct lzwcode* next; // siblings of this node
-
+
lzwcode():value(0),code(0),kids(0),next(0) { }
lzwcode():value(0),code(0),kids(0),next(0) { }
-
+
lzwcode *FindCode(int value)
{
lzwcode *node=this;
lzwcode *FindCode(int value)
{
lzwcode *node=this;
-
+
// check the children (kids) of the node for the value
for (node = node->kids; node != 0; node = node->next)
if (node->value == value)
return(node);
return(0);
}
// check the children (kids) of the node for the value
for (node = node->kids; node != 0; node = node->next)
if (node->value == value)
return(node);
return(0);
}
-
+
void AddNode(unsigned short code, unsigned short value)
{
lzwcode *n = new lzwcode;
void AddNode(unsigned short code, unsigned short value)
{
lzwcode *n = new lzwcode;
-
+
// add a new child to node; the child will have code and value
n->value = value;
n->code = code;
// add a new child to node; the child will have code and value
n->value = value;
n->code = code;
@@
-134,21
+137,21
@@
private:
n->next = this->kids;
this->kids = n;
}
n->next = this->kids;
this->kids = n;
}
-
+
static lzwcode * NewTable(int values)
{
int i;
lzwcode * table = new lzwcode;
static lzwcode * NewTable(int values)
{
int i;
lzwcode * table = new lzwcode;
-
+
table->kids = 0;
for (i = 0; i < values; i++)
table->AddNode( i, i);
table->kids = 0;
for (i = 0; i < values; i++)
table->AddNode( i, i);
-
+
return(table);
}
return(table);
}
-
+
// Destructor just deletes any
// Destructor just deletes any
- // children and sib
b
lings.
+ // children and siblings.
~lzwcode()
{
if(kids)
~lzwcode()
{
if(kids)
@@
-162,13
+165,13
@@
private:
bitstream bs;
synfig::String filename;
synfig::SmartFILE file;
bitstream bs;
synfig::String filename;
synfig::SmartFILE file;
- int
+ int
i, // General-purpose index
codesize, // Current code size
i, // General-purpose index
codesize, // Current code size
- rootsize, // Size of pixel bits (will be recalculted)
+ rootsize, // Size of pixel bits (will be recalcul
a
ted)
nextcode; // Next code to use
lzwcode *table,*next,*node;
nextcode; // Next code to use
lzwcode *table,*next,*node;
-
+
synfig::Surface curr_surface;
etl::surface<unsigned char> curr_frame;
etl::surface<unsigned char> prev_frame;
synfig::Surface curr_surface;
etl::surface<unsigned char> curr_frame;
etl::surface<unsigned char> prev_frame;
@@
-185,11
+188,11
@@
private:
int iframe_density;
int loop_count;
bool local_palette;
int iframe_density;
int loop_count;
bool local_palette;
-
+
synfig::Palette curr_palette;
synfig::Palette curr_palette;
-
+
void output_curr_palette();
void output_curr_palette();
-
+
public:
gif(const char *filename);
public:
gif(const char *filename);
@@
-199,7
+202,7
@@
public:
virtual void end_frame();
virtual ~gif();
virtual void end_frame();
virtual ~gif();
-
+
virtual synfig::Color * start_scanline(int scanline);
virtual bool end_scanline(void);
virtual synfig::Color * start_scanline(int scanline);
virtual bool end_scanline(void);