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

Add a few RGB-aware set & blend methods to the blitters #1680

Merged
merged 43 commits into from
Aug 29, 2024

Commits on Aug 25, 2024

  1. Add RGB Highlights

    smasher816 authored and NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    c924cf8 View commit details
    Browse the repository at this point in the history
  2. Simplify BB_fill_rect_color

    And re-implement RGB32 fast path
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    4ac358c View commit details
    Browse the repository at this point in the history
  3. hashception!

    (Jokes aside, we tend to prefer that syntatcit sugar (and string
    methods) as opposed to calling string.fn(obj) explicitly).
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    ca873ab View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    54c4833 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    40ba4c4 View commit details
    Browse the repository at this point in the history
  6. A dumb MUL blend works extremely well for blakc text.

    It'll get funkier with colors, but, oh, well.
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    8f48dd0 View commit details
    Browse the repository at this point in the history
  7. I should got ake a nap.

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    5e1dd38 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3106499 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3d41552 View commit details
    Browse the repository at this point in the history
  10. Try some more stuff

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    9bccbda View commit details
    Browse the repository at this point in the history
  11. More random notes

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    3dddf95 View commit details
    Browse the repository at this point in the history
  12. Start rationalizing the C BB implementations

    Replace BB_blend_rect_color w/ BB_blend_RGB_multiply_rect
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    b5d241b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8d9be6d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    37d3be4 View commit details
    Browse the repository at this point in the history
  15. Inline the source_y8 store

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    32a2a5b View commit details
    Browse the repository at this point in the history
  16. This needs to live in base

    We need it from inside a Document class, and having it split between
    ReaderHighlights and BB is weird anyway
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    4cf224d View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7b0a281 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    523751f View commit details
    Browse the repository at this point in the history
  19. Address a 10-year old TODO, and properly rename dimRect & lightenRect

    methods... (Into lightenRect & darkenRect, respectively).
    
    c.f, 2cb2e40
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    a3352e6 View commit details
    Browse the repository at this point in the history
  20. Keep revamping the whole thing so it actually has a chance of working

    with the Lua blitter...
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    ce230f2 View commit details
    Browse the repository at this point in the history
  21. Constify Color? pointers

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    9329b83 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f613324 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    ee50150 View commit details
    Browse the repository at this point in the history
  24. Explain it.

    Leave the colorFromName fallback alone, for funsies
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    0f02247 View commit details
    Browse the repository at this point in the history
  25. Implement setPixelColorizeRGB32 in the Lua blitter

    Requires a few bendRGB32 shims for Color <= 8A, as the usual blend
    methods assume Color8 input.
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    b00c2e6 View commit details
    Browse the repository at this point in the history
  26. And implement setPixelMultiply in the Lua blitter

    Which is the one we actually care about, as we don't actually have any
    colorblitFromRGB32 callers ;).
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    609ffaf View commit details
    Browse the repository at this point in the history
  27. Implement blendRectRGB32

    To deal with highlights on sw nightmode...
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    9f7c6be View commit details
    Browse the repository at this point in the history
  28. LuaCheck'ed

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    1cd0a45 View commit details
    Browse the repository at this point in the history
  29. Simplify setPixelColorizeRGB32

    Implement a grayscale and a color one, like other setters
    
    Instead of implementing a full array of per-color type blend methods
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    341f05e View commit details
    Browse the repository at this point in the history
  30. Make colorblitFromRGB32 safer

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    c9a3cad View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    bad4ea5 View commit details
    Browse the repository at this point in the history
  32. Tweak colors some more

    And round the component values to 16 shades per component.
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    7d457d3 View commit details
    Browse the repository at this point in the history
  33. Make sure we cast colors to the right type first

    We often need a copy anyway, so take the opportunity to make this safer
    ;)
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    6e8277a View commit details
    Browse the repository at this point in the history
  34. More logical color orders

    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    5c6534d View commit details
    Browse the repository at this point in the history
  35. Drop gray from the highlight colors, and let colorFromName return nil

    This allows us to fairly easily make gray behave as our legacy grayscale
    highlights, honoring the user's opacity value.
    NiLuJe committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    a7710f9 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. Tighter scope for source_y8

    Matches what I did for BB_color_blit_from_RGB32
    NiLuJe committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    94ffa8e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    53f5dfb View commit details
    Browse the repository at this point in the history
  3. Fix a -Wsign-compare warning

    NiLuJe committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    0942857 View commit details
    Browse the repository at this point in the history
  4. Fix a truckload of -Wtype-limits warnings

    These are unsigned, they can't be negative ;).
    NiLuJe committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    171c10d View commit details
    Browse the repository at this point in the history
  5. Increase the alignment constraint on Kobo MTK

    Apparently, 8 wasn't enough, the highlight style dialog was still cutoff
    :/
    NiLuJe committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    bd56c8c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    99f302e View commit details
    Browse the repository at this point in the history
  7. Oh, no, I'd just forgotten that we enforced different constraints when

    dithering.
    
    So, rejig that so we can tweak that on a per-device basis, too.
    NiLuJe committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    824488c View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2024

  1. Configuration menu
    Copy the full SHA
    24b5f0f View commit details
    Browse the repository at this point in the history