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

Added Multiplex Mapper for P5Outdoor8S64x32 Panel #1544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions lib/multiplex-mappers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,35 @@ class P10Outdoor32x16HalfScanMapper : public MultiplexMapperBase {
}
};

class P5Outdoor8S64x32MultiplexMapper : public MultiplexMapperBase
{
public:
P5Outdoor8S64x32MultiplexMapper() : MultiplexMapperBase("P5Outdoor8S64x32", 2) {}

void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const
{
// *matrix_y = 0; // Change between 0 to 15!
// *matrix_x = 0; // Change between 0 to 127!

if (y >= 0 && y < 8) {
*matrix_y = y;
} else if (y >= 8 && y < 16) {
*matrix_y = y - 8;
} else if (y >= 16 && y < 24) {
*matrix_y = y - 8;
} else if (y >= 24 && y < 32) {
*matrix_y = y - 16;
}

int incrFactor = x / 4;
if ((y >= 0 && y < 8) || (y >= 16 && y < 24)) {
*matrix_x = x + (incrFactor * 4) + 4;
} else if ((y >= 8 && y < 16) || (y >= 24 && y < 32)) {
*matrix_x = x + (incrFactor * 4);
}
}
};

/*
* Here is where the registration happens.
* If you add an instance of the mapper here, it will automatically be
Expand Down Expand Up @@ -481,6 +510,7 @@ static MuxMapperList *CreateMultiplexMapperList() {
result->push_back(new P8Outdoor1R1G1BMultiplexMapper());
result->push_back(new FlippedStripeMultiplexMapper());
result->push_back(new P10Outdoor32x16HalfScanMapper());
result->push_back(new P5Outdoor8S64x32MultiplexMapper());
return result;
}

Expand Down