TX1 Porting Completed - page 4 - General Discussion and Assistance - CHDK Forum  

TX1 Porting Completed

  • 91 Replies
  • 35493 Views
Re: TX1 Porting Completed
« Reply #30 on: 22 / April / 2008, 18:43:01 »
Advertisements
I got the picture grabbed from the buffer and decoded:


Very interesting  .. presumably your code could not do that in 'real-time', it is not fast enough  ?

Re: TX1 Porting Completed
« Reply #31 on: 22 / April / 2008, 21:16:54 »
This is a video (22mb) of the screen when zebra is activated (half press on shutter button):

zSHARE - mvi_2768.avi

Parameters are:

Zebra Mode: Solid
UnderExposure threshold:[0]
OverExposure threshold: [1]
Restore original screen: [yes]
Restore OSD: [yes]
Draw over zebra: [Nothing]

And of course:

Show histogram: [no]
Show zebra: [yes]

Let me know if any other images are needed.

Thanks,
~~~~~~~~~~~~~~~~~~~~~

<")%%%><<

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #32 on: 23 / April / 2008, 01:36:48 »
I got the picture grabbed from the buffer and decoded:

Very interesting  .. presumably your code could not do that in 'real-time', it is not fast enough  ?

Do you mean converting to RGB? The algorithm is used for RGB histogram and MD in RGB mode.
CHDK Developer.

Re: TX1 Porting Completed
« Reply #33 on: 23 / April / 2008, 04:54:00 »
No need to download the video (which requires a Motion JPEG codec), here are a couple of frames :-




Just like the initial splashscreen (that had too small a buffer size), we have three columns and an interlaced effect.

For those interested, here is current zebra code  :-

int gui_osd_draw_zebra() {
    unsigned int v, s, x, y, f, over;
    color cl_under=conf.zebra_color>>8, cl_over=conf.zebra_color&0xFF;
    static int need_restore=0;
    int viewport_height;

    if (!buf) {
        buf = malloc(screen_size);
        scr_buf = vid_get_bitmap_fb();
    }

    if (buf) {
        ++timer;
        img_buf=((mode_get()&MODE_MASK) == MODE_PLAY)?vid_get_viewport_fb_d():vid_get_viewport_fb();
        viewport_height = vid_get_viewport_height();
        switch (conf.zebra_mode) {
            case ZEBRA_MODE_ZEBRA_1:
                f = 4;
                break;
            case ZEBRA_MODE_ZEBRA_2:
                f = 8;
                break;
            case ZEBRA_MODE_SOLID:
                f = 1;
                break;
            case ZEBRA_MODE_BLINKED_1:
                f = timer&2;
                break;
            case ZEBRA_MODE_BLINKED_3:
                f = timer&8;
                break;
            case ZEBRA_MODE_BLINKED_2:
            default:
                f = timer&4;
                break;
        }
        if (!f) {
            if (need_restore) {
                if (conf.zebra_restore_screen || conf.zebra_restore_osd) {
                    draw_restore();
                } else {
                    memset(buf, COLOR_TRANSPARENT, screen_size);
                    gui_osd_draw_zebra_osd();
                    memcpy(scr_buf, buf, screen_size);
                    memcpy(scr_buf+screen_size, buf, screen_size);
                }
                need_restore=0;
            }
            return !(conf.zebra_restore_screen && conf.zebra_restore_osd);
        } else {
            over = 255-conf.zebra_over;
            if (conf.zebra_mode == ZEBRA_MODE_ZEBRA_1 || conf.zebra_mode == ZEBRA_MODE_ZEBRA_2) {
                for (s=0, y=0; y<screen_height; ++y) {
#if !defined(CAMERA_tx1)
                    v=y*viewport_height/screen_height*screen_width*3+1;
                    for (x=0; x<screen_width; ++x, ++s, v+=3) {

#else
                    v=y*viewport_height/screen_height*(screen_width-120)*3+1;
                    for (x=0; x<screen_width-120; ++x, ++s, v+=3) {
#endif

                        buf[s]=(img_buf[v]>over && ((y-x-timer)&f))?cl_over:((img_buf[v]<conf.zebra_under && ((y-x-timer)&f))?cl_under:COLOR_TRANSPARENT);
                    }
                }
            } else {
                for (s=0, v=y=1; y<=viewport_height; ++y) {
 #if !defined(CAMERA_tx1)
                    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);
                    }
                    if (y*screen_height/viewport_height == (s+screen_width)/screen_width) {
                        memcpy(buf+s, buf+s-screen_width, screen_width);
                        s+=screen_width;

#else
                    for (x=0; x<screen_width-120; ++x, ++s, v+=3) {
                        buf[s]=(img_buf[v]>over)?cl_over:((img_buf[v]<conf.zebra_under)?cl_under:COLOR_TRANSPARENT);
                    }
                    if (y*screen_height/viewport_height == (s+screen_width-120)/screen_width-120) {
                        memcpy(buf+s, buf+s-(screen_width-120), screen_width-120);
                        s+=screen_width-120;

#endif

                    }
                }
            }
           
            gui_osd_draw_zebra_osd();
            memcpy(scr_buf, buf, screen_size);
            memcpy(scr_buf+screen_size, buf, screen_size);

            need_restore=1;
            return 1;
        }
    }
    return 0;
}
« Last Edit: 23 / April / 2008, 05:56:03 by GrAnd »


Re: TX1 Porting Completed
« Reply #34 on: 23 / April / 2008, 04:58:49 »
It has not inserted image at correct place and has struck-out valid lines of code.

Edit: Fixed by GrAnd   :)
« Last Edit: 23 / April / 2008, 05:15:46 by Microfunguy »

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #35 on: 23 / April / 2008, 05:42:04 »
Ok. We have two buffers:
* viewport
* bitmap

We need to determine correct dimensions in each case.


viewport
screen_width/height and buffer_width/height look equal here and it seems the height is not 271 (240?; 230?) because of red horizontal lines on the picture.

bitmap
screen_width = 360
screen_height = 240
buffer_width = 480
buffer_height = 271
« Last Edit: 23 / April / 2008, 05:55:02 by GrAnd »
CHDK Developer.

Re: TX1 Porting Completed
« Reply #36 on: 23 / April / 2008, 05:50:33 »
We have two buffers:
* viewport
* bitmap
We need to determine correct dimensions in each case.


We could use the layout editor to confirm size of bitmap buffer ?

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #37 on: 23 / April / 2008, 05:53:57 »
We could use the layout editor to confirm size of bitmap buffer ?
Yes, we could. Just drag a little icon/text (i.e. battery) to the bottom-right corner to see the max x/y positions.
Or you could to create a grid file rectangle with particular size to see if it fits the screen.

In addendum...
Buffer_sizes should be used in lowlevel drawing procedures:
draw_init() - for the calculation of the second buffer address;
draw_pixel() - for the calculation the offset;
buf and scr_buf variables in zebra-related functions.

In other cases the screen_sizes should be used.
CHDK Developer.


Re: TX1 Porting Completed
« Reply #38 on: 23 / April / 2008, 06:45:48 »
Just drag a little icon/text (i.e. battery) to the bottom-right corner to see the max x/y positions.


I have just remembered ......

a tester told me that certain text (such as 'RAW') that is normally at the right edge of the screen, was in fact off the screen and had to be dragged back on.


I will check.

Re: TX1 Porting Completed
« Reply #39 on: 23 / April / 2008, 14:11:04 »
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.
I will not change the zebra code at all for the TX1 and will ask the tester for a screenshot of what it looks like.


David

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal