| 479 | } |
| 480 | |
| 481 | void Keyframe::PrintValues(std::ostream* out) const { |
| 482 | // Column widths |
| 483 | std::vector<int> w{10, 12, 8, 11, 19}; |
| 484 | |
| 485 | *out << std::right << std::setfill(' ') << std::setprecision(4); |
| 486 | // Headings |
| 487 | *out << "│" |
| 488 | << std::setw(w[0]) << "Frame# (X)" << " │" |
| 489 | << std::setw(w[1]) << "Y Value" << " │" |
| 490 | << std::setw(w[2]) << "Delta Y" << " │ " |
| 491 | << std::setw(w[3]) << "Increasing?" << std::right |
| 492 | << "│\n"; |
| 493 | // Divider |
| 494 | *out << "├───────────" |
| 495 | << "┼─────────────" |
| 496 | << "┼─────────" |
| 497 | << "┼────────────┤\n"; |
| 498 | |
| 499 | for (int64_t i = 1; i <= GetLength(); ++i) { |
| 500 | *out << "│" |
| 501 | << std::setw(w[0]-2) << std::defaultfloat << i |
| 502 | << (Contains(Point(i, 1)) ? " *" : " ") << " │" |
| 503 | << std::setw(w[1]) << std::fixed << GetValue(i) << " │" |
| 504 | << std::setw(w[2]) << std::defaultfloat << std::showpos |
| 505 | << GetDelta(i) << " │ " << std::noshowpos |
| 506 | << std::setw(w[3]) |
| 507 | << (IsIncreasing(i) ? "true" : "false") << std::right << "│\n"; |
| 508 | } |
| 509 | *out << " * = Keyframe point (non-interpolated)\n"; |
| 510 | *out << std::flush; |
| 511 | } |
| 512 | |
| 513 | |
| 514 | // Scale all points by a percentage (good for evenly lengthening or shortening an openshot::Keyframe) |