1 /* SPDX-FileCopyrightText: 2004 Blender Authors
3 * SPDX-License-Identifier: GPL-2.0-or-later */
11 #include "BLI_array.hh"
12 #include "BLI_math_matrix_types.hh"
13 #include "BLI_span.hh"
19 bool SEQ_transform_sequence_can_be_translated(const Strip
*strip
);
21 * Used so we can do a quick check for single image seq
22 * since they work a bit differently to normal image seq's (during transform).
24 bool SEQ_transform_single_image_check(const Strip
*strip
);
25 bool SEQ_transform_test_overlap(const Scene
*scene
, ListBase
*seqbasep
, Strip
*test
);
26 bool SEQ_transform_test_overlap_seq_seq(const Scene
*scene
, Strip
*seq1
, Strip
*seq2
);
27 void SEQ_transform_translate_sequence(Scene
*evil_scene
, Strip
*strip
, int delta
);
29 * \return 0 if there weren't enough space.
31 bool SEQ_transform_seqbase_shuffle_ex(ListBase
*seqbasep
,
35 bool SEQ_transform_seqbase_shuffle(ListBase
*seqbasep
, Strip
*test
, Scene
*evil_scene
);
36 bool SEQ_transform_seqbase_shuffle_time(blender::Span
<Strip
*> strips_to_shuffle
,
37 blender::Span
<Strip
*> time_dependent_strips
,
41 bool use_sync_markers
);
42 bool SEQ_transform_seqbase_shuffle_time(blender::Span
<Strip
*> strips_to_shuffle
,
46 bool use_sync_markers
);
48 void SEQ_transform_handle_overlap(Scene
*scene
,
50 blender::Span
<Strip
*> transformed_strips
,
51 blender::Span
<Strip
*> time_dependent_strips
,
52 bool use_sync_markers
);
53 void SEQ_transform_handle_overlap(Scene
*scene
,
55 blender::Span
<Strip
*> transformed_strips
,
56 bool use_sync_markers
);
58 * Move strips and markers (if not locked) that start after timeline_frame by delta frames
60 * \param scene: Scene in which strips are located
61 * \param seqbase: ListBase in which strips are located
62 * \param delta: offset in frames to be applied
63 * \param timeline_frame: frame on timeline from where strips are moved
65 void SEQ_transform_offset_after_frame(Scene
*scene
,
71 * Check if `seq` can be moved.
72 * This function also checks `SeqTimelineChannel` flag.
74 bool SEQ_transform_is_locked(ListBase
*channels
, const Strip
*strip
);
76 /* Image transformation. */
78 void SEQ_image_transform_mirror_factor_get(const Strip
*strip
, float r_mirror
[2]);
80 * Get strip transform origin offset from image center
81 * NOTE: This function does not apply axis mirror.
83 * \param scene: Scene in which strips are located
84 * \param seq: Sequence to calculate image transform origin
85 * \param r_origin: return value
87 void SEQ_image_transform_origin_offset_pixelspace_get(const Scene
*scene
,
91 * Get 4 corner points of strip image, optionally without rotation component applied.
92 * Corner vectors are in viewport space.
94 * \param scene: Scene in which strips are located
95 * \param seq: Sequence to calculate transformed image quad
96 * \param apply_rotation: Apply sequence rotation transform to the quad
97 * \return array of 4 2D vectors
99 blender::Array
<blender::float2
> SEQ_image_transform_quad_get(const Scene
*scene
,
101 bool apply_rotation
);
103 * Get 4 corner points of strip image. Corner vectors are in viewport space.
105 * \param scene: Scene in which strips are located
106 * \param seq: Sequence to calculate transformed image quad
107 * \return array of 4 2D vectors
109 blender::Array
<blender::float2
> SEQ_image_transform_final_quad_get(const Scene
*scene
,
112 void SEQ_image_preview_unit_to_px(const Scene
*scene
, const float co_src
[2], float co_dst
[2]);
113 void SEQ_image_preview_unit_from_px(const Scene
*scene
, const float co_src
[2], float co_dst
[2]);
116 * Get viewport axis aligned bounding box from a collection of sequences.
117 * The collection must have one or more strips
119 * \param scene: Scene in which strips are located
120 * \param strips: Collection of strips to get the bounding box from
121 * \param apply_rotation: Include sequence rotation transform in the bounding box calculation
122 * \param r_min: Minimum x and y values
123 * \param r_max: Maximum x and y values
125 void SEQ_image_transform_bounding_box_from_collection(Scene
*scene
,
126 blender::Span
<Strip
*> strips
,
132 * Get strip image transformation matrix. Pivot point is set to correspond with viewport coordinate
135 * \param scene: Scene in which strips are located
136 * \param seq: Strip that is used to construct the matrix
138 blender::float4x4
SEQ_image_transform_matrix_get(const Scene
*scene
, const Strip
*strip
);