X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_gif%2Ftrgt_gif.h;h=ae10e31d3a7407ffd4778ec22f6bd0d77cb9243e;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=9e72a0591647553d13f2db5e238881a2e8553251;hpb=21bfc670b83d4c45da9ed1b95063b7e6a007168c;p=synfig.git 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 --- 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 @@ -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. +** \endlegal ** ** === 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; - + // Pushes a single bit onto the bit void push_bit(bool bit) { @@ -64,8 +67,8 @@ private: if(curr_bit==8) empty(); } - - // Emptys out the current pool into + + // Empties out the current pool into // the buffer. Calls 'dump()' if the // buffer is full. void empty() @@ -75,9 +78,9 @@ private: pool=0; if(curr_pos==255)dump(); } - + // 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() @@ -91,7 +94,7 @@ private: curr_pos=0; } } - + // 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 - + lzwcode():value(0),code(0),kids(0),next(0) { } - + 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); } - + 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; @@ -134,21 +137,21 @@ private: n->next = this->kids; this->kids = n; } - + static lzwcode * NewTable(int values) { int i; lzwcode * table = new lzwcode; - + table->kids = 0; for (i = 0; i < values; i++) table->AddNode( i, i); - + return(table); } - + // Destructor just deletes any - // children and sibblings. + // children and siblings. ~lzwcode() { if(kids) @@ -162,13 +165,13 @@ private: bitstream bs; synfig::String filename; synfig::SmartFILE file; - int + int i, // General-purpose index codesize, // Current code size - rootsize, // Size of pixel bits (will be recalculted) + rootsize, // Size of pixel bits (will be recalculated) nextcode; // Next code to use lzwcode *table,*next,*node; - + synfig::Surface curr_surface; etl::surface curr_frame; etl::surface prev_frame; @@ -185,11 +188,11 @@ private: int iframe_density; int loop_count; bool local_palette; - + synfig::Palette curr_palette; - + void output_curr_palette(); - + public: gif(const char *filename); @@ -199,7 +202,7 @@ public: virtual void end_frame(); virtual ~gif(); - + virtual synfig::Color * start_scanline(int scanline); virtual bool end_scanline(void);