Commit 1652eaee authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Raw backend: allow displaying raw previews without conflicting with LiveView info bars;

updated mlv_rec and mlv_lite to use this capability

--HG--
branch : raw_fixes
parent d5915d61349a
......@@ -2371,7 +2371,7 @@ static unsigned int raw_rec_update_preview(unsigned int ctx)
struct display_filter_buffers * buffers = (struct display_filter_buffers *) ctx;
raw_previewing = 1;
raw_set_preview_rect(skip_x, skip_y, res_x, res_y);
raw_set_preview_rect(skip_x, skip_y, res_x, res_y, 1);
raw_force_aspect_ratio_1to1();
raw_preview_fast_ex(
(void*)-1,
......
......@@ -4129,7 +4129,7 @@ static unsigned int raw_rec_update_preview(unsigned int ctx)
struct display_filter_buffers * buffers = (struct display_filter_buffers *) ctx;
raw_previewing = 1;
raw_set_preview_rect(skip_x, skip_y, res_x, res_y);
raw_set_preview_rect(skip_x, skip_y, res_x, res_y, 1);
raw_force_aspect_ratio_1to1();
raw_preview_fast_ex(
(void*)-1,
......
......@@ -931,7 +931,7 @@ static int preview_rect_y;
static int preview_rect_w;
static int preview_rect_h;
void raw_set_preview_rect(int x, int y, int w, int h)
void raw_set_preview_rect(int x, int y, int w, int h, int obey_info_bars)
{
preview_rect_x = x;
preview_rect_y = y;
......@@ -944,13 +944,17 @@ void raw_set_preview_rect(int x, int y, int w, int h)
/* not exactly a good idea when we have already acquired raw_sem */
//~ get_yuv422_vram(); // update vram parameters
/* fixme: handle different screen layouts */
int top_margin = (obey_info_bars) ? 38 : 0;
int bottom_margin = (obey_info_bars) ? 38 : 0;
/* scaling factor: raw width should match os.x_ex, same for raw height and os.y_ex */
lv2raw.sx = 1024 * w / BM2LV_DX(os.x_ex);
lv2raw.sy = 1024 * h / BM2LV_DY(os.y_ex);
lv2raw.sy = 1024 * h / BM2LV_DY(os.y_ex - top_margin - bottom_margin);
/* translation: raw top-left corner (x,y) should match (os.x0,os.y0) */
int x0_lv = BM2LV_X(os.x0);
int y0_lv = BM2LV_Y(os.y0);
int y0_lv = BM2LV_Y(os.y0 + top_margin);
lv2raw.tx = x - LV2RAW_DX(x0_lv);
lv2raw.ty = y - LV2RAW_DY(y0_lv);
}
......@@ -1023,7 +1027,7 @@ void raw_set_geometry(int width, int height, int skip_left, int skip_right, int
}
#endif
raw_set_preview_rect(preview_skip_left, preview_skip_top, preview_width, preview_height);
raw_set_preview_rect(preview_skip_left, preview_skip_top, preview_width, preview_height, 0);
dbg_printf("lv2raw sx:%d sy:%d tx:%d ty:%d\n", lv2raw.sx, lv2raw.sy, lv2raw.tx, lv2raw.ty);
dbg_printf("raw2lv test: (%d,%d) - (%d,%d)\n", RAW2LV_X(raw_info.active_area.x1), RAW2LV_Y(raw_info.active_area.y1), RAW2LV_X(raw_info.active_area.x2), RAW2LV_Y(raw_info.active_area.y2));
......
......@@ -144,7 +144,7 @@ int raw_lv_settings_still_valid();
void raw_set_geometry(int width, int height, int skip_left, int skip_right, int skip_top, int skip_bottom);
void raw_force_aspect_ratio_1to1();
void raw_set_preview_rect(int x, int y, int w, int h);
void raw_set_preview_rect(int x, int y, int w, int h, int obey_info_bars);
/* call this after you have altered the preview settings, and you want to restore the original ones */
void raw_set_dirty(void);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment