# Cross shaped screens disposition

**URL:** <https://rpi-rgb-led-matrix.discourse.group/t/cross-shaped-screens-disposition/100>\
**Category:** Uncategorized\
**Created:** [January 27, 2021, 9:43am UTC](https://rpi-rgb-led-matrix.discourse.group/t/cross-shaped-screens-disposition/100 "2021-01-27T09:43:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AxelH](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@AxelH](https://rpi-rgb-led-matrix.discourse.group/u/AxelH)\
**Post date:** [January 27, 2021, 9:43am UTC](https://rpi-rgb-led-matrix.discourse.group/t/cross-shaped-screens-disposition/100/1 "2021-01-27T09:43:27Z")

</div>

Hi everyone !

I’m using 16x32 1/2 scan panel with ACME HAT-A3 and RPi 3B+.  
I achieved to make them work well together in square shape, but now I’m trying to make a cross shape as below :  
\_\_\_\_\_[I - O]  
\_\_\_\_\_[I - O]  
[I - O] [I - O] [I - O]  
[I - O] [I - O] [I - O]  
\_\_\_\_\_[I - O]  
\_\_\_\_\_[I - O]

After few hours of research it doesn’t seem to be an usual use of the library so I came here to ask for help.  
Is it possible to consume in the software some bits as if 2 more screens were connected only in line 1 and 3 ?  
As I am currently developing my own HAT, is it simplyer to add some hardware shift register ?

For now I achieved to make them work by playing with chain length and rotation. But ideally I’d like to simply display a square image.

> // Middle screen  
> sudo ./led-image-viewer full\_0.png --led-rows=16 --led-cols=32 --led-chain=6 --led-parallel=3 --led-multiplexing=7 --led-brightness=25 --led-pixel-mapper=“V-mapper;Rotate:-90;” --led-no-hardware-pulse -f --led-daemon  
> // Top screen  
> sudo ./led-image-viewer cube.gif --led-rows=16 --led-cols=32 --led-chain=2 --led-parallel=1 --led-multiplexing=7 --led-brightness=25 --led-pixel-mapper=“V-mapper;Rotate:-90;” --led-no-hardware-pulse -f --led-daemon  
> // Bottom screen  
> sudo ./led-image-viewer cube.gif --led-rows=16 --led-cols=32 --led-chain=2 --led-parallel=3 --led-multiplexing=7 --led-brightness=25 --led-pixel-mapper=“V-mapper;Rotate:90;Mirror:H;Mi” --led-no-hardware-pulse -f --led-daemon

Thank you in advance for your help !

!!! EDIT !!!  
I modified StoreInStream in led-image-viewer to add an offset when needed and it works !  
It’s not clean and certainly not optimized but it works.  
I’ll tried to add the offset in video-viewer tomorrow.

> static void StoreInStream(const Magick::Image &img, int delay\_time\_us,  
> bool do\_center,  
> rgb\_matrix::FrameCanvas \*scratch,  
> rgb\_matrix::StreamWriter \*output) {  
> scratch-\>Clear();  
> const int x\_offset = do\_center ? (scratch-\>width() - img.columns()) / 2 : 0;  
> const int y\_offset = do\_center ? (scratch-\>height() - img.rows()) / 2 : 0;  
> int y\_cross\_offset = 0;
> 
> for (size\_t y = 0; y \< img.rows(); ++y) {  
> for (size\_t x = 0; x \< img.columns(); ++x) {  
> if((y\<=32) && ((x\<32) || (x\>=64))) y\_cross\_offset=32;  
> else y\_cross\_offset=0;  
> const Magick::Color &c = img.pixelColor(x, y+y\_cross\_offset);  
> if (c.alphaQuantum() \< 256) {  
> scratch-\>SetPixel(x + x\_offset, y + y\_offset,  
> ScaleQuantumToChar(c.redQuantum()),  
> ScaleQuantumToChar(c.greenQuantum()),  
> ScaleQuantumToChar(c.blueQuantum()));  
> }  
> }  
> }  
> output-\>Stream(\*scratch, delay\_time\_us);  
> }
