From 71b7776a8297b5f0114b4e29427f72103d3ae289 Mon Sep 17 00:00:00 2001 From: andytheengineerguy Date: Sat, 9 Sep 2023 00:17:20 +0100 Subject: [PATCH 1/2] Updated ZStripeMultiplexMapper to suport variable tile sizes --- lib/multiplex-mappers.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/multiplex-mappers.cc b/lib/multiplex-mappers.cc index 31b266d5d..ec94deb45 100644 --- a/lib/multiplex-mappers.cc +++ b/lib/multiplex-mappers.cc @@ -153,14 +153,16 @@ class SpiralMultiplexMapper : public MultiplexMapperBase { class ZStripeMultiplexMapper : public MultiplexMapperBase { public: - ZStripeMultiplexMapper(const char *name, int even_vblock_offset, int odd_vblock_offset) + ZStripeMultiplexMapper(const char *name, int even_vblock_offset, int odd_vblock_offset, int width, int height) : MultiplexMapperBase(name, 2), even_vblock_offset_(even_vblock_offset), - odd_vblock_offset_(odd_vblock_offset) {} + odd_vblock_offset_(odd_vblock_offset), + width_(width), + height_(height) {} void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const { - static const int tile_width = 8; - static const int tile_height = 4; + static const int tile_width = width_; + static const int tile_height = height_; const int vert_block_is_odd = ((y / tile_height) % 2); @@ -174,6 +176,8 @@ class ZStripeMultiplexMapper : public MultiplexMapperBase { private: const int even_vblock_offset_; const int odd_vblock_offset_; + const int width_; + const int height_; }; class CoremanMapper : public MultiplexMapperBase { @@ -466,11 +470,11 @@ static MuxMapperList *CreateMultiplexMapperList() { result->push_back(new StripeMultiplexMapper()); result->push_back(new CheckeredMultiplexMapper()); result->push_back(new SpiralMultiplexMapper()); - result->push_back(new ZStripeMultiplexMapper("ZStripe", 0, 8)); - result->push_back(new ZStripeMultiplexMapper("ZnMirrorZStripe", 4, 4)); + result->push_back(new ZStripeMultiplexMapper("ZStripe", 0, 8, 8, 4)); + result->push_back(new ZStripeMultiplexMapper("ZnMirrorZStripe", 4, 4, 8, 4)); result->push_back(new CoremanMapper()); result->push_back(new Kaler2ScanMapper()); - result->push_back(new ZStripeMultiplexMapper("ZStripeUneven", 8, 0)); + result->push_back(new ZStripeMultiplexMapper("ZStripeUneven", 8, 0, 8, 4)); result->push_back(new P10MapperZ()); result->push_back(new QiangLiQ8()); result->push_back(new InversedZStripe()); @@ -481,6 +485,7 @@ static MuxMapperList *CreateMultiplexMapperList() { result->push_back(new P8Outdoor1R1G1BMultiplexMapper()); result->push_back(new FlippedStripeMultiplexMapper()); result->push_back(new P10Outdoor32x16HalfScanMapper()); + result->push_back(new ZStripeMultiplexMapper("P3Outdoor104x52", 4, 4, 8, 13)); //note: 13 tile height needed for this return result; } From 17532accde7d545aadc73fc13e27481b9b1fe890 Mon Sep 17 00:00:00 2001 From: andytheengineerguy Date: Sat, 9 Sep 2023 01:14:54 +0100 Subject: [PATCH 2/2] Added a new multiplexing mapping P4Outdoor80x40, which apparently works for a version of the 104*52 panels. Found from a forum post. --- lib/multiplex-mappers.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/multiplex-mappers.cc b/lib/multiplex-mappers.cc index ec94deb45..c82808fe0 100644 --- a/lib/multiplex-mappers.cc +++ b/lib/multiplex-mappers.cc @@ -458,6 +458,17 @@ class P10Outdoor32x16HalfScanMapper : public MultiplexMapperBase { } }; +class P4Outdoor80x40 : public MultiplexMapperBase { +public: + P4Outdoor80x40() : MultiplexMapperBase("P4Outdoor80x40", 2) {} + + void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const { + int shift = (y / (panel_rows_ / 4)) % 2; + *matrix_y = ((y / (panel_rows_/2)) * (panel_rows_/4) + y % (panel_rows_/4)); + *matrix_x = ((x * 2) + (shift ? 0 : 1)); + } +}; + /* * Here is where the registration happens. * If you add an instance of the mapper here, it will automatically be @@ -486,6 +497,7 @@ static MuxMapperList *CreateMultiplexMapperList() { result->push_back(new FlippedStripeMultiplexMapper()); result->push_back(new P10Outdoor32x16HalfScanMapper()); result->push_back(new ZStripeMultiplexMapper("P3Outdoor104x52", 4, 4, 8, 13)); //note: 13 tile height needed for this + result->push_back(new P4Outdoor80x40()); //this mapping also worked with a version of the 104*52 panels! return result; }