Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stb_image: support horizontally flipped TGA images
The TGA format is a bottom-left format by default: the first byte of the first column is expected to be displayed at the bottom-left of the screen, this behavior is inherited from devices painting the screen from the bottom left to the top right. The TGA format provides two bits in the image descriptor byte to paint the data from other sides. The 4th bit tells the device to paint the screen from right-to left and the 5th bit tells the device to paint the screen from top to bottom. So basically: - 00: from bottom-left to top-right - 01: from top-left to bottom-right - 10: from bottom-right to top-left - 11: from top-right to bottom-left Previously stb_image only read the 5th bit and then only supported the loading of vertically flipped images, stb_image was ignoring the 4th bit coding the horizontal flip. Now both flipping directions are supported for both raw and RLE storage.
- Loading branch information