Add new comment

Away from edges, I did this:

Away from edges, I did this:

    int iwidth = rawProcess.imgdata.sizes.iwidth;
    // somewhere in the middle of the picture, far from edges.
    int row = 2898;
    int col = 2898;
    // Display just 5 pixels
    int nPixels = 5;
 
    int first_visible_pixel = rawProcess.imgdata.sizes.raw_width*rawProcess.imgdata.sizes.top_margin + rawProcess.imgdata.sizes.left_margin;

then looping over a pixel index with i from 0 to 4 in :

 pixInd = first_visible_pixel + iwidth*row + col+ i;

rawProcess.imgdata.rawdata.raw_image[pixInd] gives:

unpack(): raw_image[ 17273428 ] = 2135
unpack(): raw_image[ 17273429 ] = 2091
unpack(): raw_image[ 17273430 ] = 2126
unpack(): raw_image[ 17273431 ] = 2174
unpack(): raw_image[ 17273432 ] = 2191

after raw2image(), imgdata.image[pixInd][0 to 3] gives, with the following printout arguments:
image[pixInd][0] | image[pixInd][1] | image[pixInd][2] | image[pixInd][3],

with now,  pixInd = iwidth*row + col + i ;

raw2image(): imgdata.image[ 16799706 ][0 to 3] = | 2175 | 0 | 0 | 0
raw2image(): imgdata.image[ 16799707 ][0 to 3] = | 0 | 2207 | 0 | 0
raw2image(): imgdata.image[ 16799708 ][0 to 3] = | 2134 | 0 | 0 | 0
raw2image(): imgdata.image[ 16799709 ][0 to 3] = | 0 | 2161 | 0 | 0
raw2image(): imgdata.image[ 16799710 ][0 to 3] = | 2139 | 0 | 0 | 0

I'd like to understand why the values in imgdata.image, after raw2image() are put alternatively in channel 0 and channel 1.

Currently, to me these values mean (for imgdata.image[][]):

pixel 16799706 has R = 2175 , G = 0, B = 0, G2 = 0
pixel 16799707 has R = 0 , G = 2207, B = 0, G2 = 0
etc...

Which i probably misunderstand as my image is clearly filled with all colors.
What am i missing this time?