Writing data to output buffer

Hi there,

I’m new here and this is my first post.

I basically have three questions regarding writing data to an output buffer.

The code I saw so far looks like this:

g_odata[y*imgw+x] = rgbToInt(rsum, gsum, bsum)
  1. It looks like one can have three values and assign them to an array

    by using only one index. How does this work?

  2. Where can I find documentation about rgbToInt().

  3. How can I write float4 (or float3) to an output buffer?

It would be great if someone has answers for me!

Hi.
r, g, b - 8-th bit numbers. rgbtoint is a 24 bit number. The map ( f( r,g,b )->int ) construction very simply - the first 8-th bit of “rgbtoint” number it r, the second 8-th bit - g and the third - b.

Thank you.
In the meantime I noticed that rgbToInt is not a built-in function. I simply didn’t see the implementation of it.