#include "lib/dcpomatic_log.h"
#include "lib/image.h"
#include <dcp/util.h>
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/bind/bind.hpp>
{
_state_timer.set("paint-panel");
wxPaintDC dc (_panel);
+ auto scale = 1 / dpi_scale_factor (_panel);
+ dc.SetLogicalScale (scale, scale);
auto const panel_size = _panel->GetSize ();
if (!_image) {
dc.Clear ();
} else {
+ DCPOMATIC_ASSERT (_image->alignment() == Image::Alignment::COMPACT);
out_size = _image->size();
wxImage frame (out_size.width, out_size.height, _image->data()[0], true);
wxBitmap frame_bitmap (frame);
dc.DrawRectangle (subs->x * out_size.width, subs->y * out_size.height, subs->width * out_size.width, subs->height * out_size.height);
}
+ if (_viewer->crop_guess()) {
+ wxPen p (crop_guess_colour(), 2);
+ dc.SetPen (p);
+ dc.SetBrush (*wxTRANSPARENT_BRUSH);
+ auto const crop_guess = _viewer->crop_guess().get();
+ dc.DrawRectangle (
+ _inter_position.x + _inter_size.width * crop_guess.x,
+ _inter_position.y + _inter_size.height * crop_guess.y,
+ _inter_size.width * crop_guess.width,
+ _inter_size.height * crop_guess.height
+ );
+ }
+
_state_timer.unset();
}
SimpleVideoView::update ()
{
if (!player_video().first) {
- set_image (shared_ptr<Image>());
+ _image.reset ();
refresh_panel ();
return;
}
_state_timer.set ("get image");
- set_image (
- player_video().first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, true)
- );
+ _image = player_video().first->image(boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, true);
_state_timer.set ("ImageChanged");
_viewer->image_changed (player_video().first);