Cleanup: Subdiv: Remove common_ prefix
[blender.git] / source / blender / sequencer / SEQ_transform.hh
blob0cbd03503d3e1e6829cc01329cdbbad0a1fc044d
1 /* SPDX-FileCopyrightText: 2004 Blender Authors
3 * SPDX-License-Identifier: GPL-2.0-or-later */
5 #pragma once
7 /** \file
8 * \ingroup sequencer
9 */
11 #include "BLI_array.hh"
12 #include "BLI_math_matrix_types.hh"
13 #include "BLI_span.hh"
15 struct ListBase;
16 struct Scene;
17 struct Strip;
19 bool SEQ_transform_sequence_can_be_translated(const Strip *strip);
20 /**
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);
28 /**
29 * \return 0 if there weren't enough space.
31 bool SEQ_transform_seqbase_shuffle_ex(ListBase *seqbasep,
32 Strip *test,
33 Scene *evil_scene,
34 int channel_delta);
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,
38 ListBase *seqbasep,
39 Scene *evil_scene,
40 ListBase *markers,
41 bool use_sync_markers);
42 bool SEQ_transform_seqbase_shuffle_time(blender::Span<Strip *> strips_to_shuffle,
43 ListBase *seqbasep,
44 Scene *evil_scene,
45 ListBase *markers,
46 bool use_sync_markers);
48 void SEQ_transform_handle_overlap(Scene *scene,
49 ListBase *seqbasep,
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,
54 ListBase *seqbasep,
55 blender::Span<Strip *> transformed_strips,
56 bool use_sync_markers);
57 /**
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,
66 ListBase *seqbase,
67 int delta,
68 int timeline_frame);
70 /**
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]);
79 /**
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,
88 const Strip *strip,
89 float r_origin[2]);
90 /**
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,
100 const Strip *strip,
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,
110 const Strip *strip);
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,
127 bool apply_rotation,
128 float r_min[2],
129 float r_max[2]);
132 * Get strip image transformation matrix. Pivot point is set to correspond with viewport coordinate
133 * system
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);