Files
hfut-bishe/client/core/animation/AnimationSampling.h
2026-04-07 20:55:30 +08:00

34 lines
1.2 KiB
C++

#pragma once
#include "domain/Project.h"
#include <QPointF>
#include <QString>
#include <QVector>
namespace core {
enum class KeyInterpolation { Hold, Linear };
// 关键帧按 frame 排序后使用;内部会对副本排序以保证稳健。
[[nodiscard]] QPointF sampleLocation(const QVector<Project::Entity::KeyframeVec2>& keys,
int frame,
const QPointF& fallbackOrigin,
KeyInterpolation mode);
[[nodiscard]] double sampleDepthScale01(const QVector<Project::Entity::KeyframeFloat01>& keys,
int frame,
double fallback01,
KeyInterpolation mode);
[[nodiscard]] double sampleUserScale(const QVector<Project::Entity::KeyframeDouble>& keys,
int frame,
double fallback,
KeyInterpolation mode);
[[nodiscard]] QString sampleImagePath(const QVector<Project::Entity::ImageFrame>& frames,
int frame,
const QString& fallbackPath);
} // namespace core