#include "automation.h"
#include "autos.h"
+#include "bccolors.h"
#include "bcsignals.h"
#include "canvas.h"
#include "clip.h"
keyboard_zoomout();
result = 1;
break;
- case 'f':
- unlock_window();
- canvas->use_fullscreen(canvas->get_fullscreen() ? 0 : 1);
- lock_window("CWindowGUI::keypress_event 1");
+ case 'f': {
+ int on = canvas->get_fullscreen() ? 0 : 1;
+ canvas->set_fullscreen(on, 1);
+ result = 1;
+ break; }
+ case ESC:
+ canvas->set_fullscreen(0, 1);
result = 1;
break;
case 'x':
lock_window("CWindowGUI::keypress_event 3");
result = 1;
break;
- case ESC:
- unlock_window();
- canvas->use_fullscreen(0);
- lock_window("CWindowGUI::keypress_event 4");
- result = 1;
- break;
case LEFT:
if( !ctrl_down() ) {
int alt_down = this->alt_down();
{
this->mwindow = mwindow;
this->gui = gui;
+ last_xscroll = 0;
+ last_yscroll = 0;
+ last_zoom = 0;
}
void CWindowCanvas::status_event()
mwindow->edl->session->cwindow_scrollbars = use_scrollbars;
}
-int CWindowCanvas::use_fullscreen(int on)
+int CWindowCanvas::set_fullscreen(int on, int unlock)
{
- if( Canvas::use_fullscreen(on) ) {
- gui->lock_window("CWindowCanvas::use_fullscreen");
- zoom_auto();
- if( !on ) gui->zoom_panel->update(0);
- gui->unlock_window();
+ int ret = 0;
+ if( on && !get_fullscreen() ) {
+ last_xscroll = get_xscroll();
+ last_yscroll = get_yscroll();
+ last_zoom = get_zoom();
+ Canvas::set_fullscreen(1, unlock);
+// zoom_auto();
+ ret = 1;
}
- return 1;
+ if( !on && get_fullscreen() ) {
+ Canvas::set_fullscreen(0, unlock);
+ gui->zoom_panel->update(get_zoom());
+ update_zoom(last_xscroll, last_yscroll, last_zoom);
+ gui->update_canvas();
+ ret = 1;
+ }
+ return ret;
}
int CWindowCanvas::get_xscroll()
gui->eyedrop_visible = 1;
}
-// Decompression coefficients straight out of jpeglib
-#define V_TO_R 1.40200
-#define V_TO_G -0.71414
-
-#define U_TO_G -0.34414
-#define U_TO_B 1.77200
-
-#define GET_COLOR(type, components, max, do_yuv) \
-{ \
+#define GET_COLOR(type, components, max, do_yuv) { \
type *row = (type*)(refresh_frame->get_rows()[i]) + \
j * components; \
float red = (float)*row++ / max; \
float green = (float)*row++ / max; \
float blue = (float)*row++ / max; \
if( do_yuv ) \
- { \
- float r = red + V_TO_R * (blue - 0.5); \
- float g = red + U_TO_G * (green - 0.5) + V_TO_G * (blue - 0.5); \
- float b = red + U_TO_B * (green - 0.5); \
- mwindow->edl->local_session->red += r; \
- mwindow->edl->local_session->green += g; \
- mwindow->edl->local_session->blue += b; \
- if( r > mwindow->edl->local_session->red_max ) mwindow->edl->local_session->red_max = r; \
- if( g > mwindow->edl->local_session->green_max ) mwindow->edl->local_session->green_max = g; \
- if( b > mwindow->edl->local_session->blue_max ) mwindow->edl->local_session->blue_max = b; \
- } \
- else \
- { \
- mwindow->edl->local_session->red += red; \
- mwindow->edl->local_session->green += green; \
- mwindow->edl->local_session->blue += blue; \
- if( red > mwindow->edl->local_session->red_max ) mwindow->edl->local_session->red_max = red; \
- if( green > mwindow->edl->local_session->green_max ) mwindow->edl->local_session->green_max = green; \
- if( blue > mwindow->edl->local_session->blue_max ) mwindow->edl->local_session->blue_max = blue; \
- } \
+ YUV::yuv.yuv_to_rgb_f(red, green, blue, red, green-0.5, blue-0.5); \
+ mwindow->edl->local_session->red += red; \
+ mwindow->edl->local_session->green += green; \
+ mwindow->edl->local_session->blue += blue; \
+ if( red > mwindow->edl->local_session->red_max ) mwindow->edl->local_session->red_max = red; \
+ if( green > mwindow->edl->local_session->green_max ) mwindow->edl->local_session->green_max = green; \
+ if( blue > mwindow->edl->local_session->blue_max ) mwindow->edl->local_session->blue_max = blue; \
}
-
-
mwindow->edl->local_session->red = 0;
mwindow->edl->local_session->green = 0;
mwindow->edl->local_session->blue = 0;
if( EQUIV(zoom, my_zoom_table[idx]) ) continue;
if( zoom < my_zoom_table[idx] ) break;
}
- zoom = idx < total_zooms ? my_zoom_table[idx] : 1.1 * zoom;
+ float zoom11 = 1.1f * zoom;
+ zoom = idx < total_zooms ? my_zoom_table[idx] : zoom11;
+ if( zoom > zoom11 ) zoom = zoom11;
break; }
case WHEEL_DOWN: {
int idx = total_zooms;
if( EQUIV(my_zoom_table[idx], zoom) ) continue;
if( my_zoom_table[idx] < zoom ) break;
}
- zoom = idx >= 0 ? my_zoom_table[idx] : 0.9 * zoom;
+ float zoom09 = 0.9f * zoom;
+ zoom = idx >= 0 ? my_zoom_table[idx] : zoom09;
+ if( zoom < zoom09 ) zoom = zoom09;
break; }
case MIDDLE_BUTTON:
if( gui->shift_down() ) {
break;
case CWINDOW_ZOOM:
- test_zoom(redraw);
+ result = test_zoom(redraw);
break;
case CWINDOW_CROP: