I'm currently working on a self-teaching exercise in programming in C# to make an image decoder, I've produced several working solutions and so I thought I should tackle GIFs before I moved on to the more complex PNG and JPEG formats. My problem is that I'm really struggling to get my head round coming up with an actual solution to decompressing the LZW sub-blocks. I am just struggling to work out how to attempt it; I've seen several loosely-pseudo-code examples, but they seem to use terminology that I haven't really come across in C# and processes that I'm finding difficult to get my head around. Most also focus on compression, but decompression is what I'm most interested in.

For example, What is the best way that I can create the code-table in C#? A byte array, a dictionary or something else? How do I then go about decompressing the data? I'm not necessarily asking for code, just some help or links to examples that others have done (I find image decoding somewhat neglected of resources and educational material online).

Thanks.

有帮助吗?

解决方案

maybe this helps :-) http://paste.lisp.org/display/12198

And i agree a dictionary is a good choice for the Stringtable.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top