y5gfunc.vfx.draw_2d¶
draw_2d
¶
Functions:
| Name | Description |
|---|---|
draw_line |
Draw a line on a video clip. |
draw_circle |
Draw a circle on a video clip. |
draw_ellipse |
Draw an ellipse on a video clip, defined by its two focal points. |
draw_bezier_curve |
Draw a cubic Bezier curve on a video clip. |
draw_mandelbrot_zoomer |
Draw a zooming animation into the Mandelbrot set. |
draw_spiral |
Draw a spiral on a video clip. |
draw_line
¶
draw_line(clip: VideoNode, sx: str, sy: str, ex: str, ey: str, thickness: str, color: str, factor: str = '1') -> VideoNode
Draw a line on a video clip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to draw the line on. |
required |
|
str
|
The x-coordinate of the start point. |
required |
|
str
|
The y-coordinate of the start point. |
required |
|
str
|
The x-coordinate of the end point. |
required |
|
str
|
The y-coordinate of the end point. |
required |
|
str
|
The thickness of the line. |
required |
|
str
|
The color of the line. |
required |
|
str
|
The factor of the line. |
'1'
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The video clip with the line drawn on it. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the format of the video clip has more than 1 plane. |
Source code in y5gfunc/vfx/draw_2d.py
draw_circle
¶
draw_circle(clip: VideoNode, cx: str, cy: str, radius: str, thickness: str, color: str, factor: str = '1') -> VideoNode
Draw a circle on a video clip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to draw the circle on. |
required |
|
str
|
The x-coordinate of the circle's center. |
required |
|
str
|
The y-coordinate of the circle's center. |
required |
|
str
|
The radius of the circle. |
required |
|
str
|
The thickness of the circle's line. |
required |
|
str
|
The color of the circle. |
required |
|
str
|
The blending factor for the color. |
'1'
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The video clip with the circle drawn on it. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the format of the video clip has more than 1 plane. |
Source code in y5gfunc/vfx/draw_2d.py
draw_ellipse
¶
draw_ellipse(clip: VideoNode, f1x: str, f1y: str, f2x: str, f2y: str, ellipse_sum: str, thickness: str, color: str, factor: str = '1') -> VideoNode
Draw an ellipse on a video clip, defined by its two focal points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to draw the ellipse on. |
required |
|
str
|
The x-coordinate of the first focal point. |
required |
|
str
|
The y-coordinate of the first focal point. |
required |
|
str
|
The x-coordinate of the second focal point. |
required |
|
str
|
The y-coordinate of the second focal point. |
required |
|
str
|
The sum of the distances from any point on the ellipse to the two focal points. |
required |
|
str
|
The thickness of the ellipse's line. |
required |
|
str
|
The color of the ellipse. |
required |
|
str
|
The blending factor for the color. |
'1'
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The video clip with the ellipse drawn on it. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the format of the video clip has more than 1 plane. |
Source code in y5gfunc/vfx/draw_2d.py
draw_bezier_curve
¶
draw_bezier_curve(clip: VideoNode, controlPoint0X: str, controlPoint0Y: str, controlPoint1X: str, controlPoint1Y: str, controlPoint2X: str, controlPoint2Y: str, controlPoint3X: str, controlPoint3Y: str, thickness: str, color: str, sample_count: int = 100, factor: str = '1') -> VideoNode
Draw a cubic Bezier curve on a video clip.
The curve is defined by four control points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to draw the curve on. |
required |
|
str
|
The x-coordinate of the first control point (start). |
required |
|
str
|
The y-coordinate of the first control point (start). |
required |
|
str
|
The x-coordinate of the second control point. |
required |
|
str
|
The y-coordinate of the second control point. |
required |
|
str
|
The x-coordinate of the third control point. |
required |
|
str
|
The y-coordinate of the third control point. |
required |
|
str
|
The x-coordinate of the fourth control point (end). |
required |
|
str
|
The y-coordinate of the fourth control point (end). |
required |
|
str
|
The thickness of the curve. |
required |
|
str
|
The color of the curve. |
required |
|
int
|
The number of line segments to approximate the curve. |
100
|
|
str
|
The blending factor for the color. |
'1'
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The video clip with the Bezier curve drawn on it. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If |
Source code in y5gfunc/vfx/draw_2d.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
draw_mandelbrot_zoomer
¶
draw_mandelbrot_zoomer(clip: VideoNode, centerX: str, centerY: str, color: str, initialZoom: str = '0.005', zoomSpeed: str = '0.01', centerMoveSpeed: str = '0.01', fractalC0_re: str = '-0.75', fractalC0_im: str = '0.1', fractalC1_re: str = '-0.743643887037158704', fractalC1_im: str = '0.131825904205311130', maxIter: int = 350, escapeRadius: str = '2') -> VideoNode
Draw a zooming animation into the Mandelbrot set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to draw on. |
required |
|
str
|
The x-coordinate for the center of the fractal on screen. |
required |
|
str
|
The y-coordinate for the center of the fractal on screen. |
required |
|
str
|
The base color for the fractal rendering. |
required |
|
str
|
The initial zoom level. |
'0.005'
|
|
str
|
The speed of zooming in. |
'0.01'
|
|
str
|
The speed at which the center of the view moves from C0 to C1. |
'0.01'
|
|
str
|
The real part of the starting complex number for the center. |
'-0.75'
|
|
str
|
The imaginary part of the starting complex number for the center. |
'0.1'
|
|
str
|
The real part of the ending complex number for the center. |
'-0.743643887037158704'
|
|
str
|
The imaginary part of the ending complex number for the center. |
'0.131825904205311130'
|
|
int
|
The maximum number of iterations for the Mandelbrot calculation. |
350
|
|
str
|
The escape radius for the Mandelbrot calculation. |
'2'
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The video clip with the Mandelbrot animation. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If |
Source code in y5gfunc/vfx/draw_2d.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
draw_spiral
¶
draw_spiral(clip: VideoNode, centerX: str, centerY: str, a: str, b: str, startAngle: str, endAngle: str, thickness: str, color: str, factor: str = '1', sample_count: int = 500) -> VideoNode
Draw a spiral on a video clip.
The spiral is defined by the equation r = a + b * theta.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to draw the spiral on. |
required |
|
str
|
The x-coordinate of the spiral's center. |
required |
|
str
|
The y-coordinate of the spiral's center. |
required |
|
str
|
The 'a' parameter in the spiral equation, affecting the starting radius. |
required |
|
str
|
The 'b' parameter in the spiral equation, affecting the distance between arms. |
required |
|
str
|
The starting angle of the spiral in radians. |
required |
|
str
|
The ending angle of the spiral in radians. |
required |
|
str
|
The thickness of the spiral line. |
required |
|
str
|
The color of the spiral. |
required |
|
str
|
The blending factor for the color. |
'1'
|
|
int
|
The number of line segments to approximate the spiral. |
500
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
The video clip with the spiral drawn on it. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the format of the video clip has more than 1 plane. |
Source code in y5gfunc/vfx/draw_2d.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |