4 // Note: used in modules and platform independent code.
5 // Do not add platform dependent stuff in here (#ifdef/#endif compile options or camera dependent values)
9 - Unless otherwise specified, all structure values are packed in camera native (little
11 - Frame buffer and palette data are in native camera formats
12 Some documentation may be found at http://chdk.wikia.com/wiki/Frame_buffers
13 - The frame buffer descriptions returned may not be correct depending on the
14 camera model and various camera settings (shooting mode, digital zoom, aspect ratio)
15 This may result in partial images, garbage in the "valid" area or incorrect position
16 - In some cases, the requested data may not be available. If this happens, the framebuffer
17 or palette data offset will be zero.
18 - The frame buffer descriptions are returned regardless of whether the data is available
20 // Live View protocol version
21 #define LIVE_VIEW_VERSION_MAJOR 2 // increase only with backwards incompatible changes (and reset minor)
22 #define LIVE_VIEW_VERSION_MINOR 1 // increase with extensions of functionality
25 protocol version history
26 < 2.0 - development versions
27 2.0 - initial release, chdk 1.1
28 2.1 - added palette type 4 - 16 entry VUYA, 2 bit alpha
32 // Control flags for determining which data block to transfer
33 #define LV_TFR_VIEWPORT 0x01
34 #define LV_TFR_BITMAP 0x04
35 #define LV_TFR_PALETTE 0x08
44 additional values will be added if new data formats appear
47 LV_FB_YUV8, // 8 bit per element UYVYYY, used for live view
48 LV_FB_PAL8, // 8 bit paletted, used for bitmap overlay. Note palette data and type sent separately
52 framebuffer data description
53 NOTE YUV pixels widths are based on the number of Y elements
56 int fb_type; // framebuffer type - note future versions might use different structures depending on type
57 int data_start; // offset of data from start of live view header
59 buffer width in pixels
60 data size is always buffer_width*visible_height*(buffer bpp based on type)
64 visible size in pixels
65 describes data within the buffer which contains image data to be displayed
66 any offsets within buffer data are added before sending, so the top left
67 pixel is always the first first byte of data.
68 width must always be <= buffer_width
69 if buffer_width is > width, the additional data should be skipped
70 visible_height also defines the number of data rows
77 pixels offsets needed to replicate display position on cameras screen
78 not used for any buffer offsets
85 } lv_framebuffer_desc;
88 // live view sub-protocol version
91 int lcd_aspect_ratio; // physical aspect ratio of LCD
93 int palette_data_start;
94 // framebuffer descriptions are given as offsets, to allow expanding the structures in minor protocol changes
99 #endif // __LIVE_VIEW_H