├── docs ├── changes.md ├── _static │ ├── logo01.png │ ├── effect_blur.png │ ├── backend_cairo.png │ ├── backend_mixed.gif │ ├── backend_numpy.png │ ├── backend_pillow.png │ ├── complex_example.gif │ ├── backend_datashader.png │ ├── backend_matplotlib.png │ └── backend_drawingboard.png ├── algebra.rst ├── pool.rst ├── debug.rst ├── colors.rst ├── canvas.rst ├── matrices.rst ├── Makefile ├── prepare_tasks.rst ├── backends.rst ├── __init__.py ├── _templates │ └── layout.html ├── make.bat ├── support.rst ├── encoders.rst ├── camera.rst ├── anatomy.rst ├── video.rst ├── sequences.rst ├── time.rst ├── pillow.rst ├── canvas_factories.rst ├── pycairo.rst ├── vectors.rst ├── drawingboard.rst ├── layer_tasks.rst ├── version.py ├── datashader.rst ├── index.rst ├── gallery.rst ├── custom_backends.rst ├── effects.rst ├── performance.rst ├── conf.py ├── matplotlib.rst ├── installation.rst └── about.rst ├── .readthedocs.yml ├── MANIFEST.in ├── setup.cfg ├── .gitignore ├── pyproject.toml ├── tests ├── linalg │ ├── __init__.py │ ├── test_single2d_checks.py │ ├── test_single2d_operations.py │ └── test_single3d_checks.py └── __init__.py ├── src └── bewegung │ ├── linalg │ ├── _const.py │ ├── _numpy.py │ ├── __init__.py │ ├── _single.py │ ├── _lib.py │ ├── _array.py │ ├── _abc.py │ └── _svg.py │ ├── contrib │ └── __init__.py │ ├── drawingboard │ ├── __init__.py │ └── _abc.py │ ├── lib │ ├── __init__.py │ ├── _typeguard.py │ └── _abc.py │ ├── __init__.py │ └── animation │ ├── _backends │ ├── __init__.py │ ├── drawingboard.py │ ├── _load.py │ ├── pillow.py │ ├── cairo.py │ ├── datashader.py │ ├── matplotlib.py │ └── _base.py │ ├── _const.py │ ├── __init__.py │ ├── _abc.py │ ├── _task.py │ ├── _sequence.py │ ├── _indexpool.py │ ├── _timescale.py │ ├── _time.py │ ├── _layer.py │ └── _effects.py ├── makefile ├── CHANGES.md ├── README.md └── setup.py /docs/changes.md: -------------------------------------------------------------------------------- 1 | ../CHANGES.md -------------------------------------------------------------------------------- /docs/_static/logo01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/logo01.png -------------------------------------------------------------------------------- /docs/_static/effect_blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/effect_blur.png -------------------------------------------------------------------------------- /docs/_static/backend_cairo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_cairo.png -------------------------------------------------------------------------------- /docs/_static/backend_mixed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_mixed.gif -------------------------------------------------------------------------------- /docs/_static/backend_numpy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_numpy.png -------------------------------------------------------------------------------- /docs/_static/backend_pillow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_pillow.png -------------------------------------------------------------------------------- /docs/_static/complex_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/complex_example.gif -------------------------------------------------------------------------------- /docs/_static/backend_datashader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_datashader.png -------------------------------------------------------------------------------- /docs/_static/backend_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_matplotlib.png -------------------------------------------------------------------------------- /docs/_static/backend_drawingboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pleiszenburg/bewegung/HEAD/docs/_static/backend_drawingboard.png -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | python: 4 | version: 3.8 5 | install: 6 | - method: pip 7 | path: . 8 | extra_requirements: 9 | - docs 10 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include docs/ *.py 2 | recursive-include docs/ *.rst 3 | recursive-include docs/_static/ *.png 4 | recursive-include docs/_static/ *.gif 5 | include docs/Makefile 6 | include docs/make.bat 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md 3 | license_file = LICENSE 4 | 5 | [tool:pytest] 6 | testpaths = tests 7 | 8 | [coverage:run] 9 | branch = True 10 | parallel = True 11 | 12 | [coverage:paths] 13 | source = 14 | src/ 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __*__ 2 | *.pyc 3 | env*/ 4 | pip-wheel-metadata/ 5 | *.egg-info 6 | .ipynb_checkpoints/ 7 | *.ipynb 8 | notes.md 9 | config.yaml 10 | dist/ 11 | build/ 12 | test/ 13 | *.bmp 14 | *.mp4 15 | *pleiszenburg* 16 | _build/ 17 | MATERIAL/ 18 | .hypothesis/ 19 | .coverage 20 | .pytest_cache/ 21 | htmlcov/ 22 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel"] 3 | 4 | [tool.black] 5 | target-version = ['py36'] 6 | include = '\.pyi?$' 7 | exclude = ''' 8 | /( 9 | \.eggs 10 | | \.git 11 | | \.hg 12 | | \.mypy_cache 13 | | \.tox 14 | | \.venv 15 | | _build 16 | | buck-out 17 | | build 18 | | dist 19 | | env?? 20 | | env 21 | )/ 22 | ''' 23 | -------------------------------------------------------------------------------- /docs/algebra.rst: -------------------------------------------------------------------------------- 1 | Linear Algebra 2 | ============== 3 | 4 | ``bewegung`` offers a number of *convenience* classes for tasks related to linear algebra. They are isolated into a distinct sub-module named ``bewegung.linalg``. 5 | 6 | .. note:: 7 | 8 | The classes provided here are neither very performant nor feature-complete. 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | :caption: The API in detail 13 | 14 | vectors 15 | matrices 16 | camera 17 | -------------------------------------------------------------------------------- /docs/pool.rst: -------------------------------------------------------------------------------- 1 | .. _index_pool: 2 | 3 | Index Pools 4 | =========== 5 | 6 | ``IndexPool`` objects are meant to manage index values that are fed into the ``preporder`` parameter of the :meth:`bewegung.Video.prepare` decorator method and the ``zindex`` parameter of the :meth:`bewegung.Video.layer` decorator method. A ``Video`` object therefore manages two pools: :attr:`bewegung.Video.zindex` and :attr:`bewegung.Video.preporder`. 7 | 8 | The ``IndexPool`` Class 9 | ----------------------- 10 | 11 | .. autoclass:: bewegung.IndexPool 12 | :members: 13 | -------------------------------------------------------------------------------- /docs/debug.rst: -------------------------------------------------------------------------------- 1 | .. _debug: 2 | 3 | Debugging 4 | ========= 5 | 6 | Type Checking at Runtime 7 | ------------------------ 8 | 9 | ``bewegung`` enforces `type hints`_ with `typeguard`_ at runtime by default - if ``typeguard`` is installed. Any kind of type violation triggers an exception. 10 | 11 | .. warning:: 12 | 13 | Type checking at runtime is a slow process. :ref:`Deactivate for better performance! ` 14 | 15 | .. _type hints: https://www.python.org/dev/peps/pep-0484/ 16 | .. _typeguard: https://github.com/agronholm/typeguard 17 | -------------------------------------------------------------------------------- /docs/colors.rst: -------------------------------------------------------------------------------- 1 | .. _colors: 2 | 3 | Cross-Backend Abstraction: Colors 4 | --------------------------------- 5 | 6 | All backends work with variations of RGB, RGBA or RGBa color spaces. Some use pre-multiplied alpha values, some do not. Some accept RGB values as floats from 0.0 to 1.0, some accept RGB values as integers from 0 to 255, some expect hexadecimal notations as strings. The :class:`bewegung.Color` class tries to provide a common base for working with RGB(A) colors in different notations. 7 | 8 | The ``Color`` API 9 | ~~~~~~~~~~~~~~~~~ 10 | 11 | .. autoclass:: bewegung.Color 12 | :members: 13 | -------------------------------------------------------------------------------- /docs/canvas.rst: -------------------------------------------------------------------------------- 1 | .. _drawing: 2 | 3 | Drawing: Canvas Types & Backends 4 | ================================ 5 | 6 | ``bewegung`` offers a set of "backends" for drawing on canvases. A specific backend can be selected and configured through the :meth:`bewegung.Video.canvas` method. Full access to the inventory of backends and all of their functionality is provided through the ``backends`` dictionary. 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | :caption: The API in detail 11 | 12 | canvas_factories 13 | backends 14 | drawingboard 15 | pycairo 16 | pillow 17 | datashader 18 | matplotlib 19 | custom_backends 20 | colors 21 | -------------------------------------------------------------------------------- /docs/matrices.rst: -------------------------------------------------------------------------------- 1 | .. _matrices: 2 | 3 | Matrices and Matrix Arrays 4 | ========================== 5 | 6 | ``bewegung`` offers :ref:`matrices ` and :ref:`matrix arrays `. Both of them work for 2x2 and 3x3 shapes. They are intended for simple tasks like rotations of :ref:`vectors ` and :ref:`vector arrays `. 7 | 8 | .. _matrix_single: 9 | 10 | The ``Matrix`` Class 11 | -------------------- 12 | 13 | .. autoclass:: bewegung.Matrix 14 | :members: 15 | 16 | .. _matrix_array: 17 | 18 | The ``MatrixArray`` Class 19 | ------------------------- 20 | 21 | .. autoclass:: bewegung.MatrixArray 22 | :members: 23 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/prepare_tasks.rst: -------------------------------------------------------------------------------- 1 | .. _prepare_tasks: 2 | 3 | Prepare Tasks 4 | ============= 5 | 6 | Prepare tasks are special, decorated methods within user-defined :ref:`sequence ` classes. They allow to *prepare* and compute data once per frame. Similar to :ref:`layer task methods `, they are evaluated in a certain order, the ``prepoder``. A :ref:`pool ` of prepoder-values is managed by :attr:`bewegung.Video.prepoder` once per video. Prepare tasks can :ref:`request parameters on demand `. 7 | 8 | The ``Video.prepare`` Decorator 9 | ------------------------------- 10 | 11 | This method is used to decorate prepare task methods within user-defined :ref:`sequence ` classes. See :meth:`bewegung.Video.prepare` method for further details. 12 | -------------------------------------------------------------------------------- /docs/backends.rst: -------------------------------------------------------------------------------- 1 | Inventory of ``backends`` 2 | ========================= 3 | 4 | All backends can be accessed via the ``backends`` dictionary, which represents the inventory of backends. 5 | 6 | .. code:: ipython 7 | 8 | >>> from bewegung import backends 9 | >>> backends.keys() 10 | dict_keys(['drawingboard', 'pillow', 'datashader', 'cairo', 'matplotlib']) 11 | >>> [backend for backend in backends.values()] 12 | [, , , , ] 13 | 14 | Backends are "lazy" objects. They only import the underlying library if actually used. For most intents and purposes, working with :meth:`bewegung.Video.canvas` is sufficient. Further details about the common structure of backends are provided in the :ref:`sections on custom backends `. 15 | -------------------------------------------------------------------------------- /docs/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | docs/__init__.py: Docs root 10 | 11 | Copyright (C) 2020-2021 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | -------------------------------------------------------------------------------- /tests/linalg/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | tests/linalg/__init__.py: Linear algebra tests 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | -------------------------------------------------------------------------------- /docs/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% block menu %} 4 | 5 | {{ super() }} 6 | 7 | {% if sidebar_external_links %} 8 | 9 |

