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

Rename 16-bit RGB rawmodes #8158

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Sep 18, 2024

  1. parametrize test_lib_pack.py

    Yay295 committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    65af2ab View commit details
    Browse the repository at this point in the history
  2. add "new" rawmodes for 16-bit RGB data

    The existing 16-bit RGB rawmodes do not follow the naming convention given in Unpack.c. These new modes do follow that convention, except since these modes do not all use the same number of bits for each band, the sizes of each band are listed.
    
    Old → New
    RGB;15 → XBGR;1555
    RGB;16 → BGR;565
    BGR;5 → XRGB;1555
    BGR;15 → XRGB;1555
    BGR;16 → RGB;565
    RGB;4B → XBGR;4
    RGBA;4B → ABGR;4
    RGBA;15 → ABGR;1555
    BGRA;15 → ARGB;1555
    BGRA;15Z → ARGB;1555Z
    
    These new rawmodes also use a slightly different conversion method. The most accurate conversion from 5 to 8 bits is "round(x * 255 / 31.0)". However, that involves floating point numbers and rounding, so it's not as fast. The current method doesn't include the rounding, allowing us to also use integer instead of floating point division. This is faster, but unfortunately not roundtrippable - when converting from 5 to 8 to 5 bits not every value stays the same. The new method is roundtrippable, even faster than the current method since it uses basic bitwise operations instead of multiplication and division, and if you compare the result to what you get with rounding and floating point numbers, it is actually more accurate.
    Yay295 committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    75205f0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a43e1f8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8b719e9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    954def2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    51e5c92 View commit details
    Browse the repository at this point in the history
  7. don't show rawmode deprecation warning if mode is same as rawmode

    The "BGR;15" and "BGR;16" modes being deprecated is separate from the "BGR;15" and "BGR;16" rawmodes being deprecated.
    Yay295 committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    2c4df4e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ad7ecd4 View commit details
    Browse the repository at this point in the history
  9. remove unpackers with identical output

    radarhere authored and Yay295 committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    fe661d5 View commit details
    Browse the repository at this point in the history