hash the transition's progress

Since the transition progress directly affects the resulting image, it's
important to include it in the frame hash.
This commit is contained in:
itsmattkc
2020-01-06 17:25:38 +11:00
parent 8358d7d221
commit d3ed7f9863
3 changed files with 43 additions and 5 deletions
+24 -2
View File
@@ -42,12 +42,34 @@ void TransitionBlock::Retranslate()
rational TransitionBlock::in_offset() const
{
return 0;
// If no in block is connected, there's no in offset
if (!connected_in_block()) {
return 0;
}
if (!connected_out_block()) {
// Assume only an in block is connected, in which case this entire transition length
return length();
}
// Assume both are connected, in which case the in offset will be <= length
return length() / 2 + media_in();
}
rational TransitionBlock::out_offset() const
{
return 0;
// If no in block is connected, there's no in offset
if (!connected_out_block()) {
return 0;
}
if (!connected_in_block()) {
// Assume only an in block is connected, in which case this entire transition length
return length();
}
// Assume both are connected, in which case the in offset will be <= length
return length() / 2 - media_in();
}
Block *TransitionBlock::connected_out_block() const