10 | 11 | {% if sidebar_external_links_caption %} 12 | {{ sidebar_external_links_caption }} 13 | {% else %} 14 | External links 15 | {% endif %} 16 | 17 |

18 | 19 |
    20 | {% for text, link in sidebar_external_links %} 21 | {% if hasdoc(link) %} 22 |
  • {{ text }}
  • 23 | {% else %} 24 |
  • {{ text }}
  • 25 | {% endif %} 26 | {% endfor %} 27 |
28 | 29 | {% endif %} 30 | 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/support.rst: -------------------------------------------------------------------------------- 1 | .. _support: 2 | 3 | Getting Help 4 | ============ 5 | 6 | There are multiple ways of getting help. 7 | 8 | Mailing List 9 | ------------ 10 | 11 | A public mailing list for both users and developers is available at `groups.io`_. 12 | 13 | .. _groups.io: https://groups.io/g/bewegung-dev 14 | 15 | Chat 16 | ---- 17 | 18 | There is a `dedicated public Matrix chat`_. 19 | 20 | .. _dedicated public Matrix chat: https://matrix.to/#/#bewegung:matrix.org 21 | 22 | Reporting Bugs / Issues 23 | ----------------------- 24 | 25 | Bugs and any kind of issues should be reported in the project's `Github issue tracker`_. 26 | 27 | .. _Github issue tracker: https://github.com/pleiszenburg/bewegung/issues 28 | 29 | Paid Support 30 | ------------ 31 | 32 | In addition to the previous options, paid support is available from `pleiszenburg.de - Independent Scientific Services`_. 33 | 34 | .. _pleiszenburg.de - Independent Scientific Services: http://www.pleiszenburg.de 35 | -------------------------------------------------------------------------------- /docs/encoders.rst: -------------------------------------------------------------------------------- 1 | .. _encoders: 2 | 3 | Encoders 4 | ======== 5 | 6 | Encoder objects are passed to the ``encoder`` parameter of :meth:`bewegung.Video.render`. While ``bewegung`` handles the composition of video frames, the completed frames are streamed to an actual video encoding tool or library. It is possible to define custom encoders. 7 | 8 | Available Encoders 9 | ------------------ 10 | 11 | .. autoclass:: bewegung.FFmpegH264Encoder 12 | 13 | .. autoclass:: bewegung.FFmpegGifEncoder 14 | 15 | Defining Custom Encoders 16 | ------------------------ 17 | 18 | Custom encoders can be defined by deriving from the :class:`bewegung.EncoderBase` class. This mechanism can be used to build both custom ``ffmpeg``-based pipelines as well as wrap other tools such as `mencoder`_. 19 | 20 | .. _mencoder: http://www.mplayerhq.hu/DOCS/HTML/en/mencoder.html 21 | 22 | The ``EncoderBase`` Class 23 | ~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | 25 | .. autoclass:: bewegung.EncoderBase 26 | :members: 27 | :private-members: 28 | -------------------------------------------------------------------------------- /src/bewegung/linalg/_const.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/linalg/_const.py: Const values 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # CONST 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | FLOAT_DEFAULT = 'f4' 32 | -------------------------------------------------------------------------------- /src/bewegung/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/contrib/__init__.py: Package library root 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # EXPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | # No direct exports! 32 | -------------------------------------------------------------------------------- /docs/camera.rst: -------------------------------------------------------------------------------- 1 | 3D to 2D projections: A Camera 2 | ============================== 3 | 4 | ``bewegung`` includes a `pin-hole camera`_ for simple 3D to 2D projections. In a nutshell, the a :class:`bewegung.Camera` object can convert a :class:`bewegung.Vector3D` object into a :class:`bewegung.Vector2D` object given a location and direction in 3D space, i.e. the 3D vector is projected into a plane in 2D space. Because the "camera" is actually not a rendering system on its own, it simply adds meta data (:attr:`bewegung.Vector.meta`) to the returned 2D vector: The absolute distance (``meta["dist"]``) from the "pinhole" in 3D space to the vector in 3D space. This allows to (manually) implement various kinds of depth perception, e.g. backgrounds and foregrounds, in visualizations. The camera is a useful tool if e.g. multiple :ref:`drawing backends ` are combined within a single animation and some kind of common 3D visualization is required. A typical combination is :ref:`datashader ` for density distributions and :ref:`cairo ` for annotations on top, see :ref:`gallery ` for examples. 5 | 6 | .. _pin-hole camera: https://en.wikipedia.org/wiki/Pinhole_camera 7 | 8 | .. autoclass:: bewegung.Camera 9 | :members: 10 | -------------------------------------------------------------------------------- /src/bewegung/drawingboard/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/drawingboard/__init__.py: Simple 2D cairo renderer 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # EXPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | from ._core import DrawingBoard 32 | -------------------------------------------------------------------------------- /src/bewegung/lib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/lib/__init__.py: Common routines and classes 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # EXPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | from ._color import Color 32 | from ._typeguard import typechecked 33 | -------------------------------------------------------------------------------- /src/bewegung/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/__init__.py: Package root 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # EXPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | __version__ = '0.0.7' 32 | 33 | from .animation import * 34 | from .lib import * 35 | from .linalg import * 36 | -------------------------------------------------------------------------------- /src/bewegung/animation/_backends/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/animation/_backends/__init__.py: Collects backend types for layers 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # EXPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | from ._load import backends 32 | from ._base import BackendBase 33 | -------------------------------------------------------------------------------- /src/bewegung/lib/_typeguard.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/lib/_typeguard.py: Wrapper around typeguard (optional) 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # IMPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | try: 32 | from typeguard import typechecked 33 | except ModuleNotFoundError: 34 | typechecked = lambda x: x 35 | -------------------------------------------------------------------------------- /src/bewegung/linalg/_numpy.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 5 | BEWEGUNG 6 | a versatile video renderer 7 | https://github.com/pleiszenburg/bewegung 8 | 9 | src/bewegung/linalg/_numpy.py: Wrapper around numpy (optional) 10 | 11 | Copyright (C) 2020-2022 Sebastian M. Ernst 12 | 13 | 14 | The contents of this file are subject to the GNU Lesser General Public License 15 | Version 2.1 ("LGPL" or "License"). You may not use this file except in 16 | compliance with the License. You may obtain a copy of the License at 17 | https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt 18 | https://github.com/pleiszenburg/bewegung/blob/master/LICENSE 19 | 20 | Software distributed under the License is distributed on an "AS IS" basis, 21 | WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 22 | specific language governing rights and limitations under the License. 23 | 24 | 25 | """ 26 | 27 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 | # IMPORT 29 | # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 | 31 | try: 32 | import numpy as np 33 | from numpy import ndarray 34 | except ModuleNotFoundError: 35 | np, ndarray = None, None 36 | -------------------------------------------------------------------------------- /docs/anatomy.rst: -------------------------------------------------------------------------------- 1 | Compositing: Anatomy of a Video 2 | =============================== 3 | 4 | Based on *layers* and *sequences*, ``bewegung`` offers a lot of infrastructure for compositing animations and videos. At its core, there is :ref:`time