bmp Loader class

Started by
24 comments, last by MarkS_ 8 years, 5 months ago

Yes bmp sucks but I feel so close. This code works perfectly with bmp only one flaw when I try to free the pixels I get heap corruption. !!!
The only reason I use this format because I dont want to overload my head with compression and decompression, as I understand and correct me if am wrong everything else including targa uses compression.


Compression is optional in TGA files. I've never used it.

Ok I did some more research and now I am convinced. I will definitely look into rewriting my class to Tga at a later stage then.

Advertisement

Ok I did some more research and now I am convinced. I will definitely look into rewriting my class to Tga at a later stage then.


The issue with all of the graphics formats, and why I and others are recommending you make your own, is that they are all general purpose. They are designed to cover nearly every eventuality and can be quite cumbersome and confusing. The compression part of the TGA format is an example of this. There is little reason to use it and most people don't, however, it is added for completeness and it can make things difficult.

Still, TGA is the way to go. Most people writing their own formats use TGA as an intermediate format. It is one of the most sane of the image formats and isn't restricted through patents.
The short answer is no.

But the good answer is yes if you send an alpha map, which is a grayscale texture, which is the alpha value.

It's also a common solution when you do a masked blending, you clip based on this mask texture if you don't want to use the alpha of the texture directly.

Still, TGA is the way to go. Most people writing their own formats use TGA as an intermediate format.

We prefered to use png files in all projects I worked on.

A common way is to use libPNG : http://www.libpng.org/pub/png/libpng.html

We prefered to use png files in all projects I worked on.


Has the patent expired yet? I know that was a big deal a few years ago.

Where did you heard png is patented ?

PNG provides a patent-free replacement for GIF and can also replace many common uses of TIFF.

Source : http://ec.europa.eu/ipg/standards/image/png/index_en.htm (Last update:26/05/2015)

Where did you heard png is patented ?

PNG provides a patent-free replacement for GIF and can also replace many common uses of TIFF.

Source : http://ec.europa.eu/ipg/standards/image/png/index_en.htm (Last update:26/05/2015)


Huh. Looks like I got that mixed up with GIF.

This topic is closed to new replies.

Advertisement