Targa File Help
I have a class that I wrote, (first one that has to do with reading in Binary Files) that is meant to read in TRUECOLOR TGA Files. For some reason it is not working and the results come out a bit different than expected. I've tried many different things but still cannot work it out. Any help is appreciated.
(TGA INFO was retrieved from http://www.wotsit.org/download.asp?f=tga2)
(PLEASE RENAME THE "a.txt" AND "b.txt" extensions to ".tga")
There are two things to take into account when loading targa files:
1) The scan lines goes form bottom to top. The first scanline is the bottom one, the last is the top one.
2) The colors are stored as BGR or BGRA, not RGB or RGBA. Solve this by doing std::swap on the first and third byte in the pixel.