pico-extras icon indicating copy to clipboard operation
pico-extras copied to clipboard

fix: PICO_SCANVIDEO_PIXEL_... macros assume 5-bit color

Open patricksurry opened this issue 10 months ago • 1 comments

I needed a few extra gpio pins, so reduced the color depth by adding some definitions to CMakeLists:

add_definitions(
         # -DPICO_SCANVIDEO_48MHZ=1
        -DPICO_SCANVIDEO_COLOR_PIN_BASE=0
        -DPICO_SCANVIDEO_COLOR_PIN_COUNT=12
        -DPICO_SCANVIDEO_DPI_PIXEL_RSHIFT=0u
        -DPICO_SCANVIDEO_DPI_PIXEL_GSHIFT=4u
        -DPICO_SCANVIDEO_DPI_PIXEL_BSHIFT=8u
        -DPICO_SCANVIDEO_DPI_PIXEL_RCOUNT=4
        -DPICO_SCANVIDEO_DPI_PIXEL_GCOUNT=4
        -DPICO_SCANVIDEO_DPI_PIXEL_BCOUNT=4
    )

This works but the PICO_SCANVIDEO_PIXEL_FROM_RGB8 macro is broken since it assumes 5 bit values so colors are messed up.

This PR fixes it and some related macros.

btw, loving this library, thanks for sharing!

patricksurry avatar Jan 11 '25 16:01 patricksurry

ooh, excellent, this has needed fixing for years ;-)

kilograham avatar Jan 11 '25 19:01 kilograham