add pixel aspect ratio to nodeglobals
Turns our pixel aspect ratio is broken in various places. Will have to fix this at some point.
This commit is contained in:
+19
-2
@@ -30,16 +30,29 @@ namespace olive {
|
||||
class NodeGlobals
|
||||
{
|
||||
public:
|
||||
NodeGlobals(const QVector2D &resolution, const TimeRange &time) :
|
||||
NodeGlobals(const QVector2D &resolution, const rational &pixel_aspect, const TimeRange &time) :
|
||||
resolution_(resolution),
|
||||
pixel_aspect_(pixel_aspect),
|
||||
time_(time)
|
||||
{}
|
||||
{
|
||||
resolution_by_par_ = QVector2D(resolution_.x() * pixel_aspect_.toDouble(), resolution_.y());
|
||||
}
|
||||
|
||||
const QVector2D &resolution() const
|
||||
{
|
||||
return resolution_;
|
||||
}
|
||||
|
||||
const QVector2D &resolution_by_par() const
|
||||
{
|
||||
return resolution_by_par_;
|
||||
}
|
||||
|
||||
const rational &pixel_aspect() const
|
||||
{
|
||||
return pixel_aspect_;
|
||||
}
|
||||
|
||||
const TimeRange &time() const
|
||||
{
|
||||
return time_;
|
||||
@@ -53,6 +66,10 @@ public:
|
||||
private:
|
||||
QVector2D resolution_;
|
||||
|
||||
rational pixel_aspect_;
|
||||
|
||||
QVector2D resolution_by_par_;
|
||||
|
||||
TimeRange time_;
|
||||
|
||||
};
|
||||
|
||||
@@ -141,7 +141,7 @@ int NodeTraverser::GenerateRowValueElementIndex(const Node *node, const QString
|
||||
|
||||
NodeGlobals NodeTraverser::GenerateGlobals(const VideoParams ¶ms, const TimeRange &time)
|
||||
{
|
||||
return NodeGlobals(QVector2D(params.width(), params.height()), time);
|
||||
return NodeGlobals(QVector2D(params.width(), params.height()), params.pixel_aspect_ratio(), time);
|
||||
}
|
||||
|
||||
int NodeTraverser::GetChannelCountFromJob(const GenerateJob &job)
|
||||
|
||||
Reference in New Issue
Block a user