I’ve been testing a panel from a manufacturer and it seems to have a weird layout of connection on the panel, segmented to blocks of 10px x 8px
How might I go about creating a pixel map for this?
I’ve been testing a panel from a manufacturer and it seems to have a weird layout of connection on the panel, segmented to blocks of 10px x 8px
How might I go about creating a pixel map for this?
follow the code for --led-row-addr-type=3 and see how it handles addressing in non standard ways.
So I based it off the pixel mapper as suggested and adjusted the tile height and width, every odd row has blocks where the pixels are reversed, any suggestion?
class P4Outdoor80x40V2 : public MultiplexMapperBase
{
public:
P4Outdoor80x40V2(const char *name, int even_vblock_offset, int odd_vblock_offset)
: MultiplexMapperBase(name, 2),
even_vblock_offset_(even_vblock_offset),
odd_vblock_offset_(odd_vblock_offset) {}
void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const
{
static const int tile_width = 8;
static const int tile_height = 10;
const int vert_block_is_odd = ((y / tile_height) % 2);
const int even_vblock_shift = (1 - vert_block_is_odd) * even_vblock_offset_;
const int odd_vblock_shitf = vert_block_is_odd * odd_vblock_offset_;
*matrix_x = x + ((x + even_vblock_shift) / tile_width) * tile_width + odd_vblock_shitf;
*matrix_y = (y % tile_height) + tile_height * (y / (tile_height * 2));
}
private:
const int even_vblock_offset_;
const int odd_vblock_offset_;
};
I ended up writing an additional statement to just reverse the x pixels in blocks of 8, not too sure if its the best way of doing though
void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const
{
static const int tile_width = 8;
static const int tile_height = 10;
const int vert_block_is_odd = ((y / tile_height) % 2);
const int even_vblock_shift = (1 - vert_block_is_odd) * even_vblock_offset_;
const int odd_vblock_shitf = vert_block_is_odd * odd_vblock_offset_;
if (!(vert_block_is_odd))
{
int block_count = (x)/tile_width;
int pixel_num = (x) % tile_width-1;
x = (block_count * tile_width) - 1 + (tile_width-1 - pixel_num);
}
*matrix_x = x + ((x + even_vblock_shift) / tile_width) * tile_width + odd_vblock_shitf;
*matrix_y = (y % tile_height) + tile_height * (y / (tile_height * 2));
}
Hello
It is a quite typical pixel layout for i.e. “quarter scan” panels - panels that illuminate a four lines for every A B C address.
The panel is divided into blocks with a repeating pixel layout. I call the width of such a block a “pixel base” (8pt in your case). The height of this block is equal to the scan of the panel.
By breaking the whole pixel pattern into such blocks, we can significantly simplify the coordinate transformations for such panels.
See this for example:
they are called zagzig panels and indeed have need special mapping that does not yet exist in this lib, but could be added by someone like you