TX1 Porting Completed - page 5 - General Discussion and Assistance - CHDK Forum
supplierdeeply

TX1 Porting Completed

  • 91 Replies
  • 35388 Views
*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #40 on: 23 / April / 2008, 14:38:15 »
Advertisements
The 'RAW'  text is initially offscreen and the tester can drag it down and to the right to 448, 239.
So, I guess width and height are 480 x 270.

It can't be 480 as the 'RAW' text is initially offscreen as you said. Because the default x-position of the text is vid_get_bitmap_width()-7*FONT_WIDTH-2 : 480-7*8-2=422. If it's not visible therefore the width is less than 422.
Upd: Or he moved the text off screen to the limits. Then he of course can get the 448.

And the height... The font size is 16 pixels in height. So, 239+16 is 255. Or did he move the text almost off the screen? Then the height is more likely 240.

« Last Edit: 23 / April / 2008, 14:41:35 by GrAnd »
CHDK Developer.

Re: TX1 Porting Completed
« Reply #41 on: 23 / April / 2008, 16:13:15 »
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

Right has no effect. Down stops at y:239.

Left brings the RAW/XML/CSV text & green box onscreen at x:330 and once there, it willl not move back past x:336. Down will still go offscreen to y:239 even though x: is now "captured."
~~~~~~~~~~~~~~~~~~~~~

<")%%%><<

Re: TX1 Porting Completed
« Reply #42 on: 24 / April / 2008, 06:24:59 »
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  :-


Code: [Select]
                 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.

Code: [Select]
                      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 :-

Code: [Select]
            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)

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #43 on: 24 / April / 2008, 06:58:48 »
The viewport buffer is really 960 pixels wide with 1.5 bytes per pixel.
This may be regarded as 480 x 3.

I do not think so. In the code you posted above, you subtracted 120 from screen_width. So I assume it is 360.

CHDK Developer.


Re: TX1 Porting Completed
« Reply #44 on: 24 / April / 2008, 07:04:06 »
I do not think so. In the code you posted above, you subtracted 120 from screen_width. So I assume it is 360.


Sorry, I should have said  that the latest code I sent to the tester did not have 120 subtracted.

The original zebra code has not been changed in any way for the latest  TX1  test.

I am waiting for a screenshot.

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #45 on: 24 / April / 2008, 09:13:38 »
Ok. I've made my modifications. Could anybody test the version attached?
« Last Edit: 24 / April / 2008, 14:03:28 by GrAnd »
CHDK Developer.

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #46 on: 24 / April / 2008, 09:42:14 »
... and sources
« Last Edit: 24 / April / 2008, 14:03:51 by GrAnd »
CHDK Developer.

Re: TX1 Porting Completed
« Reply #47 on: 24 / April / 2008, 09:48:51 »
Ok. I've made my modifications. Could anybody test the version attached?


100g sent to Australia, 101b to East coast of US so we should get quick replies.

I was in the middle of drawing a rectangle in the buffer, 50 pixels each side of centre.

It looked like this on TX1 because screen buffer shows  top left of  viewport.



Re: TX1 Porting Completed
« Reply #48 on: 24 / April / 2008, 10:11:01 »

No, the three column problem, though one is correctly aligned on the overexposed area.
« Last Edit: 24 / April / 2008, 10:13:50 by Microfunguy »

Re: TX1 Porting Completed
« Reply #49 on: 24 / April / 2008, 10:37:02 »
Here is the result produced by this simple test:


Code: [Select]
                for (s=0,y=viewport_height/2-50; y<=viewport_height/2+50; ++y)
                    {
                      for (x=screen_width/2-50; x<screen_width/2+50; ++x, ++s)
                       {
                        buf[y*screen_width+x]= cl_over;
                       }
     
                     }

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal