2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2004 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-12-19 06:44:57 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* \ingroup sequencer
|
|
|
|
*/
|
|
|
|
|
2021-01-04 02:03:34 +01:00
|
|
|
struct ListBase;
|
2020-12-19 06:44:57 +01:00
|
|
|
struct Scene;
|
2021-07-16 03:48:54 +02:00
|
|
|
struct Sequence;
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
bool SEQ_transform_sequence_can_be_translated(Sequence *seq);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Used so we can do a quick check for single image seq
|
|
|
|
* since they work a bit differently to normal image seq's (during transform).
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
bool SEQ_transform_single_image_check(Sequence *seq);
|
|
|
|
bool SEQ_transform_test_overlap(const Scene *scene, ListBase *seqbasep, Sequence *test);
|
|
|
|
bool SEQ_transform_test_overlap_seq_seq(const Scene *scene, Sequence *seq1, Sequence *seq2);
|
|
|
|
void SEQ_transform_translate_sequence(Scene *evil_scene, Sequence *seq, int delta);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* \return 0 if there weren't enough space.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
bool SEQ_transform_seqbase_shuffle_ex(ListBase *seqbasep,
|
|
|
|
Sequence *test,
|
|
|
|
Scene *evil_scene,
|
2020-12-19 06:44:57 +01:00
|
|
|
int channel_delta);
|
2024-01-04 21:07:48 +01:00
|
|
|
bool SEQ_transform_seqbase_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene);
|
2023-11-06 01:36:44 +01:00
|
|
|
bool SEQ_transform_seqbase_shuffle_time(blender::Span<Sequence *> strips_to_shuffle,
|
|
|
|
blender::Span<Sequence *> time_dependent_strips,
|
2024-01-04 21:07:48 +01:00
|
|
|
ListBase *seqbasep,
|
|
|
|
Scene *evil_scene,
|
|
|
|
ListBase *markers,
|
2023-11-06 01:36:44 +01:00
|
|
|
bool use_sync_markers);
|
|
|
|
bool SEQ_transform_seqbase_shuffle_time(blender::Span<Sequence *> strips_to_shuffle,
|
2024-01-04 21:07:48 +01:00
|
|
|
ListBase *seqbasep,
|
|
|
|
Scene *evil_scene,
|
|
|
|
ListBase *markers,
|
2022-01-07 01:38:08 +01:00
|
|
|
bool use_sync_markers);
|
2022-04-28 12:50:22 +02:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void SEQ_transform_handle_overlap(Scene *scene,
|
|
|
|
ListBase *seqbasep,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::Span<Sequence *> transformed_strips,
|
|
|
|
blender::Span<Sequence *> time_dependent_strips,
|
|
|
|
bool use_sync_markers);
|
2024-01-04 21:07:48 +01:00
|
|
|
void SEQ_transform_handle_overlap(Scene *scene,
|
|
|
|
ListBase *seqbasep,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::Span<Sequence *> transformed_strips,
|
2022-04-28 12:50:22 +02:00
|
|
|
bool use_sync_markers);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Check if the selected seq's reference unselected seq's.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
bool SEQ_transform_seqbase_isolated_sel_check(ListBase *seqbase);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Move strips and markers (if not locked) that start after timeline_frame by delta frames
|
|
|
|
*
|
|
|
|
* \param scene: Scene in which strips are located
|
|
|
|
* \param seqbase: ListBase in which strips are located
|
|
|
|
* \param delta: offset in frames to be applied
|
|
|
|
* \param timeline_frame: frame on timeline from where strips are moved
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_transform_offset_after_frame(Scene *scene,
|
|
|
|
ListBase *seqbase,
|
2022-01-07 01:38:08 +01:00
|
|
|
int delta,
|
|
|
|
int timeline_frame);
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2022-04-04 12:52:48 +02:00
|
|
|
/**
|
|
|
|
* Check if `seq` can be moved.
|
|
|
|
* This function also checks `SeqTimelineChannel` flag.
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
bool SEQ_transform_is_locked(ListBase *channels, Sequence *seq);
|
2022-04-04 12:52:48 +02:00
|
|
|
|
2021-09-21 09:38:30 +02:00
|
|
|
/* Image transformation. */
|
2021-12-08 11:02:29 +01:00
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_image_transform_mirror_factor_get(const Sequence *seq, float r_mirror[2]);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Get strip transform origin offset from image center
|
|
|
|
* NOTE: This function does not apply axis mirror.
|
|
|
|
*
|
|
|
|
* \param scene: Scene in which strips are located
|
|
|
|
* \param seq: Sequence to calculate image transform origin
|
|
|
|
* \param r_origin: return value
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_image_transform_origin_offset_pixelspace_get(const Scene *scene,
|
|
|
|
const Sequence *seq,
|
2021-09-21 09:38:30 +02:00
|
|
|
float r_origin[2]);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Get 4 corner points of strip image, optionally without rotation component applied.
|
|
|
|
* Corner vectors are in viewport space.
|
|
|
|
*
|
|
|
|
* \param scene: Scene in which strips are located
|
|
|
|
* \param seq: Sequence to calculate transformed image quad
|
|
|
|
* \param apply_rotation: Apply sequence rotation transform to the quad
|
|
|
|
* \param r_quad: array of 4 2D vectors
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_image_transform_quad_get(const Scene *scene,
|
|
|
|
const Sequence *seq,
|
2021-10-08 12:09:27 +02:00
|
|
|
bool apply_rotation,
|
|
|
|
float r_quad[4][2]);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Get 4 corner points of strip image. Corner vectors are in viewport space.
|
|
|
|
*
|
|
|
|
* \param scene: Scene in which strips are located
|
|
|
|
* \param seq: Sequence to calculate transformed image quad
|
|
|
|
* \param r_quad: array of 4 2D vectors
|
|
|
|
*/
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_image_transform_final_quad_get(const Scene *scene,
|
|
|
|
const Sequence *seq,
|
2021-09-21 09:38:30 +02:00
|
|
|
float r_quad[4][2]);
|
|
|
|
|
2023-11-03 09:05:31 +01:00
|
|
|
void SEQ_image_preview_unit_to_px(const Scene *scene, const float co_src[2], float co_dst[2]);
|
|
|
|
void SEQ_image_preview_unit_from_px(const Scene *scene, const float co_src[2], float co_dst[2]);
|
2021-10-07 03:32:04 +02:00
|
|
|
|
2022-04-21 00:38:39 +02:00
|
|
|
/**
|
|
|
|
* Get viewport axis aligned bounding box from a collection of sequences.
|
|
|
|
* The collection must have one or more strips
|
|
|
|
*
|
|
|
|
* \param scene: Scene in which strips are located
|
|
|
|
* \param strips: Collection of strips to get the bounding box from
|
|
|
|
* \param apply_rotation: Include sequence rotation transform in the bounding box calculation
|
|
|
|
* \param r_min: Minimum x and y values
|
|
|
|
* \param r_max: Maximum x and y values
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void SEQ_image_transform_bounding_box_from_collection(Scene *scene,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::Span<Sequence *> strips,
|
|
|
|
bool apply_rotation,
|
|
|
|
float r_min[2],
|
|
|
|
float r_max[2]);
|