footage: allow overriding YCbCr range

Fixes #1354
This commit is contained in:
itsmattkc
2022-08-08 12:49:50 -07:00
parent a3d6ecc4fd
commit 1ac205413c
23 changed files with 150 additions and 111 deletions
+4
View File
@@ -270,6 +270,7 @@ void VideoParams::set_defaults_for_footage()
premultiplied_alpha_ = false;
x_ = 0;
y_ = 0;
color_range_ = kColorRangeDefault;
}
void VideoParams::calculate_square_pixel_width()
@@ -374,6 +375,8 @@ void VideoParams::Load(QXmlStreamReader *reader)
set_premultiplied_alpha(reader->readElementText().toInt());
} else if (reader->name() == QStringLiteral("colorspace")) {
set_colorspace(reader->readElementText());
} else if (reader->name() == QStringLiteral("colorrange")) {
set_color_range(static_cast<ColorRange>(reader->readElementText().toInt()));
} else {
reader->skipCurrentElement();
}
@@ -401,6 +404,7 @@ void VideoParams::Save(QXmlStreamWriter *writer) const
writer->writeTextElement(QStringLiteral("duration"), QString::number(duration_));
writer->writeTextElement(QStringLiteral("premultipliedalpha"), QString::number(premultiplied_alpha_));
writer->writeTextElement(QStringLiteral("colorspace"), colorspace_);
writer->writeTextElement(QStringLiteral("colorrange"), QString::number(color_range_));
}
}