How to register a pixel mapper cleanly (file-wise)?

Is there an elegant way to register custom pixel mappers globally without hacking or modifying any internal code or C++ build params within rpi-rgb-led-matrix directly? I also don’t want to have to import and register the pixel mapper within each individual’s display program. I’d like it to be recognizable from the command-line flags. I have a mixture of Python and C++ written display programs and they live in a separate folders like this:

  • project_root
    • rpi-rgb-led-matrix(git)

    • src

      • pixel-mapper-custom.cc
    • views

      • py
        • weather
        • clock
      • cc
        • news
        • system-info

With this directory layout is it possible to register pixel-mapper-custom.cc without modifying the git repo rpi-rgb-led-matrix directly?

I see there is ApplyPixelMapperwhich seems to require initialization in each individual view program, and also RegisterPixelMapperfor global use - but I’m not sure where to use this second function when starting an individual Python or CC program from Bash. My code starts each individual display program directly from their own file. How in the build/init step can it be aware of how to find the pixel-mapper-custom.cc file and run RegisterPixelMapper?

I don’t believe there is any plugin method for mappers, I modified the code directly to add mine.

this sounds like the correct way to do things, so if you can build a nice PR, that would make things better for sure.
Please do have a look at this panel mapper that just landed though:

For pixel mappers within a panel, there is no plugin, they just get added one at a time.
I’m thinking those pixel mappers should be added to the code like they are now, because they are useful for everyone.

Mappers for layouts between panels are indeed more personal and one-off. If the one I just gave you is not good enough, having another plug in option would be good, or maybe you can further extend the one that just got added.

Please do. I had time to merge it but not to test it personally, yet.

Also feel free to tag me via @marcmerlin when you answer, I’ll see your answer more quickly

Very interesting. Could you dive in more detail?

a picture would make this more obvious.

Also please check the new universal programmable mapper that was checked in a week ago

aaah, got it., and yes the picture helps.
Glad to hear the new mapper is helping you.
That said, don’t you want to use 3 channels to triple your refresh rate?

You want this board, I worked with them to get a smaller board for rpi0 2w
https://www.electrodragon.com/product/rpi-passive-3ch-rgb-matrix-drive-board-v0/