y5gfunc.vfx.misc¶
misc
¶
Classes:
| Name | Description |
|---|---|
ZoomMode |
Controls the zoom behavior of |
Functions:
| Name | Description |
|---|---|
rotate_image |
Rotate a video clip |
ZoomMode
¶
Bases: IntEnum
Controls the zoom behavior of rotate_image function
Attributes:
| Name | Type | Description |
|---|---|---|
NO_ZOOM |
Rotate the clip without any scaling; missing border pixels will be interpolated |
|
ZOOM_TO_FIT |
Dynamically scale the clip to ensure the entire image fits within the frame, thus avoids additional interpolation on the borders |
|
CONSTANT_MAX_ZOOM |
Use a constant scaling factor based on a 45° rotation to prevent dynamic changes during rotation |
rotate_image
¶
rotate_image(clip: VideoNode, angle_degrees: str, zoom: ZoomMode = NO_ZOOM, bicubic_b: str = '1 / 3', bicubic_c: str = '1 / 3', center_x: str = '$width / 2', center_y: str = '$height / 2') -> VideoNode
Rotate a video clip
This function rotates the given video clip by an angle specified in degrees. The rotation is performed around a defined center point and uses bicubic interpolation for resampling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The source video clip to rotate. |
required |
|
str
|
The rotation angle in degrees, can be an expression to evaluate in run-time. |
required |
|
ZoomMode
|
The zoom mode to apply. |
NO_ZOOM
|
|
str
|
The 'b' parameter for bicubic interpolation. |
'1 / 3'
|
|
str
|
The 'c' parameter for bicubic interpolation. |
'1 / 3'
|
|
str
|
The x-coordinate of the rotation center, can be an expression to evaluate in run-time |
'$width / 2'
|
|
str
|
The y-coordinate of the rotation center, can be an expression to evaluate in run-time |
'$height / 2'
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The rotated video clip. |
Source code in y5gfunc/vfx/misc.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |