Add output camera framing
This commit is contained in:
1 parent
616ced17ce
commit
23a66c6fdf
19 files changed
+1955
-43
No files matched your search
@@ -56,6 +56,37 @@ test('rejects invalid crf and preset', () => {
|
||||
assert.equal(validateRenderRequest(scene(), { preset: 'turbo' }).ok, false)
|
||||
})
|
||||
|
||||
test('validates enabled camera data', () => {
|
||||
const valid = validateRenderRequest(scene({
|
||||
camera: {
|
||||
enabled: true,
|
||||
base: { x: 0, y: 0, width: 320, height: 180 },
|
||||
keyframes: [{ time: 0.5, props: { x: 10 }, easing: 'linear' }],
|
||||
},
|
||||
}))
|
||||
assert.equal(valid.ok, true)
|
||||
|
||||
const invalidSize = validateRenderRequest(scene({
|
||||
camera: {
|
||||
enabled: true,
|
||||
base: { x: 0, y: 0, width: 0, height: 180 },
|
||||
keyframes: [],
|
||||
},
|
||||
}))
|
||||
assert.equal(invalidSize.ok, false)
|
||||
assert.match(invalidSize.error, /camera/)
|
||||
|
||||
const invalidKf = validateRenderRequest(scene({
|
||||
camera: {
|
||||
enabled: true,
|
||||
base: { x: 0, y: 0, width: 320, height: 180 },
|
||||
keyframes: [{ time: Number.NaN, props: {}, easing: 'linear' }],
|
||||
},
|
||||
}))
|
||||
assert.equal(invalidKf.ok, false)
|
||||
assert.match(invalidKf.error, /keyframe/)
|
||||
})
|
||||
|
||||
test('computes playback range from in/out or last keyframe', () => {
|
||||
assert.deepEqual(playbackRange(scene({ inTime: 0.25, outTime: 1.5 })), { start: 0.25, end: 1.5 })
|
||||
assert.deepEqual(playbackRange(scene()), { start: 0, end: 1 })
|
||||
|
||||
Reference in new issue
Block a user