From: Eric Vannier Newsgroups: comp.os.msdos.djgpp Subject: Re: Proposal: Gif / Jpeg / or whatever decoder with callback Date: Fri, 20 Feb 1998 17:25:48 +0100 Organization: ENST, France Lines: 42 Message-ID: <34EDAE8C.71C8@email.enst.fr> References: <34e6164f DOT 747913 AT news DOT clear DOT net DOT nz> NNTP-Posting-Host: brouilly.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Not a bad idea ... But I preferr the way it is implemented in Allegro : The data of the bitmap is written to memory, than you use a blit function to do the device dependant blitting. There is one advantage of this method : With your method, you have to call the putpixel function many times which is very slow compared to a huge blit of the whole image. It is faster to write to memory, then blit to video memory. Of course you can use the same kind of functions you intend to write with a pointer to a blit function instead of a putpixel function. If you don't think that is a good idea to use so much memory to uncompress an image, you can pass a blit function which could be used line by line, or something like that. But I don't think that the memory problem is really relevant : - most PCs are equiped with a lot of memory these days ... and usually a lot more main memory than video memory. So, even if your image is huge, and cannot fit in central memory, it is not very likely to fit in the video memory - most algorithms used in bitmap compression and decompression require a bunch of memory which is usually more important than the size of the image itself. This is very true with JPEG If you did not know about Allegro try this : http://www.talula.demon.co.uk/allegro BTW, you 'll find some packages which do exactly what you want (GIF, JPEG) Best regards, Eric Vannier