fixed hardcoded viewer size

This commit is contained in:
itsmattkc
2019-09-27 03:51:08 +10:00
parent 9806c772ac
commit 150afb6ebc
6 changed files with 61 additions and 13 deletions
+21 -1
View File
@@ -20,7 +20,9 @@
#include "viewer.h"
ViewerOutput::ViewerOutput()
ViewerOutput::ViewerOutput() :
viewer_width_(0),
viewer_height_(0)
{
texture_input_ = new NodeInput("tex_out");
texture_input_->add_data_input(NodeInput::kTexture);
@@ -78,6 +80,24 @@ void ViewerOutput::InvalidateCache(const rational &start_range, const rational &
SendInvalidateCache(start_range, end_range);
}
void ViewerOutput::SetViewerSize(const int &width, const int &height)
{
viewer_width_ = width;
viewer_height_ = height;
emit SizeChanged(viewer_width_, viewer_height_);
}
const int &ViewerOutput::ViewerWidth()
{
return viewer_width_;
}
const int &ViewerOutput::ViewerHeight()
{
return viewer_height_;
}
QVariant ViewerOutput::Value(NodeOutput *output, const rational &time)
{
Q_UNUSED(output)
+11
View File
@@ -49,11 +49,18 @@ public:
virtual void InvalidateCache(const rational &start_range, const rational &end_range, NodeInput *from = nullptr) override;
void SetViewerSize(const int& width, const int& height);
const int& ViewerWidth();
const int& ViewerHeight();
signals:
void TimebaseChanged(const rational&);
void TextureChangedBetween(const rational&, const rational&);
void SizeChanged(int width, int height);
protected:
virtual QVariant Value(NodeOutput* output, const rational& time) override;
@@ -62,6 +69,10 @@ private:
rational timebase_;
int viewer_width_;
int viewer_height_;
};
#endif // VIEWER_H