fixed hardcoded viewer size
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user