home *** CD-ROM | disk | FTP | other *** search
/ Mega Demo / MegaDemoCDRom1.cdr / av / gif / gifdecod.gif (.png) < prev    next >
Graphics Interchange Format  |  1992-08-14  |  7KB  |  640x350  |  4-bit (4 colors)
Labels: text | diagram | font | screenshot
OCR: GIF Decoder by Bob Montgomery 1-22-87 Notes: 1. nuc = next valid code Init decoder 2. A code is decomposed into a string of colors Get new_code (color) 3. Colors are pushed onto a stack so they can oldcode = color = new_code be output last first, which is the order print(color) the encoder saw them. 4. Init decoder: codesize = bits/pixel + 1 clear_code = 1 << bit/pixel Get new_code end_code = clear_code + 1 code = new_code min_code = end_code + 1 max_code = clear_code << 1 Is it the next valid code? nvc = end_code + 1 code Envc ?- Y 5. If codesize > 12, Init decoder code = old_code push color It was a color Is it a code? colors Save new string = code ~code > N push color min_code. shadelnyc] = color child[nvc] = old_code Decompose the code old_code = new_code push shade[code] nvc = nvc + 1 ...