Changeset 1818


Ignore:
Timestamp:
04/22/12 05:19:11 (13 months ago)
Author:
reyalp
Message:

work in progress live view protocol changes
this is unfinished likely to change in incompatible ways
a540 includes fake variable aspect code for testing

Location:
branches/reyalp-ptp-live
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/reyalp-ptp-live/core/edgeoverlay.c

    r1720 r1818  
    7373    viewport_yscale = vid_get_viewport_yscale(); 
    7474 
    75         viewport_xoffset = vid_get_viewport_xoffset(); 
    76         viewport_yoffset = vid_get_viewport_yoffset(); 
     75        viewport_xoffset = vid_get_viewport_display_xoffset(); 
     76        viewport_yoffset = vid_get_viewport_display_yoffset(); 
    7777 
    7878    slice_height = viewport_height / EDGE_SLICES; 
     
    313313    int conv1, conv2; 
    314314 
    315     const int y_min = viewport_yoffset + camera_screen.edge_hmargin+ slice   *slice_height; 
    316     const int y_max = viewport_yoffset + camera_screen.edge_hmargin+(slice+1)*slice_height; 
    317     const int x_min = viewport_xoffset*3 + 6; 
    318     const int x_max = (viewport_width + viewport_xoffset - 2) * 3; 
     315    const int y_min = camera_screen.edge_hmargin+ slice   *slice_height; 
     316    const int y_max = camera_screen.edge_hmargin+(slice+1)*slice_height; 
     317    const int x_min = 6; 
     318    const int x_max = (viewport_width - 2) * 3; 
     319 
     320    img += vid_get_viewport_image_offset();             // offset into viewport for when image size != viewport size (e.g. 16:9 image on 4:3 LCD) 
    319321 
    320322    xoffset = 0; 
     
    410412            if (conv1 + conv2 > conf.edge_overlay_thresh) 
    411413            { 
    412                 bv_set(edgebuf, (y-viewport_yoffset-camera_screen.edge_hmargin)*viewport_width + xdiv3, 1); 
     414                bv_set(edgebuf, (y-camera_screen.edge_hmargin)*viewport_width + xdiv3, 1); 
    413415            } 
    414416 
     
    440442            if (conv1 + conv2 > conf.edge_overlay_thresh) 
    441443            { 
    442                 bv_set(edgebuf, (y-viewport_yoffset-camera_screen.edge_hmargin)*viewport_width + xdiv3+1, 1); 
     444                bv_set(edgebuf, (y-camera_screen.edge_hmargin)*viewport_width + xdiv3+1, 1); 
    443445            } 
    444446        }   // for x 
     
    516518 
    517519    const color cl = econf.edge_overlay_color; 
    518     const int y_slice_min = viewport_yoffset+camera_screen.edge_hmargin+ slice   *slice_height; 
    519     const int y_slice_max = viewport_yoffset+camera_screen.edge_hmargin+(slice+1)*slice_height; 
    520     const int y_min = viewport_yoffset+camera_screen.edge_hmargin; 
    521     const int y_max = viewport_yoffset+camera_screen.edge_hmargin+viewport_height; 
    522     const int x_min = viewport_xoffset+2; 
    523     const int x_max = (viewport_width + viewport_xoffset - 2); 
     520    const int y_slice_min = camera_screen.edge_hmargin+ slice   *slice_height; 
     521    const int y_slice_max = camera_screen.edge_hmargin+(slice+1)*slice_height; 
     522    const int y_min = camera_screen.edge_hmargin; 
     523    const int y_max = camera_screen.edge_hmargin+viewport_height; 
     524    const int x_min = 2; 
     525    const int x_max = (viewport_width - 2); 
    524526 
    525527    if( !is_buffer_ready() ) return 0; 
     
    544546                    // If there is no edge based on the newest data, but there is one painted on the screen 
    545547                    // from previous calls, delete it from the screen. 
    546                     const int aspect_correct_x_off = x_off; 
    547548                    const int bEdge = bv_get(edgebuf, y_edgebuf + x); 
    548                     const int bDraw = bEdge || (draw_get_pixel(aspect_correct_x_off, y_off) == econf.edge_overlay_color); 
     549                    const int bDraw = bEdge || (draw_get_pixel(x_off+viewport_xoffset, y_off+viewport_yoffset) == econf.edge_overlay_color); 
    549550                    const color cl = bEdge ? econf.edge_overlay_color : 0; 
    550551                    if (bEdge || bDraw) 
    551                         draw_pixel(aspect_correct_x_off, y_off, cl); 
     552                        draw_pixel(x_off+viewport_xoffset, y_off+viewport_yoffset, cl); 
    552553                     
    553554                } 
     
    572573            for (x = x_min_c; x < x_max_c; ++x) 
    573574            { 
    574                 const int aspect_correct_x = x; 
    575                 if (draw_get_pixel(aspect_correct_x, y) == cl)  // if there is an edge drawn on the screen but there is no edge there based on the newest data, delete it from the screen 
    576                     draw_pixel(aspect_correct_x, y, 0 ); 
     575                // if there is an edge drawn on the screen but there is no edge there based on the newest data, delete it from the screen 
     576                if (draw_get_pixel(x+viewport_xoffset, y+viewport_yoffset) == cl) 
     577                    draw_pixel(x+viewport_xoffset, y+viewport_yoffset, 0 ); 
    577578            } 
    578579        } 
     
    590591            for (x = x_min; x < x_max; ++x) 
    591592            { 
    592                 const int aspect_correct_x = x; 
    593                 if (draw_get_pixel(aspect_correct_x, y) == cl)  // if there is an edge drawn on the screen but there is no edge there based on the newest data, delete it from the screen 
    594                     draw_pixel(aspect_correct_x, y, 0 ); 
     593                // if there is an edge drawn on the screen but there is no edge there based on the newest data, delete it from the screen 
     594                if (draw_get_pixel(x+viewport_xoffset, y+viewport_yoffset) == cl) 
     595                    draw_pixel(x+viewport_xoffset, y+viewport_yoffset, 0 ); 
    595596            } 
    596597        } 
     
    632633 
    633634 
    634  
    635635// Main edge overlay function. 
    636636// It works by detecting edges using the Sobel operator 
  • branches/reyalp-ptp-live/core/live_view.c

    r1707 r1818  
    128128} 
    129129 
     130int live_view_get_data(ptp_data *data, int flags) { 
     131    lv_data_header lv; 
     132    lv.lcd_aspect_ratio    = vid_get_aspect_ratio(); 
     133 
     134    lv.vp.logical_width = vid_get_viewport_logical_width(); 
     135    lv.vp.logical_height = vid_get_viewport_logical_height(); 
     136 
     137    lv.vp.buffer_width = vid_get_viewport_buffer_width_proper(); 
     138    // TODO will go away, always the same as visible 
     139    lv.vp.buffer_height = vid_get_viewport_height_proper(); 
     140 
     141    // TODO 
     142    lv.vp.buffer_logical_xoffset = vid_get_viewport_display_xoffset_proper(); 
     143    lv.vp.buffer_logical_yoffset = vid_get_viewport_display_yoffset_proper(); 
     144 
     145    lv.vp.visible_width = vid_get_viewport_width_proper(); 
     146    lv.vp.visible_height = vid_get_viewport_height_proper(); 
     147 
     148    // TODO these will go away 
     149    lv.vp.visible_buffer_xoffset = 0; 
     150    lv.vp.visible_buffer_yoffset = 0; 
     151 
     152    lv.bm.logical_width = ASPECT_XCORRECTION(camera_screen.width); 
     153    lv.bm.logical_height = camera_screen.height; 
     154 
     155    lv.bm.buffer_width = camera_screen.buffer_width; 
     156    // TODO will go away 
     157    lv.bm.buffer_height = camera_screen.height; 
     158 
     159    lv.bm.buffer_logical_xoffset = 0; 
     160    lv.bm.buffer_logical_yoffset = 0; 
     161 
     162    lv.bm.visible_width = lv.bm.logical_width; 
     163    lv.bm.visible_height = lv.bm.logical_height; 
     164    // 
     165    // TODO will go away 
     166    lv.bm.visible_buffer_xoffset = 0; 
     167    lv.bm.visible_buffer_yoffset = 0; 
     168 
     169    lv.palette_type = vid_get_palette_type(); 
     170 
     171    lv.vp.data_start = 0; 
     172    lv.bm.data_start = 0; 
     173    lv.palette_data_start = 0; 
     174 
     175    int total_size = sizeof(lv); 
     176    int vp_size = 0,bm_size = 0,pal_size = 0; 
     177 
     178    void *vp = vid_get_viewport_active_buffer(); 
     179    // Add viewport details if requested, and not null 
     180    if ( flags & LV_TFR_VIEWPORT && vp) // live buffer 
     181    { 
     182        lv.vp.data_start = total_size; 
     183        vp_size = (lv.vp.buffer_width*lv.vp.visible_height*6)/4; 
     184        total_size += vp_size; 
     185        // offset to start of actual data 
     186        vp += vid_get_viewport_image_offset(); 
     187    } 
     188 
     189    // Add bitmap details if requested 
     190    if ( flags & LV_TFR_BITMAP ) // bitmap buffer 
     191    { 
     192        lv.bm.data_start = total_size; 
     193        bm_size = camera_screen.buffer_width*camera_screen.buffer_height; 
     194        total_size += bm_size; 
     195    } 
     196 
     197    // Add palette detals if requested and available 
     198    if ( flags & LV_TFR_PALETTE && vid_get_palette_size() ) // bitmap palette 
     199    { 
     200        lv.palette_data_start = total_size; 
     201        total_size += vid_get_palette_size(); 
     202    } 
     203 
     204    // Send header structure (along with total size to be sent) 
     205    data->send_data(data->handle,(char*)&lv,sizeof(lv),total_size,0,0,0); 
     206 
     207    // Send viewport data if requested 
     208    if ( flags & LV_TFR_VIEWPORT && vp_size) 
     209    { 
     210        data->send_data(data->handle,vp,vp_size,0,0,0,0); 
     211    } 
     212 
     213    // Send bitmap data if requested 
     214    if ( flags & LV_TFR_BITMAP ) 
     215    { 
     216        data->send_data(data->handle,vid_get_bitmap_active_buffer(),bm_size,0,0,0,0); 
     217    } 
     218 
     219    // Send palette data if requested 
     220    // don't try to send zero sized palette data, since palette type is theoretically variable, 
     221    // doesn't make sense for clients to check before requesting 
     222    if ( (flags & LV_TFR_PALETTE) && vid_get_palette_size() ) 
     223    { 
     224        data->send_data(data->handle,vid_get_bitmap_active_palette(),vid_get_palette_size(),0,0,0,0); 
     225    } 
     226 
     227    return total_size; 
     228} 
    130229#endif 
  • branches/reyalp-ptp-live/core/live_view.h

    r1669 r1818  
    4343} lv_vid_info; 
    4444 
     45enum lv_aspect_rato { 
     46    LV_ASPECT_4_3, 
     47    LV_ASPECT_16_9, 
     48}; 
     49 
     50typedef struct { 
     51    /* 
     52    logical screen 
     53    descibes how big the buffer would be in pixels, if it exactly filled the physical screen 
     54    may be larger or smaller than the buffer data, due to letter boxing or unused data 
     55    using lcd_aspect_ratio, you can create a correct representation of the screen 
     56    */ 
     57    int logical_width;   
     58    int logical_height; 
     59    /* 
     60    buffer - describes the actual data sent 
     61    data size is always buffer_width*buffer_height*(buffer bpp implied by type) 
     62    offsets represent the position of the data on the logical screen, 
     63       > 0 for sub images (16:9 on a 4:3 screen, stitch window, etc) 
     64    */ 
     65    int buffer_width; 
     66    // TODO will go away 
     67    int buffer_height; 
     68 
     69    int buffer_logical_xoffset; 
     70    int buffer_logical_yoffset; 
     71 
     72    /* 
     73    visible - describes data within the buffer which contains image data to be displayed 
     74    offsets are relative to buffer 
     75    width must be <= logical_width - buffer_logical_xoffset and width + xoffset must be <= buffer_width  
     76    */ 
     77    int visible_width; 
     78    int visible_height; 
     79    // TODO these will go away 
     80    int visible_buffer_xoffset; 
     81    int visible_buffer_yoffset; 
     82    int data_start;    // offset of data 
     83} lv_framebuffer_desc; 
     84 
     85typedef struct { 
     86    int lcd_aspect_ratio; // physical aspect ratio of LCD 
     87    int palette_type; 
     88    int palette_data_start; 
     89    lv_framebuffer_desc vp; // viewport 
     90    lv_framebuffer_desc bm; // bitmap 
     91} lv_data_header; 
     92 
    4593#ifdef CAM_CHDK_PTP 
    4694extern int live_view_data_handler(ptp_data *data, int flags, int arg2); 
     95extern int live_view_get_data(ptp_data *data, int flags); 
    4796#endif 
    4897 
  • branches/reyalp-ptp-live/core/module_exportlist.c

    r1720 r1818  
    212212                        vid_get_viewport_width, 
    213213            vid_get_viewport_byte_width, 
    214             vid_get_viewport_xoffset, 
    215             vid_get_viewport_yoffset, 
     214            vid_get_viewport_display_xoffset, 
     215            vid_get_viewport_display_yoffset, 
    216216            vid_get_viewport_image_offset, 
    217217            vid_get_viewport_row_offset, 
  • branches/reyalp-ptp-live/core/motion_detector.c

    r1711 r1818  
    553553        } 
    554554 
    555         xoffset = vid_get_viewport_xoffset();   // used when image size != viewport size 
    556         yoffset = vid_get_viewport_yoffset();   // used when image size != viewport size 
     555        xoffset = vid_get_viewport_display_xoffset();   // used when image size != viewport size 
     556        yoffset = vid_get_viewport_display_yoffset();   // used when image size != viewport size 
    557557 
    558558        x_step=(camera_screen.width-xoffset*2)/motion_detector->columns; 
  • branches/reyalp-ptp-live/core/ptp.c

    r1711 r1818  
    641641        break; 
    642642 
     643    case PTP_CHDK_GetLiveData: 
     644        ptp.num_param = 1; 
     645        ptp.param1 = live_view_get_data(data,param2); 
     646        break; 
     647 
    643648    default: 
    644649      ptp.code = PTP_RC_ParameterNotSupported; 
  • branches/reyalp-ptp-live/core/ptp.h

    r1669 r1818  
    7373                            //   param3 & param4 = parameters to pass to handler function 
    7474                            //   output param1 = return value from handler function 
     75  PTP_CHDK_GetLiveData,     // TODO TEMP TEST 
     76                            //  param2 bitmask of data 
     77                            //  output param1 = total size of data 
    7578}; 
    7679 
  • branches/reyalp-ptp-live/core/zebra.c

    r1621 r1818  
    8686// and image aspect ratio provided the vid_get_viewport_height(),  
    8787// vid_get_viewport_width(), vid_get_viewport_image_offset(), 
    88 // vid_get_viewport_row_offset(), vid_get_viewport_xoffset(), 
    89 // and vid_get_viewport_yoffset() functions have been correctly 
     88// vid_get_viewport_row_offset(), vid_get_viewport_display_xoffset(), 
     89// and vid_get_viewport_display_yoffset() functions have been correctly 
    9090// implemented for the camera. 
    9191 
     
    304304    viewport_image_offset = vid_get_viewport_image_offset();  
    305305    viewport_row_offset = vid_get_viewport_row_offset();  
    306     viewport_xoffset = vid_get_viewport_xoffset(); 
    307     viewport_yoffset = vid_get_viewport_yoffset(); 
     306    viewport_xoffset = vid_get_viewport_display_xoffset(); 
     307    viewport_yoffset = vid_get_viewport_display_yoffset(); 
    308308 
    309309    // if not in no-zebra phase of blink mode zebra, draw zebra to buf[] 
  • branches/reyalp-ptp-live/include/platform.h

    r1711 r1818  
    230230extern long vid_get_viewport_height();          // Viewport height in CHDK screen pixels  
    231231extern int vid_get_viewport_width();            // Viewport width in CHDK screen pixels 
    232 extern int vid_get_viewport_xoffset();          // X offset of viewport edge relative to LCD screen (in CHDK screen pixels) 
    233 extern int vid_get_viewport_yoffset();          // Y offset of viewport top relative to LCD screen (in CHDK screen pixels) 
     232extern int vid_get_viewport_xoffset();          // X offset of viewport edge relative to the viewport buffer (in CHDK screen pixels) 
     233extern int vid_get_viewport_yoffset();          // Y offset of viewport top relative to the viewport buffer (in CHDK screen pixels) 
     234extern int vid_get_viewport_display_xoffset();  // X offset of viewport edge relative to LCD screen (in CHDK screen pixels) 
     235extern int vid_get_viewport_display_yoffset();  // Y offset of viewport top relative to LCD screen (in CHDK screen pixels) 
    234236extern int vid_get_viewport_byte_width();       // Physical width of viewport row in bytes 
    235237extern int vid_get_viewport_yscale();           // Y multiplier for cameras with 480 pixel high viewports (CHDK code assumes 240) 
     
    242244extern int vid_get_viewport_xoffset_proper();           // X Offset (for variable image size) 
    243245extern int vid_get_viewport_yoffset_proper();           // Y Offset (for variable image size) 
     246extern int vid_get_viewport_display_xoffset_proper();   // X Offset (for variable image size) 
     247extern int vid_get_viewport_display_yoffset_proper();   // Y Offset (for variable image size) 
    244248extern int vid_get_viewport_width_proper();             // Visible viewport width (for variable image size) 
    245249extern int vid_get_viewport_height_proper();            // Visible viewport height (for variable image size) 
    246250extern int vid_get_viewport_max_width();                // Max visible viewport width in pixels 
    247251extern int vid_get_viewport_max_height();               // Max visible viewport height in pixels 
     252extern int vid_get_viewport_logical_width(); 
     253extern int vid_get_viewport_logical_height(); 
    248254extern int vid_get_viewport_buffer_width_proper();      // Physical viewport buffer width in pixels 
    249255extern int vid_get_palette_type();                      // Palette type (0 - 3) 
  • branches/reyalp-ptp-live/platform/a540/sub/100b/lib.c

    r1708 r1818  
    127127    return (void*)(*(int*)0x5ED0); // FFD23420 DisplayPhysicalScreenWithYUVPalette 
    128128} 
    129 #if 0 
     129#if 1 
    130130int vid_get_viewport_max_height()               { return 528; } // in 640x480 movie mode 
    131131// this returns actual width in rec mode 
     
    134134// in 320 video 352, 1:1. In stitch 352, 1:2 
    135135int vid_get_viewport_width_proper() { 
     136    // fake 1:1 mode 
     137    if((mode_get()&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
     138        return 528; 
     139    } 
    136140    return ((mode_get()&MODE_MASK) == MODE_PLAY)?704:*(int*)0x32C68; 
    137141} 
    138142int vid_get_viewport_height_proper() { 
     143    // fake 16:9 mode 
     144    if((mode_get()&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
     145        return 180;  
     146    } 
    139147    return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x32C68+4); 
    140148} 
    141149#endif 
     150int vid_get_viewport_logical_height() { 
     151    // except for stitch, always full screen 
     152    int m = mode_get(); 
     153    if((m&MODE_MASK) != MODE_PLAY && ((m&MODE_SHOOTING_MASK) == MODE_STITCH || (m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE)) { 
     154        return 240; 
     155    } 
     156    return vid_get_viewport_height_proper(); 
     157} 
     158int vid_get_viewport_logical_width() { 
     159    // except for stitch, always full screen 
     160    int m = mode_get(); 
     161    if((m&MODE_MASK) != MODE_PLAY && ((m&MODE_SHOOTING_MASK) == MODE_STITCH || (m&MODE_SHOOTING_MASK) == MODE_PORTRAIT)) { 
     162        return 704; 
     163    } 
     164    return vid_get_viewport_width_proper(); 
     165} 
     166int vid_get_viewport_display_xoffset_proper() { 
     167    int val=0; 
     168    int m = mode_get(); 
     169    if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) { 
     170        short dir=0; 
     171        short seq=0; 
     172        get_property_case(PROPCASE_STITCH_DIRECTION,&dir,sizeof(dir)); 
     173        get_property_case(PROPCASE_STITCH_SEQUENCE,&seq,sizeof(seq)); 
     174        // overall stitch window is 3/4 screen width, centered 
     175        // live part is 1/2, so margin is either 1/8th or 3/8th 
     176        if(dir==0) { 
     177            val = seq?264:88; 
     178        } else { 
     179            val = seq?88:264; 
     180        } 
     181    } else if((m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
     182        val = 88; 
     183    } 
     184    return val; 
     185} 
     186int vid_get_viewport_xoffset() { 
     187    if((mode_get()&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
     188       return 88; 
     189    } 
     190    return 0; 
     191} 
     192int vid_get_viewport_display_yoffset_proper() { 
     193    int m = mode_get(); 
     194    if((m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
     195       return 30; 
     196    } 
     197    return ((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0; // window is 120, centered in 240 screen 
     198} 
     199int vid_get_viewport_yoffset() { 
     200    if((mode_get()&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
     201       return 30; 
     202    } 
     203    return 0; 
     204} 
  • branches/reyalp-ptp-live/platform/d10/sub/100a/lib.c

    r1709 r1818  
    7575// commented for now, protocol changes needed to handle correctly, values look correct 
    7676// both are 0 or last record value in playback mode 
    77 #if 0 
     77#if 1 
    7878// goes to 360 for stitch, 320x240 video, max digital zoom 
    7979int vid_get_viewport_width_proper() {  
     
    8585} 
    8686#endif 
     87int vid_get_viewport_logical_height() { 
     88    // except for stitch, always full screen 
     89    int m = mode_get(); 
     90    if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_SCN_STITCH) { 
     91        return 240; 
     92    } 
     93    return vid_get_viewport_height_proper(); 
     94} 
     95int vid_get_viewport_logical_width() { 
     96    // except for stitch, always full screen 
     97    int m = mode_get(); 
     98    if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_SCN_STITCH) { 
     99        return 720; 
     100    } 
     101    return vid_get_viewport_width_proper(); 
     102} 
     103int vid_get_viewport_display_xoffset_proper() { 
     104    int val=0; 
     105    int m = mode_get(); 
     106    if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_SCN_STITCH) { 
     107        short dir=0; 
     108        short seq=0; 
     109        get_property_case(PROPCASE_STITCH_DIRECTION,&dir,sizeof(dir)); 
     110        get_property_case(PROPCASE_STITCH_SEQUENCE,&seq,sizeof(seq)); 
     111        // overall stitch window is 3/4 screen width, centered 
     112        // live part is 1/2, so margin is either 1/8th or 3/8th 
     113        if(dir==0) { 
     114            val = seq?270:90; 
     115        } else { 
     116            val = seq?90:270; 
     117        } 
     118    } 
     119    return val; 
     120} 
     121int vid_get_viewport_display_yoffset_proper() { 
     122    int m = mode_get(); 
     123    return ((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_SCN_STITCH)?60:0; // window is 120, centered in 240 screen 
     124} 
  • branches/reyalp-ptp-live/platform/g12/lib.c

    r1527 r1818  
    7777void *vid_get_viewport_live_fb() 
    7878{ 
     79    if (MODE_IS_VIDEO(mode_get())) 
     80        return viewport_buffers[0];     // Video only seems to use the first viewport buffer. 
     81 
    7982    // Hopefully return the most recently used viewport buffer so that motion detect, histogram, zebra and edge overly are using current image data 
    8083    return viewport_buffers[(active_viewport_buffer-1)&3]; 
     
    98101int vid_get_viewport_width() 
    99102{ 
    100         // viewport width table for each image size 
    101         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    102         static long vp_w[5] = { 360, 360, 360, 272, 216 }; 
    103         return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     103    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     104    { 
     105        return 180; 
     106    } 
     107    else 
     108    { 
     109            // viewport width table for each image size 
     110            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     111            static long vp_w[5] = { 360, 360, 360, 272, 216 }; 
     112            return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     113    } 
    104114} 
    105115 
    106116int vid_get_viewport_xoffset() 
    107117{ 
    108         // viewport width offset table for each image size 
    109         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    110         static long vp_w[5] = { 0, 0, 0, 44, 72 };                              // should all be even values for edge overlay 
    111         return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     118    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     119    { 
     120        return 0; 
     121    } 
     122    else 
     123    { 
     124            // viewport width offset table for each image size 
     125            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     126            static long vp_w[5] = { 0, 0, 0, 44, 72 };                          // should all be even values for edge overlay 
     127            return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     128    } 
     129} 
     130 
     131int vid_get_viewport_display_xoffset() 
     132{ 
     133    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     134    { 
     135        if (shooting_get_prop(PROPCASE_STITCH_DIRECTION) == 0)      // Direction check 
     136            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     137                return 40; 
     138            else 
     139                return 140; 
     140        else 
     141            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     142                return 140; 
     143            else 
     144                return 40; 
     145    } 
     146    else 
     147    { 
     148        return vid_get_viewport_xoffset(); 
     149    } 
    112150} 
    113151 
    114152long vid_get_viewport_height() 
    115153{ 
    116         // viewport height table for each image size 
    117         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    118         static long vp_h[5] = { 240, 180, 214, 240, 240 }; 
    119         return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     154    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     155    { 
     156        return 120; 
     157    } 
     158    else 
     159    { 
     160            // viewport height table for each image size 
     161            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     162            static long vp_h[5] = { 240, 180, 214, 240, 240 }; 
     163            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     164    } 
    120165} 
    121166 
    122167int vid_get_viewport_yoffset() 
    123168{ 
    124         // viewport height offset table for each image size 
    125         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    126         static long vp_h[5] = { 0, 30, 13, 0, 0 }; 
    127         return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     169    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     170    { 
     171        return 0; 
     172    } 
     173    else 
     174    { 
     175            // viewport height offset table for each image size 
     176            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     177            static long vp_h[5] = { 0, 30, 13, 0, 0 }; 
     178            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     179    } 
     180} 
     181 
     182int vid_get_viewport_display_yoffset() 
     183{ 
     184    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     185    { 
     186        return 72; 
     187    } 
     188    else 
     189    { 
     190        return vid_get_viewport_yoffset(); 
     191    } 
    128192} 
    129193 
     
    132196int vid_get_viewport_xoffset_proper()           { return vid_get_viewport_xoffset() * 2; } 
    133197int vid_get_viewport_yoffset_proper()           { return vid_get_viewport_yoffset() * 2; } 
     198int vid_get_viewport_display_xoffset_proper()   { return vid_get_viewport_display_xoffset() * 2; } 
     199int vid_get_viewport_display_yoffset_proper()   { return vid_get_viewport_display_yoffset() * 2; } 
    134200int vid_get_viewport_width_proper()             { return vid_get_viewport_width() * 2; } 
    135201int vid_get_viewport_height_proper()            { return vid_get_viewport_height() * 2; } 
  • branches/reyalp-ptp-live/platform/g1x/lib.c

    r1810 r1818  
    7676void *vid_get_viewport_live_fb() 
    7777{ 
     78    if (MODE_IS_VIDEO(mode_get()) || (movie_status==VIDEO_RECORD_IN_PROGRESS)) 
     79        return viewport_buffers[0];     // Video only seems to use the first viewport buffer. 
     80 
    7881    // Hopefully return the most recently used viewport buffer so that motion detect, histogram, zebra and edge overly are using current image data 
    7982    return viewport_buffers[(active_viewport_buffer-1)&3]; 
     
    97100int vid_get_viewport_width() 
    98101{ 
    99         // viewport width table for each image size 
    100         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    101         static long vp_w[5] = { 360, 360, 360, 272, 216 }; 
    102         return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
    103 } 
    104  
    105 int vid_get_viewport_xoffset() 
    106 { 
    107         // viewport width offset table for each image size 
    108         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    109         static long vp_w[5] = { 0, 0, 0, 44, 72 };                              // should all be even values for edge overlay 
    110         return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     102    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     103    { 
     104        return 180; 
     105    } 
     106    else 
     107    { 
     108            // viewport width table for each image size 
     109            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     110            static long vp_w[5] = { 360, 360, 360, 272, 216 }; 
     111            return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     112    } 
     113} 
     114 
     115int vid_get_viewport_display_xoffset() 
     116{ 
     117    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     118    { 
     119        if (shooting_get_prop(PROPCASE_STITCH_DIRECTION) == 0)      // Direction check 
     120            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     121                return 40; 
     122            else 
     123                return 140; 
     124        else 
     125            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     126                return 140; 
     127            else 
     128                return 40; 
     129    } 
     130    else 
     131    { 
     132            // viewport width offset table for each image size 
     133            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     134            static long vp_w[5] = { 0, 0, 0, 44, 72 };                          // should all be even values for edge overlay 
     135            return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     136    } 
    111137} 
    112138 
    113139long vid_get_viewport_height() 
    114140{ 
    115         // viewport height table for each image size 
    116         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    117         static long vp_h[5] = { 240, 180, 214, 240, 240 }; 
    118         return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     141    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     142    { 
     143        return 120; 
     144    } 
     145    else 
     146    { 
     147            // viewport height table for each image size 
     148            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     149            static long vp_h[5] = { 240, 180, 214, 240, 240 }; 
     150            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     151    } 
    119152} 
    120153 
    121154int vid_get_viewport_yoffset() 
    122155{ 
    123         // viewport height offset table for each image size 
    124         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
    125         static long vp_h[5] = { 0, 30, 13, 0, 0 }; 
    126         return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     156    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     157    { 
     158        return 0; 
     159    } 
     160    else 
     161    { 
     162            // viewport height offset table for each image size 
     163            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     164            static long vp_h[5] = { 0, 30, 13, 0, 0 }; 
     165            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     166    } 
     167} 
     168 
     169int vid_get_viewport_display_yoffset() 
     170{ 
     171    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     172    { 
     173        return 72; 
     174    } 
     175    else 
     176    { 
     177            // viewport width offset table for each image size 
     178            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5 
     179            static long vp_h[5] = { 0, 30, 13, 0, 0 }; 
     180            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     181    } 
    127182} 
    128183 
    129184// Functions for PTP Live View system 
    130185 
    131 int vid_get_viewport_xoffset_proper()           { return vid_get_viewport_xoffset() * 2; } 
    132 int vid_get_viewport_yoffset_proper()           { return vid_get_viewport_yoffset(); } 
     186int vid_get_viewport_yoffset_proper()           { return vid_get_viewport_yoffset() * 2; } 
     187int vid_get_viewport_display_xoffset_proper()   { return vid_get_viewport_display_xoffset() * 2; } 
     188int vid_get_viewport_display_yoffset_proper()   { return vid_get_viewport_display_yoffset() * 2; } 
    133189int vid_get_viewport_width_proper()             { return vid_get_viewport_width() * 2; } 
    134190int vid_get_viewport_height_proper()            { return vid_get_viewport_height() * 2; } 
  • branches/reyalp-ptp-live/platform/g1x/platform_camera.h

    r1810 r1818  
    129129 
    130130    #undef  CAMERA_MIN_DIST 
    131     #define CAMERA_MIN_DIST                     95      // Override min subject distance 
     131    #define CAMERA_MIN_DIST                     275     // Override min subject distance 
    132132    #undef  CAMERA_MAX_DIST 
    133     #define CAMERA_MAX_DIST                     9523810 // Override max subject distance 
     133    #define CAMERA_MAX_DIST                     660067 // Override max subject distance 
    134134//---------------------------------------------------------- 
  • branches/reyalp-ptp-live/platform/g1x/sub/100f/capt_seq.c

    r1810 r1818  
    33#include "core.h" 
    44 
    5 static long *nrflag = (long*)(0xC3F8+0x0);  // in sub_FF29E03C @ FF29E26C & FF29E2F4 
     5static long *nrflag = (long*)(0xCEAC+0x4);  // in sub_FF2A76A8 @ FF2A77DC & FF2A78E4 
    66#define NR_AUTO (0)                                                     // have to explictly reset value back to 0 to enable auto 
    77#define PAUSE_FOR_FILE_COUNTER 150          // Enable delay in capt_seq_hook_raw_here to ensure file counter is updated 
  • branches/reyalp-ptp-live/platform/generic/wrappers.c

    r1711 r1818  
    13631363} 
    13641364 
     1365// viewport display x offset - used when image size != viewport size (zebra, histogram, motion detect & edge overlay) 
     1366int __attribute__((weak)) vid_get_viewport_display_xoffset() { 
     1367        return vid_get_viewport_xoffset(); 
     1368} 
     1369 
     1370// viewport display y offset - used when image size != viewport size (zebra, histogram, motion detect & edge overlay) 
     1371int __attribute__((weak)) vid_get_viewport_display_yoffset() { 
     1372        return vid_get_viewport_yoffset(); 
     1373} 
     1374 
    13651375// viewport image offset - used when image size != viewport size (zebra, histogram, motion detect & edge overlay) 
    13661376// returns the byte offset into the viewport buffer where the image pixels start (to skip any black borders) 
     
    14881498// Override as needed for camera specific variations (see G12/SX30/IXUS310/SX130IS for working examples) 
    14891499 
    1490 int __attribute__((weak)) vid_get_viewport_xoffset_proper()         { return 0; } 
    1491 int __attribute__((weak)) vid_get_viewport_yoffset_proper()         { return 0; } 
     1500int __attribute__((weak)) vid_get_viewport_xoffset_proper()         { return vid_get_viewport_xoffset(); } 
     1501int __attribute__((weak)) vid_get_viewport_yoffset_proper()         { return vid_get_viewport_yoffset(); } 
     1502int __attribute__((weak)) vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); } 
     1503int __attribute__((weak)) vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); } 
    14921504int __attribute__((weak)) vid_get_viewport_width_proper()           { return 720; } 
    14931505int __attribute__((weak)) vid_get_viewport_height_proper()          { return 240; } 
     
    14951507int __attribute__((weak)) vid_get_viewport_max_height()             { return 240; } 
    14961508int __attribute__((weak)) vid_get_viewport_buffer_width_proper()    { return vid_get_viewport_max_width(); } 
     1509int __attribute__((weak)) vid_get_viewport_logical_width()          { return vid_get_viewport_max_width(); } 
     1510int __attribute__((weak)) vid_get_viewport_logical_height()         { return vid_get_viewport_max_height(); } 
    14971511int __attribute__((weak)) vid_get_palette_type()                    { return 0; }       // 0 = no palette into, 1 = 16 x 4 byte AYUV values,  
    14981512                                                                                        // 2 = 16 x 4 byte AYUV (A = 0..3), 3 = 256 x 4 byte AYUV (A = 0..3) 
  • branches/reyalp-ptp-live/platform/ixus310_elph500hs/lib.c

    r1744 r1818  
    6060    // Return first viewport buffer - for case when vid_get_viewport_live_fb not defined 
    6161    // Offset the return value because the viewport is left justified instead of centered on this camera 
    62     return viewport_buffers[0] - vid_get_viewport_xoffset()*3; 
     62    return viewport_buffers[0]; 
    6363} 
    6464 
    6565void *vid_get_viewport_live_fb() 
    6666{ 
     67    if (MODE_IS_VIDEO(mode_get()) || (movie_status==VIDEO_RECORD_IN_PROGRESS)) 
     68        return viewport_buffers[0];     // Video only seems to use the first viewport buffer. 
     69 
    6770    // Hopefully return the most recently used viewport buffer so that motion detect, histogram, zebra and edge overly are using current image data 
    6871    // Offset the return value because the viewport is left justified instead of centered on this camera 
    69     return viewport_buffers[(active_viewport_buffer-1)&3] - vid_get_viewport_xoffset()*3; 
     72    return viewport_buffers[(active_viewport_buffer-1)&3]; 
    7073} 
    7174 
     
    98101} 
    99102 
    100 int vid_get_viewport_xoffset() 
     103int vid_get_viewport_display_xoffset() 
    101104{ 
    102105        // viewport width offset table for each image size 
     
    110113// Functions for PTP Live View system 
    111114 
    112 int vid_get_viewport_xoffset_proper()           { return vid_get_viewport_xoffset() * 2; } 
    113115int vid_get_viewport_width_proper()             { return vid_get_viewport_width() * 2; } 
     116int vid_get_viewport_display_xoffset_proper()   { return vid_get_viewport_display_xoffset() * 2; } 
    114117int vid_get_viewport_height_proper()            { return 480; } 
    115118int vid_get_viewport_max_width()                { return 960; } 
  • branches/reyalp-ptp-live/platform/sx30/lib.c

    r1527 r1818  
    7373void *vid_get_viewport_live_fb() 
    7474{ 
     75    if (MODE_IS_VIDEO(mode_get()) || (movie_status==VIDEO_RECORD_IN_PROGRESS)) 
     76        return viewport_buffers[0];     // Video only seems to use the first viewport buffer. 
     77 
    7578    // Hopefully return the most recently used viewport buffer so that motion detect, histogram, zebra and edge overly are using current image data 
    7679    return viewport_buffers[(active_viewport_buffer-1)&3]; 
     
    8790} 
    8891 
     92int vid_get_viewport_width() 
     93{ 
     94    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     95    { 
     96        return 180; 
     97    } 
     98    else 
     99    { 
     100        return 360; 
     101    } 
     102} 
     103 
     104int vid_get_viewport_display_xoffset() 
     105{ 
     106    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     107    { 
     108        if (shooting_get_prop(PROPCASE_STITCH_DIRECTION) == 0)      // Direction check 
     109            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     110                return 40; 
     111            else 
     112                return 140; 
     113        else 
     114            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     115                return 140; 
     116            else 
     117                return 40; 
     118    } 
     119    else 
     120    { 
     121        return 0; 
     122    } 
     123} 
     124 
    89125long vid_get_viewport_height() 
    90126{ 
    91         if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)      // Wide screen top & bottom 30 pixels not used in viewport 
     127    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     128    { 
     129        return 120; 
     130    } 
     131    else if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)     // Wide screen top & bottom 30 pixels not used in viewport 
    92132                return 180; 
    93133        return 240; 
     
    96136int vid_get_viewport_yoffset() 
    97137{ 
    98         if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)      // Wide screen top & bottom 30 pixels not used in viewport 
     138    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     139    { 
     140        return 0; 
     141    } 
     142    else if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)     // Wide screen top & bottom 30 pixels not used in viewport 
    99143                return 30; 
    100144        return 0; 
    101145} 
    102146 
     147int vid_get_viewport_display_yoffset() 
     148{ 
     149    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16908) // Stitch mode 
     150    { 
     151        return 72; 
     152    } 
     153    else 
     154    { 
     155        return vid_get_viewport_yoffset(); 
     156    } 
     157} 
     158 
    103159// Functions for PTP Live View system 
    104160 
    105 int vid_get_viewport_yoffset_proper()           { return vid_get_viewport_yoffset(); } 
     161int vid_get_viewport_display_xoffset_proper()   { return vid_get_viewport_display_xoffset() * 2; } 
    106162int vid_get_viewport_height_proper()            { return vid_get_viewport_height(); } 
    107163int vid_get_palette_type()                      { return 3; } 
  • branches/reyalp-ptp-live/platform/sx40hs/lib.c

    r1527 r1818  
    7474void *vid_get_viewport_live_fb() 
    7575{ 
     76    if (MODE_IS_VIDEO(mode_get()) || (movie_status==VIDEO_RECORD_IN_PROGRESS)) 
     77        return viewport_buffers[0];     // Video only seems to use the first viewport buffer. 
     78 
    7679    // Hopefully return the most recently used viewport buffer so that motion detect, histogram, zebra and edge overly are using current image data 
    7780    return viewport_buffers[(active_viewport_buffer-1)&3]; 
     
    9093int vid_get_viewport_width() 
    9194{ 
    92         // viewport width table for each image size 
    93         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
    94         static long vp_w[5] = { 360, 360, 360, 272 }; 
    95         return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     95    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     96    { 
     97        return 180; 
     98    } 
     99    else 
     100    { 
     101            // viewport width table for each image size 
     102            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
     103            static long vp_w[5] = { 360, 360, 360, 272 }; 
     104            return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     105    } 
    96106} 
    97107 
    98108int vid_get_viewport_xoffset() 
    99109{ 
    100         // viewport width offset table for each image size 
    101         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
    102         static long vp_w[5] = { 0, 0, 0, 44 };                          // should all be even values for edge overlay 
    103         return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     110    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     111    { 
     112        return 0; 
     113    } 
     114    else 
     115    { 
     116            // viewport width offset table for each image size 
     117            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
     118            static long vp_w[5] = { 0, 0, 0, 44 };                              // should all be even values for edge overlay 
     119            return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     120    } 
     121} 
     122 
     123int vid_get_viewport_display_xoffset() 
     124{ 
     125    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     126    { 
     127        if (shooting_get_prop(PROPCASE_STITCH_DIRECTION) == 0)      // Direction check 
     128            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     129                return 40; 
     130            else 
     131                return 140; 
     132        else 
     133            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken? 
     134                return 140; 
     135            else 
     136                return 40; 
     137    } 
     138    else 
     139    { 
     140        return vid_get_viewport_xoffset(); 
     141    } 
    104142} 
    105143 
    106144long vid_get_viewport_height() 
    107145{ 
    108         // viewport height table for each image size 
    109         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
    110         static long vp_h[5] = { 240, 180, 214, 240 }; 
    111         return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     146    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     147    { 
     148        return 120; 
     149    } 
     150    else 
     151    { 
     152            // viewport height table for each image size 
     153            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
     154            static long vp_h[5] = { 240, 180, 214, 240 }; 
     155            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     156    } 
    112157} 
    113158 
    114159int vid_get_viewport_yoffset() 
    115160{ 
    116         // viewport height offset table for each image size 
    117         // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
    118         static long vp_h[5] = { 0, 30, 13, 0 }; 
    119         return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     161    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     162    { 
     163        return 0; 
     164    } 
     165    else 
     166    { 
     167            // viewport height offset table for each image size 
     168            // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1 
     169            static long vp_h[5] = { 0, 30, 13, 0 }; 
     170            return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)]; 
     171    } 
     172} 
     173 
     174int vid_get_viewport_display_yoffset() 
     175{ 
     176    if (shooting_get_prop(PROPCASE_SHOOTING_MODE) == 16909) // Stitch mode 
     177    { 
     178        return 72; 
     179    } 
     180    else 
     181    { 
     182        return vid_get_viewport_yoffset(); 
     183    } 
    120184} 
    121185 
     
    123187 
    124188int vid_get_viewport_xoffset_proper()           { return vid_get_viewport_xoffset() * 2; } 
    125 int vid_get_viewport_yoffset_proper()           { return vid_get_viewport_yoffset(); } 
     189int vid_get_viewport_display_xoffset_proper()   { return vid_get_viewport_display_xoffset() * 2; } 
    126190int vid_get_viewport_width_proper()             { return vid_get_viewport_width() * 2; } 
    127191int vid_get_viewport_height_proper()            { return vid_get_viewport_height(); } 
Note: See TracChangeset for help on using the changeset viewer.