Ignore:
Timestamp:
12/22/11 21:20:18 (17 months ago)
Author:
philmoz
Message:

Rework of viewport handling to cater for cameras with 480 pixel high viewports (default is 240). Previous solution pretended that the viewport was double width. This patch replaces it with a vertical scale factor instead. Added some comments on the viewport functions in platform.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platform/ixus310_elph500hs/lib.c

    r1430 r1499  
    8585long vid_get_bitmap_buffer_height() { return 270; } 
    8686 
    87 int vid_get_viewport_buffer_width() { return 960; }     // IXUS 310 - wide screen LCD (viewport is actually 480 high, CHDK not set up for this so we skip every 2nd row) 
     87// Physical width of viewport row in bytes 
     88int vid_get_viewport_byte_width() { 
     89        return 960 * 6 / 4;     // IXUS 310 - wide screen LCD is 960 pixels wide, each group of 4 pixels uses 6 bytes (UYVYYY) 
     90} 
     91 
     92// Y multiplier for cameras with 480 pixel high viewports (CHDK code assumes 240) 
     93int vid_get_viewport_yscale() { 
     94        return 2;               // IXUS 310 viewport is 480 pixels high 
     95} 
    8896 
    8997int vid_get_viewport_width() 
     
    104112 
    105113long vid_get_viewport_height(){ return 240; } 
    106  
    107 // viewport image offset - used when image size != viewport size (zebra, histogram, motion detect & edge overlay) 
    108 // returns the byte offset into the viewport buffer where the image pixels start (to skip any black borders) 
    109 int vid_get_viewport_image_offset() { 
    110         return vid_get_viewport_xoffset() * 3; 
    111 } 
    112  
    113 // viewport image offset - used when image size != viewport size (zebra, histogram, motion detect & edge overlay) 
    114 // returns the byte offset to skip at the end of a viewport buffer row to get to the next row. 
    115 int vid_get_viewport_row_offset() { 
    116         return (vid_get_viewport_buffer_width() - vid_get_viewport_width()) * 3; 
    117 } 
    118114 
    119115// Functions for PTP Live View system 
Note: See TracChangeset for help on using the changeset viewer.