yta-video-opengl 0.0.26__tar.gz → 0.0.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/PKG-INFO +1 -1
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/pyproject.toml +1 -1
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/effects.py +44 -2
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/__init__.py +2 -2
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/LICENSE +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/README.md +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/__init__.py +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/audio/__init__.py +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/video/__init__.py +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/video/opengl/__init__.py +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/video/opengl/experimental.py +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/tests.py +0 -0
- {yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/utils.py +0 -0
@@ -1,7 +1,9 @@
|
|
1
1
|
from yta_video_opengl.nodes.video.opengl import WavingNode
|
2
2
|
from yta_video_opengl.nodes.audio import ChorusNode
|
3
3
|
from yta_video_opengl.nodes import TimedNode
|
4
|
+
from yta_video_opengl.utils import texture_to_frame
|
4
5
|
from yta_validation.parameter import ParameterValidator
|
6
|
+
from yta_validation import PythonValidator
|
5
7
|
from yta_programming.decorators import singleton_old
|
6
8
|
from typing import Union
|
7
9
|
|
@@ -379,6 +381,46 @@ class EffectsStack:
|
|
379
381
|
|
380
382
|
return self
|
381
383
|
|
382
|
-
|
383
|
-
|
384
|
+
def apply_video_effects_at_t(
|
385
|
+
self,
|
386
|
+
frame: 'np.ndarray',
|
387
|
+
t: Union[int, float, 'Fraction']
|
388
|
+
) -> 'np.ndarray':
|
389
|
+
"""
|
390
|
+
Apply all the video effects that must be
|
391
|
+
applied for the given 't' time moment to
|
392
|
+
the provided 'frame' (that must be the
|
393
|
+
video frame of that time moment).
|
394
|
+
"""
|
395
|
+
for effect in self.get_video_effects_for_t(t):
|
396
|
+
frame = effect.process(frame, t)
|
397
|
+
|
398
|
+
# TODO: Check when the frame comes as a
|
399
|
+
# Texture and when as a numpy array. I
|
400
|
+
# think when we apply an opengl node it
|
401
|
+
# is a texture, but we need to return it
|
402
|
+
# as a numpy, always
|
403
|
+
return (
|
404
|
+
texture_to_frame(frame)
|
405
|
+
if PythonValidator.is_instance_of(frame, moderngl.Texture) else
|
406
|
+
frame
|
407
|
+
)
|
408
|
+
|
409
|
+
def apply_audio_effects_at_t(
|
410
|
+
self,
|
411
|
+
frame: 'np.ndarray',
|
412
|
+
t: Union[int, float, 'Fraction']
|
413
|
+
) -> 'np.ndarray':
|
414
|
+
"""
|
415
|
+
Apply all the video effects that must be
|
416
|
+
applied for the given 't' time moment to
|
417
|
+
the provided 'frame' (that must be the
|
418
|
+
audio frame of that time moment).
|
419
|
+
"""
|
420
|
+
for effect in self.get_audio_effects_for_t(t):
|
421
|
+
frame = effect.process(frame, t)
|
422
|
+
|
423
|
+
# Frame can only by a numpy array here
|
424
|
+
return frame
|
425
|
+
|
384
426
|
# TODO: Create 'remove_effect'
|
@@ -131,11 +131,11 @@ class TimedNode:
|
|
131
131
|
|
132
132
|
def process(
|
133
133
|
self,
|
134
|
-
frame: Union[
|
134
|
+
frame: Union[moderngl.Texture, 'np.ndarray'],
|
135
135
|
t: float
|
136
136
|
# TODO: Maybe we need 'fps' and 'number_of_frames'
|
137
137
|
# to calculate progressions or similar...
|
138
|
-
) -> Union[
|
138
|
+
) -> Union[moderngl.Texture, 'np.ndarray']:
|
139
139
|
"""
|
140
140
|
Process the frame if the provided 't' time
|
141
141
|
moment is in the range of this TimedNode
|
File without changes
|
File without changes
|
File without changes
|
{yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/audio/__init__.py
RENAMED
File without changes
|
{yta_video_opengl-0.0.26 → yta_video_opengl-0.0.28}/src/yta_video_opengl/nodes/video/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|