When I first turn on the camera and access the OSD Layout Editor, the third press of Func Set displays:
RAW/EXP: x:448 y:45 s:10
In SDM, the 'RAW' text is displayed four characters in from the bmp buffer width, confirming that it is 480 wide.
While waiting for the tester, can I just check the details of the Zebra code ?
The viewport buffer is really 960 pixels wide with 1.5 bytes per pixel.
This may be regarded as 480 x 3.
Assuming we are in zebra 'solid' mode (not modes 1 or 2), we have :-
for (s=0, v=y=1; y<=viewport_height; ++y)
{
for (x=0; x<screen_width; ++x, ++s, v+=3)
{
buf[s]=(img_buf[v]>over)?cl_over:((img_buf[v]<conf.zebra_under)?cl_under:COLOR_TRANSPARENT);
}
Each row of the viewport is scanned and starting at offset '1' (a Y luminance value) in the row, we compare that value with the underexposure and overexposure settings.
buf[/s]is set to the appropriate transparent or colour value.
We jump three bytes in the viewport buffer to another luminance value and repeat the process.
This is continued to the end of the row.
For the 1440 viewport bytes we have 480 colour values.
if (y*screen_height/viewport_height == (s+screen_width)/screen_width)
{
memcpy(buf+s, buf+s-screen_width, screen_width);
s+=screen_width;
}
That row of 480 colour values is copied to the preceding row and 's' is incremented to the start of next row..
The condition for that copying to be done is y*screen_height/viewport_height == (s+screen_width)/screen_width)
If screen and viewport heights are the same, this simply requires a full row has been scanned.
What happens if our viewport height is 270 and screen height is 240 ?
Finally :-
memcpy(scr_buf, buf, screen_size);
memcpy(scr_buf+screen_size, buf, screen_size);
So, buf does have to be 480x270 in total size as that is the size of the screen buffer (even though ony 360x240 displayed)