fsphil / hacktv

Analogue TV transmitter for the HackRF
GNU General Public License v3.0
669 stars 80 forks source link

how is hackTV able to generate colorbars by using only one array #97

Closed veso266 closed 1 year ago

veso266 commented 1 year ago

Hi there, this my seam a stupid question, but I was checking the colorbars generation in test.c and noticied that it seams it is able to generate colorbars by using only one array

Don't you need 3 arrays or one matrix with 3 columns (red,green,blue) to put 3 channels into?

I know its in the code, I just cannot figure out how is this done :smile:

Thanks for anwsering

fsphil commented 1 year ago

The RGB values are packed into a single 24-bit* integer: 0xRRGGBB Eg. 0xBF0000 is 0xBF for red, 0x00 for green, 0x00 for blue.