Changeset 1871


Ignore:
Timestamp:
05/28/12 21:42:36 (13 months ago)
Author:
reyalp
Message:

express live view data in terms of margins rather than "logical" screen - note structures changed, requires corresponding update to client

Location:
branches/reyalp-ptp-live/core
Files:
2 edited

Legend:

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

    r1837 r1871  
    1313    lv.version_minor = LIVE_VIEW_VERSION_MINOR; 
    1414 
    15     lv.lcd_aspect_ratio    = vid_get_aspect_ratio(); 
    16  
    17     lv.vp.logical_width = vid_get_viewport_fullscreen_width(); 
    18     lv.vp.logical_height = vid_get_viewport_fullscreen_height(); 
     15    lv.lcd_aspect_ratio = vid_get_aspect_ratio(); 
    1916 
    2017    lv.vp.buffer_width = vid_get_viewport_buffer_width_proper(); 
    21  
    22     // TODO 
    23     lv.vp.buffer_logical_xoffset = vid_get_viewport_display_xoffset_proper(); 
    24     lv.vp.buffer_logical_yoffset = vid_get_viewport_display_yoffset_proper(); 
    2518 
    2619    lv.vp.visible_width = vid_get_viewport_width_proper(); 
    2720    lv.vp.visible_height = vid_get_viewport_height_proper(); 
    2821 
    29     lv.bm.logical_width = ASPECT_XCORRECTION(camera_screen.width); 
    30     lv.bm.logical_height = camera_screen.height; 
     22    lv.vp.margin_left = vid_get_viewport_display_xoffset_proper(); 
     23    lv.vp.margin_top = vid_get_viewport_display_yoffset_proper(); 
     24 
     25    // TODO returning margins from lib.c might be better 
     26    // can end up with negative if size and offset sources don't update at exactly the same time 
     27    lv.vp.margin_right = vid_get_viewport_fullscreen_width() - lv.vp.visible_width - lv.vp.margin_left; 
     28    lv.vp.margin_bot = vid_get_viewport_fullscreen_height() - lv.vp.visible_height - lv.vp.margin_top; 
    3129 
    3230    lv.bm.buffer_width = camera_screen.buffer_width; 
    3331 
    34     lv.bm.buffer_logical_xoffset = 0; 
    35     lv.bm.buffer_logical_yoffset = 0; 
     32    lv.bm.margin_left = 0; 
     33    lv.bm.margin_top = 0; 
     34    lv.bm.margin_right = 0; 
     35    lv.bm.margin_bot = 0; 
    3636 
    37     lv.bm.visible_width = lv.bm.logical_width; 
    38     lv.bm.visible_height = lv.bm.logical_height; 
     37    lv.bm.visible_width = ASPECT_XCORRECTION(camera_screen.width); 
     38    lv.bm.visible_height = camera_screen.height; 
    3939 
    4040    lv.palette_type = vid_get_palette_type(); 
  • branches/reyalp-ptp-live/core/live_view.h

    r1831 r1871  
    1717 
    1818typedef struct { 
     19    int data_start; // offset of data from start of live view header 
    1920    /* 
    20     logical screen 
    21     descibes how big the buffer would be in pixels, if it exactly filled the physical screen 
    22     may be larger or smaller than the buffer data, due to letter boxing or unused data 
    23     using lcd_aspect_ratio, you can create a correct representation of the screen 
    24     */ 
    25     int logical_width;   
    26     int logical_height; 
    27     /* 
    28     buffer - describes the actual data sent 
    29     data size is always buffer_width*buffer_height*(buffer bpp implied by type) 
    30     offsets represent the position of the data on the logical screen, 
    31        > 0 for sub images (16:9 on a 4:3 screen, stitch window, etc) 
     21    buffer width in pixels 
     22    data size is always buffer_width*visible_height*(buffer bpp implied by type) 
    3223    */ 
    3324    int buffer_width; 
    34  
    35     int buffer_logical_xoffset; 
    36     int buffer_logical_yoffset; 
    37  
    3825    /* 
    39     visible - describes data within the buffer which contains image data to be displayed 
    40     offsets are relative to buffer 
    41     width must be <= logical_width - buffer_logical_xoffset and width + xoffset must be <= buffer_width  
     26    visible size in pixels 
     27    describes data within the buffer which contains image data to be displayed 
     28    any offsets within buffer data are added before sending, so the top left 
     29    pixel is always the first first byte of data. 
     30    width must always be <= buffer_width 
     31    if buffer_width is > width, the additional data should be skipped 
     32    visible_height also defines the number of data rows 
    4233    */ 
    4334    int visible_width; 
    4435    int visible_height; 
    4536 
    46     int data_start;    // offset of data 
     37    /* 
     38    margins 
     39    pixels offsets needed to replicate display position on cameras screen 
     40    not used for any buffer offsets 
     41    */ 
     42    int margin_left; 
     43    int margin_top; 
     44 
     45    int margin_right; 
     46    int margin_bot; 
    4747} lv_framebuffer_desc; 
    4848 
Note: See TracChangeset for help on using the changeset viewer.