summaryrefslogtreecommitdiffstats
path: root/tkagif
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-03-25 18:33:54 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-03-25 18:33:54 (GMT)
commite283062f1389788b052b633fbca4b03457330401 (patch)
tree3a1cad2627948951bf242d04bec550b43f5b898c /tkagif
parent62112674ed98e7fbcee85370c28b56d253e81f64 (diff)
downloadblt-e283062f1389788b052b633fbca4b03457330401.zip
blt-e283062f1389788b052b633fbca4b03457330401.tar.gz
blt-e283062f1389788b052b633fbca4b03457330401.tar.bz2
support animated gif
Diffstat (limited to 'tkagif')
-rw-r--r--tkagif/tkagif.C10
-rw-r--r--tkagif/tkagif.h2
2 files changed, 4 insertions, 8 deletions
diff --git a/tkagif/tkagif.C b/tkagif/tkagif.C
index 9b72fb9..dc1fc72 100644
--- a/tkagif/tkagif.C
+++ b/tkagif/tkagif.C
@@ -597,8 +597,6 @@ void TkAGIF::compress(unsigned char* pict)
state_.pictCount =0;
state_.initialBits = resolution_+1;
- state_.offset = 0;
- state_.hSize = HSIZE;
state_.outCount = 0;
state_.clearFlag = 0;
state_.inCount = 1;
@@ -612,14 +610,14 @@ void TkAGIF::compress(unsigned char* pict)
int hshift =0;
long fcode =0;
- for (fcode = (long)state_.hSize; fcode < 65536L; fcode *= 2L)
+ for (fcode = (long)HSIZE; fcode < 65536L; fcode *= 2L)
hshift++;
// Set hash code range bound
hshift = 8 - hshift;
- long hSize = state_.hSize;
- clearHashTable((int)hSize);
+ long hSize = HSIZE;
+ clearHashTable(hSize);
output((long)state_.clearCode);
@@ -742,7 +740,7 @@ void TkAGIF::output(long code)
void TkAGIF::clearForBlock()
{
- clearHashTable((int)state_.hSize);
+ clearHashTable(HSIZE);
state_.freeEntry = state_.clearCode + 2;
state_.clearFlag = 1;
diff --git a/tkagif/tkagif.h b/tkagif/tkagif.h
index ff84754..6c8748a 100644
--- a/tkagif/tkagif.h
+++ b/tkagif/tkagif.h
@@ -27,7 +27,6 @@ typedef struct {
long maxCode; /* Maximum code, given numBits. */
int hashTable[HSIZE];
unsigned int codeTable[HSIZE];
- long hSize; /* For dynamic table sizing. */
/*
* To save much memory, we overlay the table used by compress() with those
@@ -40,7 +39,6 @@ typedef struct {
int freeEntry; /* First unused entry. */
int clearFlag;
- int offset;
unsigned int inCount; /* Length of input */
unsigned int outCount; /* # of codes output (for debugging) */
int initialBits;