Mail Archives: djgpp/1998/02/20/11:30:44
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
- Raw text -