Open cmagnuson opened 6 years ago
(you have not given a video of the scrolling example to illustrate).
If you have a chain of 5 and rotate it by 90 degrees, you have a portrait display, so now it is very narrow to display the texts, so it sounds like from what you describe like an expected result.
If you want to have text that writes a vertical text from top to bottom on such a screen, you might want to use VerticalDrawText(...)
Thanks for the explanation, I just misunderstood how the rotate command was working.
In the initial case (no rotate) I have a long horizontal row of panels (case 1). After setting rotate 90° I'd expected to have a horizontal row of panels with each individual panel rotated 90° (case 2) but as you described I see it takes the entire matrix of panels and rotates that by 90° (case 3).
So I was incorrect in my assumption and the rotate is working. Is there a way to apply a rotation to the individual panels instead of the entire matrix?
see this issue https://github.com/hzeller/rpi-rgb-led-matrix/issues/368
Thanks for the pointers.
Would you consider a pull request for a PixelMapper like this:
class RotateSinglePanelPixelMapper : public PixelMapper {
public:
RotateSinglePanelPixelMapper() : chain_(0) {}
virtual const char *GetName() const { return "RotatePanel"; }
virtual bool SetParameters(int chain, int parallel, const char *param) {
chain_ = chain;
return true;
}
virtual bool GetSizeMapping(int matrix_width, int matrix_height,
int *visible_width, int *visible_height)
const {
*visible_width = matrix_height * chain_;
*visible_height = matrix_width / chain_;
return true;
}
virtual void MapVisibleToMatrix(int matrix_width, int matrix_height,
int x, int y,
int *matrix_x, int *matrix_y) const {
const int panel_width = matrix_width / chain_;
const int panel_height = matrix_height;
*matrix_x = matrix_width - (y + panel_width * (x / panel_height)) - 1;
*matrix_y = x % panel_height;
}
private:
int chain_;
};
It is working for the use case I described above, but doesn't handle parallel panels at the moment.
I'm running a chain of 5x 16x32 panels rotated 90° with this command:
sudo rpi-rgb-led-matrix/examples-api-use/text-example --led-gpio-mapping=adafruit-hat --led-chain=5 --led-rows=16 --led-cols=32 --led-row-addr-type=2 --led-multiplexing=8 -f ter-powerline-x32n.bdf --led-pwm-bits=1 --led-pwm-lsb-nanoseconds=1000 --led-slowdown-gpio=2 --led-pixel-mapper="Rotate:90"
But entering a string only results in the first character being printed. I can write one character in each panel by typing:
for example, but I'd expect to be able to write out that string using just:
I'd guess it is still assuming the same canvas width as before the rotation?
The scrolling-text-example has similar results - it only displays on the first panel when "Rotate:90" is set. When I remove the pixel mapper though it will draw all panels as expected.
Scrolling text example: