Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stb_image: support horizontally flipped TGA images #1667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 24, 2024

  1. 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.
    illwieckz committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    1095e35 View commit details
    Browse the repository at this point in the history