naramotion 0.24.0__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.
- naramotion-0.24.0/PKG-INFO +168 -0
- naramotion-0.24.0/README.md +128 -0
- naramotion-0.24.0/blend2d/__init__.py +335 -0
- naramotion-0.24.0/blend2d/_bin/blend2d_fx.lib +0 -0
- naramotion-0.24.0/blend2d/_bin/blend2d_geo.lib +0 -0
- naramotion-0.24.0/blend2d/_bin/blend2d_license.lib +0 -0
- naramotion-0.24.0/blend2d/_bin/blend2d_motion.lib +0 -0
- naramotion-0.24.0/blend2d/_bin/blend2d_perspective.lib +0 -0
- naramotion-0.24.0/blend2d/_bin/blend2d_video.lib +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d.so +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_fx.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_fx.pdb +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_geo.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_geo.pdb +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_license.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_motion.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_motion.pdb +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_perspective.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_perspective.pdb +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_video.dll +0 -0
- naramotion-0.24.0/blend2d/_bin/libblend2d_video.pdb +0 -0
- naramotion-0.24.0/blend2d/color.py +247 -0
- naramotion-0.24.0/blend2d/context.py +1682 -0
- naramotion-0.24.0/blend2d/diagnostics.py +201 -0
- naramotion-0.24.0/blend2d/enums.py +272 -0
- naramotion-0.24.0/blend2d/ffi.py +1301 -0
- naramotion-0.24.0/blend2d/font.py +289 -0
- naramotion-0.24.0/blend2d/fx/__init__.py +63 -0
- naramotion-0.24.0/blend2d/fx/_ffi.py +102 -0
- naramotion-0.24.0/blend2d/fx/blur.py +59 -0
- naramotion-0.24.0/blend2d/fx/color_grade.py +73 -0
- naramotion-0.24.0/blend2d/fx/glitch.py +61 -0
- naramotion-0.24.0/blend2d/fx/glow.py +104 -0
- naramotion-0.24.0/blend2d/fx/lens.py +98 -0
- naramotion-0.24.0/blend2d/fx/pipeline.py +105 -0
- naramotion-0.24.0/blend2d/geometry.py +242 -0
- naramotion-0.24.0/blend2d/image.py +396 -0
- naramotion-0.24.0/blend2d/license.py +107 -0
- naramotion-0.24.0/blend2d/matrix.py +153 -0
- naramotion-0.24.0/blend2d/motion/__init__.py +110 -0
- naramotion-0.24.0/blend2d/motion/easing.py +475 -0
- naramotion-0.24.0/blend2d/motion/particles.py +355 -0
- naramotion-0.24.0/blend2d/motion/path_anim.py +312 -0
- naramotion-0.24.0/blend2d/motion/perspective.py +468 -0
- naramotion-0.24.0/blend2d/motion/scene.py +237 -0
- naramotion-0.24.0/blend2d/motion/timeline.py +208 -0
- naramotion-0.24.0/blend2d/path.py +589 -0
- naramotion-0.24.0/blend2d/py.typed +1 -0
- naramotion-0.24.0/blend2d/shapgeo.py +909 -0
- naramotion-0.24.0/blend2d/shapgeo_io.py +406 -0
- naramotion-0.24.0/blend2d/shapgeo_proj.py +242 -0
- naramotion-0.24.0/blend2d/style.py +210 -0
- naramotion-0.24.0/blend2d/svg.py +383 -0
- naramotion-0.24.0/blend2d/video.py +498 -0
- naramotion-0.24.0/blend2d-src/blend2d-version.py +23 -0
- naramotion-0.24.0/naramotion/__init__.py +335 -0
- naramotion-0.24.0/naramotion/_bin/blend2d_fx.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/blend2d_geo.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/blend2d_license.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/blend2d_motion.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/blend2d_perspective.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/blend2d_video.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_fx.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_fx.pdb +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_fx.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_geo.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_geo.pdb +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_geo.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_license.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_license.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_motion.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_motion.pdb +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_motion.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_perspective.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_perspective.pdb +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_perspective.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_video.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_video.pdb +0 -0
- naramotion-0.24.0/naramotion/_bin/libblend2d_video.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_fx.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_fx.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_geo.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_geo.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_license.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_license.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_motion.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_motion.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_perspective.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_perspective.so +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_video.dll +0 -0
- naramotion-0.24.0/naramotion/_bin/libnaramotion_video.so +0 -0
- naramotion-0.24.0/naramotion/_bin/naramotion_fx.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/naramotion_geo.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/naramotion_license.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/naramotion_motion.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/naramotion_perspective.lib +0 -0
- naramotion-0.24.0/naramotion/_bin/naramotion_video.lib +0 -0
- naramotion-0.24.0/naramotion/color.py +247 -0
- naramotion-0.24.0/naramotion/context.py +1682 -0
- naramotion-0.24.0/naramotion/diagnostics.py +201 -0
- naramotion-0.24.0/naramotion/enums.py +272 -0
- naramotion-0.24.0/naramotion/ffi.py +1301 -0
- naramotion-0.24.0/naramotion/font.py +289 -0
- naramotion-0.24.0/naramotion/fx/__init__.py +63 -0
- naramotion-0.24.0/naramotion/fx/_ffi.py +102 -0
- naramotion-0.24.0/naramotion/fx/blur.py +59 -0
- naramotion-0.24.0/naramotion/fx/color_grade.py +73 -0
- naramotion-0.24.0/naramotion/fx/glitch.py +61 -0
- naramotion-0.24.0/naramotion/fx/glow.py +104 -0
- naramotion-0.24.0/naramotion/fx/lens.py +98 -0
- naramotion-0.24.0/naramotion/fx/pipeline.py +105 -0
- naramotion-0.24.0/naramotion/fx/tone_mapping.py +61 -0
- naramotion-0.24.0/naramotion/geometry.py +242 -0
- naramotion-0.24.0/naramotion/image.py +396 -0
- naramotion-0.24.0/naramotion/license.py +107 -0
- naramotion-0.24.0/naramotion/matrix.py +153 -0
- naramotion-0.24.0/naramotion/motion/__init__.py +110 -0
- naramotion-0.24.0/naramotion/motion/actions.py +192 -0
- naramotion-0.24.0/naramotion/motion/easing.py +475 -0
- naramotion-0.24.0/naramotion/motion/interpolate.py +118 -0
- naramotion-0.24.0/naramotion/motion/particles.py +355 -0
- naramotion-0.24.0/naramotion/motion/path_anim.py +312 -0
- naramotion-0.24.0/naramotion/motion/perspective.py +468 -0
- naramotion-0.24.0/naramotion/motion/scene.py +237 -0
- naramotion-0.24.0/naramotion/motion/sequence.py +160 -0
- naramotion-0.24.0/naramotion/motion/smoothing.py +148 -0
- naramotion-0.24.0/naramotion/motion/timeline.py +208 -0
- naramotion-0.24.0/naramotion/palette.py +144 -0
- naramotion-0.24.0/naramotion/path.py +589 -0
- naramotion-0.24.0/naramotion/py.typed +1 -0
- naramotion-0.24.0/naramotion/shapgeo.py +909 -0
- naramotion-0.24.0/naramotion/shapgeo_io.py +406 -0
- naramotion-0.24.0/naramotion/shapgeo_proj.py +242 -0
- naramotion-0.24.0/naramotion/style.py +210 -0
- naramotion-0.24.0/naramotion/svg.py +383 -0
- naramotion-0.24.0/naramotion/video.py +498 -0
- naramotion-0.24.0/naramotion.egg-info/PKG-INFO +168 -0
- naramotion-0.24.0/naramotion.egg-info/SOURCES.txt +172 -0
- naramotion-0.24.0/naramotion.egg-info/dependency_links.txt +1 -0
- naramotion-0.24.0/naramotion.egg-info/requires.txt +13 -0
- naramotion-0.24.0/naramotion.egg-info/top_level.txt +1 -0
- naramotion-0.24.0/pyproject.toml +56 -0
- naramotion-0.24.0/setup.cfg +4 -0
- naramotion-0.24.0/setup.py +14 -0
- naramotion-0.24.0/tests/test_advanced.py +148 -0
- naramotion-0.24.0/tests/test_advanced_motion_v24.py +104 -0
- naramotion-0.24.0/tests/test_ai_tolerance.py +105 -0
- naramotion-0.24.0/tests/test_cinematic_engine.py +114 -0
- naramotion-0.24.0/tests/test_context.py +71 -0
- naramotion-0.24.0/tests/test_cross_module_integration.py +189 -0
- naramotion-0.24.0/tests/test_extreme_stress_and_benchmarks.py +255 -0
- naramotion-0.24.0/tests/test_font.py +51 -0
- naramotion-0.24.0/tests/test_fx.py +101 -0
- naramotion-0.24.0/tests/test_image.py +51 -0
- naramotion-0.24.0/tests/test_license.py +47 -0
- naramotion-0.24.0/tests/test_matrix.py +44 -0
- naramotion-0.24.0/tests/test_motion_easing.py +70 -0
- naramotion-0.24.0/tests/test_motion_particles.py +57 -0
- naramotion-0.24.0/tests/test_motion_path.py +73 -0
- naramotion-0.24.0/tests/test_motion_scene.py +47 -0
- naramotion-0.24.0/tests/test_motion_timeline.py +54 -0
- naramotion-0.24.0/tests/test_numpy_pil.py +45 -0
- naramotion-0.24.0/tests/test_path.py +58 -0
- naramotion-0.24.0/tests/test_perspective_camera.py +138 -0
- naramotion-0.24.0/tests/test_shapgeo.py +195 -0
- naramotion-0.24.0/tests/test_shapgeo_io.py +183 -0
- naramotion-0.24.0/tests/test_shapgeo_parquet.py +76 -0
- naramotion-0.24.0/tests/test_shapgeo_proj.py +86 -0
- naramotion-0.24.0/tests/test_style.py +53 -0
- naramotion-0.24.0/tests/test_v2_features.py +137 -0
- naramotion-0.24.0/tests/test_video.py +124 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: naramotion
|
|
3
|
+
Version: 0.24.0
|
|
4
|
+
Summary: NaraMotion: Ultra-Fast 2D/2.5D Vector Graphics, Motion, GIS, VFX & Video Engine powered by Blend2D
|
|
5
|
+
Author: Islam Arifi, NaraMotion Developers
|
|
6
|
+
Maintainer: Islam Arifi
|
|
7
|
+
License: Proprietary
|
|
8
|
+
Project-URL: Homepage, https://pypi.org/project/naramotion/
|
|
9
|
+
Project-URL: Repository, https://pypi.org/project/naramotion/
|
|
10
|
+
Project-URL: Documentation, https://pypi.org/project/naramotion/
|
|
11
|
+
Keywords: naramotion,blend2d,graphics,2d,vector,rasterizer,jit,simd,motion,gis,geopandas,shapely,video,render,vfx,aftereffects
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: License :: Other/Proprietary License
|
|
24
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
25
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
26
|
+
Classifier: Operating System :: MacOS
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
Provides-Extra: numpy
|
|
30
|
+
Requires-Dist: numpy>=1.20; extra == "numpy"
|
|
31
|
+
Provides-Extra: pil
|
|
32
|
+
Requires-Dist: Pillow>=8.0; extra == "pil"
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: numpy>=1.20; extra == "all"
|
|
35
|
+
Requires-Dist: Pillow>=8.0; extra == "all"
|
|
36
|
+
Requires-Dist: geopandas>=0.10.0; extra == "all"
|
|
37
|
+
Requires-Dist: shapely>=1.8.0; extra == "all"
|
|
38
|
+
Requires-Dist: pytest>=7.0; extra == "all"
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
|
|
41
|
+
# NaraMotion 🎨🚀
|
|
42
|
+
|
|
43
|
+
[](https://www.python.org/)
|
|
44
|
+
[](https://pypi.org/project/naramotion/)
|
|
45
|
+
[](https://blend2d.com)
|
|
46
|
+
|
|
47
|
+
**Author & Creator**: Islam Arifi
|
|
48
|
+
**Official PyPI Package**: [`naramotion`](https://pypi.org/project/naramotion/) (v0.22.0)
|
|
49
|
+
|
|
50
|
+
**NaraMotion** is an ultra-fast 2D/2.5D vector graphics, GIS, motion graphics, and cinematic video engine for Python powered by **[Blend2D](https://blend2d.com)** (embedded JIT compiler and SIMD hardware acceleration).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🔑 License Activation & Evaluation Mode
|
|
55
|
+
|
|
56
|
+
NaraMotion is distributed under a **Proprietary Commercial License** with an Evaluation Mode.
|
|
57
|
+
Unlicensed evaluation renders include a subtle semi-transparent `"Auras"` watermark in the center.
|
|
58
|
+
|
|
59
|
+
### To Activate Full Commercial Version:
|
|
60
|
+
Call `naramotion.set_license()` at the beginning of your program with your commercial key:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
import naramotion
|
|
64
|
+
|
|
65
|
+
# Activate official license (removes all evaluation watermarks)
|
|
66
|
+
naramotion.set_license("YOUR_COMMERCIAL_KEY")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Or set the environment variable:
|
|
70
|
+
```bash
|
|
71
|
+
export NARAMOTION_LICENSE_KEY="YOUR_COMMERCIAL_KEY" # Linux/macOS
|
|
72
|
+
set NARAMOTION_LICENSE_KEY="YOUR_COMMERCIAL_KEY" # Windows
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 📦 Official Installation
|
|
78
|
+
|
|
79
|
+
### 1. From PyPI:
|
|
80
|
+
```bash
|
|
81
|
+
pip install naramotion
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 2. Optional Speed & Ecosystem Extensions:
|
|
85
|
+
```bash
|
|
86
|
+
pip install "naramotion[numpy,pil]" # For Zero-Copy NumPy & Pillow integration
|
|
87
|
+
pip install "naramotion[all]" # For GeoPandas, Shapely & full testing
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### ✅ Quick Verification:
|
|
91
|
+
```python
|
|
92
|
+
import naramotion
|
|
93
|
+
print(f"✨ NaraMotion Version: {naramotion.__version__} by {naramotion.__author__}")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🚀 Quickstart
|
|
99
|
+
|
|
100
|
+
### 1. Basic Drawing & Context Manager
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from naramotion import Image, Context, Format
|
|
104
|
+
|
|
105
|
+
# Create 800x600 surface in PRGB32 format
|
|
106
|
+
img = Image(800, 600, Format.PRGB32)
|
|
107
|
+
|
|
108
|
+
with Context(img) as ctx:
|
|
109
|
+
# 1. Fill dark cyberpunk canvas background
|
|
110
|
+
ctx.fill_all("#090D16")
|
|
111
|
+
|
|
112
|
+
# 2. Draw soft glowing circle
|
|
113
|
+
ctx.fill_circle(400, 300, 140, "#38BDF8")
|
|
114
|
+
|
|
115
|
+
# 3. Add stylish thick border with rounded corners
|
|
116
|
+
ctx.stroke_width = 8.0
|
|
117
|
+
ctx.stroke_round_rect(100, 100, 600, 400, 24.0, style="#F43F5E")
|
|
118
|
+
|
|
119
|
+
# Save directly to disk
|
|
120
|
+
img.save("quickstart_naramotion.png")
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 2. Cinematic Post-Processing FX & Post-Pipeline
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from naramotion import Image, Context, fx
|
|
129
|
+
|
|
130
|
+
img = Image(1280, 720)
|
|
131
|
+
with Context(img) as ctx:
|
|
132
|
+
ctx.fill_all("#060810")
|
|
133
|
+
ctx.fill_circle(640, 360, 180, "#38BDF8")
|
|
134
|
+
|
|
135
|
+
# Apply chained visual FX (Bloom + Vignette + Film Grain)
|
|
136
|
+
fx.FXPipeline().bloom(threshold=0.5, intensity=1.5, radius=12.0).vignette(0.5).film_grain(0.05).apply(img)
|
|
137
|
+
img.save("cinematic_naramotion.png")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### 3. Kinetic Perspective Camera (2.5D 4K Video Flythrough)
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
from naramotion import Image, Context, Format, CompOp
|
|
146
|
+
from naramotion.motion import PerspectiveCamera
|
|
147
|
+
from naramotion.video import VideoWriter
|
|
148
|
+
|
|
149
|
+
WIDTH, HEIGHT = 1920, 1080
|
|
150
|
+
img = Image(WIDTH, HEIGHT, Format.PRGB32)
|
|
151
|
+
cam = PerspectiveCamera(width=WIDTH, height=HEIGHT, pitch=65.0, distance=900.0)
|
|
152
|
+
|
|
153
|
+
with VideoWriter("flythrough.mp4", width=WIDTH, height=HEIGHT, fps=60) as vw:
|
|
154
|
+
for frame in range(120):
|
|
155
|
+
cam.target_y = (frame / 119.0) * 1200.0
|
|
156
|
+
with Context(img) as ctx:
|
|
157
|
+
ctx.fill_all("#050811")
|
|
158
|
+
cam.render_fog(ctx, fog_color="#050811", horizon_y_ratio=0.35)
|
|
159
|
+
vw.write_frame(img)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 📚 Complete API Documentation
|
|
165
|
+
|
|
166
|
+
For the complete 22-section master documentation and AI guidelines, see:
|
|
167
|
+
- [`DOCUMENTATION.md`](DOCUMENTATION.md)
|
|
168
|
+
- [`AI_RULES.md`](AI_RULES.md)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# NaraMotion 🎨🚀
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/)
|
|
4
|
+
[](https://pypi.org/project/naramotion/)
|
|
5
|
+
[](https://blend2d.com)
|
|
6
|
+
|
|
7
|
+
**Author & Creator**: Islam Arifi
|
|
8
|
+
**Official PyPI Package**: [`naramotion`](https://pypi.org/project/naramotion/) (v0.22.0)
|
|
9
|
+
|
|
10
|
+
**NaraMotion** is an ultra-fast 2D/2.5D vector graphics, GIS, motion graphics, and cinematic video engine for Python powered by **[Blend2D](https://blend2d.com)** (embedded JIT compiler and SIMD hardware acceleration).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🔑 License Activation & Evaluation Mode
|
|
15
|
+
|
|
16
|
+
NaraMotion is distributed under a **Proprietary Commercial License** with an Evaluation Mode.
|
|
17
|
+
Unlicensed evaluation renders include a subtle semi-transparent `"Auras"` watermark in the center.
|
|
18
|
+
|
|
19
|
+
### To Activate Full Commercial Version:
|
|
20
|
+
Call `naramotion.set_license()` at the beginning of your program with your commercial key:
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
import naramotion
|
|
24
|
+
|
|
25
|
+
# Activate official license (removes all evaluation watermarks)
|
|
26
|
+
naramotion.set_license("YOUR_COMMERCIAL_KEY")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or set the environment variable:
|
|
30
|
+
```bash
|
|
31
|
+
export NARAMOTION_LICENSE_KEY="YOUR_COMMERCIAL_KEY" # Linux/macOS
|
|
32
|
+
set NARAMOTION_LICENSE_KEY="YOUR_COMMERCIAL_KEY" # Windows
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 📦 Official Installation
|
|
38
|
+
|
|
39
|
+
### 1. From PyPI:
|
|
40
|
+
```bash
|
|
41
|
+
pip install naramotion
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Optional Speed & Ecosystem Extensions:
|
|
45
|
+
```bash
|
|
46
|
+
pip install "naramotion[numpy,pil]" # For Zero-Copy NumPy & Pillow integration
|
|
47
|
+
pip install "naramotion[all]" # For GeoPandas, Shapely & full testing
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### ✅ Quick Verification:
|
|
51
|
+
```python
|
|
52
|
+
import naramotion
|
|
53
|
+
print(f"✨ NaraMotion Version: {naramotion.__version__} by {naramotion.__author__}")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🚀 Quickstart
|
|
59
|
+
|
|
60
|
+
### 1. Basic Drawing & Context Manager
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from naramotion import Image, Context, Format
|
|
64
|
+
|
|
65
|
+
# Create 800x600 surface in PRGB32 format
|
|
66
|
+
img = Image(800, 600, Format.PRGB32)
|
|
67
|
+
|
|
68
|
+
with Context(img) as ctx:
|
|
69
|
+
# 1. Fill dark cyberpunk canvas background
|
|
70
|
+
ctx.fill_all("#090D16")
|
|
71
|
+
|
|
72
|
+
# 2. Draw soft glowing circle
|
|
73
|
+
ctx.fill_circle(400, 300, 140, "#38BDF8")
|
|
74
|
+
|
|
75
|
+
# 3. Add stylish thick border with rounded corners
|
|
76
|
+
ctx.stroke_width = 8.0
|
|
77
|
+
ctx.stroke_round_rect(100, 100, 600, 400, 24.0, style="#F43F5E")
|
|
78
|
+
|
|
79
|
+
# Save directly to disk
|
|
80
|
+
img.save("quickstart_naramotion.png")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### 2. Cinematic Post-Processing FX & Post-Pipeline
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from naramotion import Image, Context, fx
|
|
89
|
+
|
|
90
|
+
img = Image(1280, 720)
|
|
91
|
+
with Context(img) as ctx:
|
|
92
|
+
ctx.fill_all("#060810")
|
|
93
|
+
ctx.fill_circle(640, 360, 180, "#38BDF8")
|
|
94
|
+
|
|
95
|
+
# Apply chained visual FX (Bloom + Vignette + Film Grain)
|
|
96
|
+
fx.FXPipeline().bloom(threshold=0.5, intensity=1.5, radius=12.0).vignette(0.5).film_grain(0.05).apply(img)
|
|
97
|
+
img.save("cinematic_naramotion.png")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### 3. Kinetic Perspective Camera (2.5D 4K Video Flythrough)
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from naramotion import Image, Context, Format, CompOp
|
|
106
|
+
from naramotion.motion import PerspectiveCamera
|
|
107
|
+
from naramotion.video import VideoWriter
|
|
108
|
+
|
|
109
|
+
WIDTH, HEIGHT = 1920, 1080
|
|
110
|
+
img = Image(WIDTH, HEIGHT, Format.PRGB32)
|
|
111
|
+
cam = PerspectiveCamera(width=WIDTH, height=HEIGHT, pitch=65.0, distance=900.0)
|
|
112
|
+
|
|
113
|
+
with VideoWriter("flythrough.mp4", width=WIDTH, height=HEIGHT, fps=60) as vw:
|
|
114
|
+
for frame in range(120):
|
|
115
|
+
cam.target_y = (frame / 119.0) * 1200.0
|
|
116
|
+
with Context(img) as ctx:
|
|
117
|
+
ctx.fill_all("#050811")
|
|
118
|
+
cam.render_fog(ctx, fog_color="#050811", horizon_y_ratio=0.35)
|
|
119
|
+
vw.write_frame(img)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 📚 Complete API Documentation
|
|
125
|
+
|
|
126
|
+
For the complete 22-section master documentation and AI guidelines, see:
|
|
127
|
+
- [`DOCUMENTATION.md`](DOCUMENTATION.md)
|
|
128
|
+
- [`AI_RULES.md`](AI_RULES.md)
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NaraMotion: High-Performance 2D Vector Graphics Engine for Python powered by Blend2D.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from naramotion.enums import (
|
|
6
|
+
Format,
|
|
7
|
+
CompOp,
|
|
8
|
+
FillRule,
|
|
9
|
+
GeometryType,
|
|
10
|
+
ExtendMode,
|
|
11
|
+
GradientType,
|
|
12
|
+
StrokeCap,
|
|
13
|
+
StrokeCapPosition,
|
|
14
|
+
StrokeJoin,
|
|
15
|
+
StrokeTransformOrder,
|
|
16
|
+
TransformOp,
|
|
17
|
+
ClipOp,
|
|
18
|
+
FlattenMode,
|
|
19
|
+
RenderingEngine,
|
|
20
|
+
ResultCode,
|
|
21
|
+
ContextHint,
|
|
22
|
+
RenderingQuality,
|
|
23
|
+
GradientQuality,
|
|
24
|
+
PatternQuality,
|
|
25
|
+
RuntimeInfoType,
|
|
26
|
+
RuntimeCpuArch,
|
|
27
|
+
RuntimeCpuFeatures,
|
|
28
|
+
)
|
|
29
|
+
from naramotion.ffi import Blend2DError
|
|
30
|
+
from naramotion.geometry import (
|
|
31
|
+
Point,
|
|
32
|
+
PointI,
|
|
33
|
+
Size,
|
|
34
|
+
SizeI,
|
|
35
|
+
Rect,
|
|
36
|
+
RectI,
|
|
37
|
+
Box,
|
|
38
|
+
BoxI,
|
|
39
|
+
Circle,
|
|
40
|
+
Ellipse,
|
|
41
|
+
RoundRect,
|
|
42
|
+
Triangle,
|
|
43
|
+
Arc,
|
|
44
|
+
Line,
|
|
45
|
+
)
|
|
46
|
+
from naramotion.matrix import Matrix2D
|
|
47
|
+
from naramotion.color import (
|
|
48
|
+
Color,
|
|
49
|
+
Rgba32,
|
|
50
|
+
Rgba,
|
|
51
|
+
parse_color,
|
|
52
|
+
NAMED_COLORS,
|
|
53
|
+
)
|
|
54
|
+
from naramotion.image import Image
|
|
55
|
+
from naramotion.path import Path
|
|
56
|
+
from naramotion.style import (
|
|
57
|
+
Gradient,
|
|
58
|
+
LinearGradient,
|
|
59
|
+
RadialGradient,
|
|
60
|
+
ConicGradient,
|
|
61
|
+
Pattern,
|
|
62
|
+
)
|
|
63
|
+
from naramotion.font import (
|
|
64
|
+
FontFace,
|
|
65
|
+
Font,
|
|
66
|
+
FontMetrics,
|
|
67
|
+
TextMetrics,
|
|
68
|
+
)
|
|
69
|
+
from naramotion.context import Context
|
|
70
|
+
from naramotion.diagnostics import (
|
|
71
|
+
diagnose_environment,
|
|
72
|
+
print_diagnostic_report,
|
|
73
|
+
get_error_details,
|
|
74
|
+
get_runtime_info,
|
|
75
|
+
)
|
|
76
|
+
from naramotion import svg
|
|
77
|
+
from naramotion.svg import SvgContext, export_svg
|
|
78
|
+
from naramotion import video
|
|
79
|
+
from naramotion.video import (
|
|
80
|
+
VideoWriter,
|
|
81
|
+
VideoReader,
|
|
82
|
+
record_animation,
|
|
83
|
+
detect_hardware_encoders,
|
|
84
|
+
VideoError,
|
|
85
|
+
CodecNotFoundError,
|
|
86
|
+
FrameFormatError,
|
|
87
|
+
)
|
|
88
|
+
from naramotion import shapgeo
|
|
89
|
+
from naramotion.shapgeo import (
|
|
90
|
+
GeoCanvas,
|
|
91
|
+
GeoTransform,
|
|
92
|
+
from_shapely,
|
|
93
|
+
from_geojson,
|
|
94
|
+
from_wkt,
|
|
95
|
+
render_gdf,
|
|
96
|
+
auto_bounds,
|
|
97
|
+
compute_center,
|
|
98
|
+
get_center,
|
|
99
|
+
get_centroid,
|
|
100
|
+
read_file,
|
|
101
|
+
read_parquet,
|
|
102
|
+
read_shapefile,
|
|
103
|
+
read_geojson,
|
|
104
|
+
proj,
|
|
105
|
+
Transformer,
|
|
106
|
+
to_web_mercator,
|
|
107
|
+
to_wgs84,
|
|
108
|
+
reproject_gdf,
|
|
109
|
+
)
|
|
110
|
+
from naramotion.palette import Palette
|
|
111
|
+
from naramotion import motion
|
|
112
|
+
from naramotion.motion import (
|
|
113
|
+
Timeline,
|
|
114
|
+
Easing,
|
|
115
|
+
Spring,
|
|
116
|
+
Action,
|
|
117
|
+
DrawReveal,
|
|
118
|
+
Create,
|
|
119
|
+
ShowCreation,
|
|
120
|
+
Uncreate,
|
|
121
|
+
Typewriter,
|
|
122
|
+
Stagger,
|
|
123
|
+
interpolate,
|
|
124
|
+
Extrapolate,
|
|
125
|
+
chaikin_smooth,
|
|
126
|
+
chaikin_smooth_points,
|
|
127
|
+
Sequence,
|
|
128
|
+
Composition,
|
|
129
|
+
delay_render,
|
|
130
|
+
CubicBezier,
|
|
131
|
+
trim_path,
|
|
132
|
+
PathFollower,
|
|
133
|
+
PathMorph,
|
|
134
|
+
ParticleSystem,
|
|
135
|
+
Camera2D,
|
|
136
|
+
PerspectiveCamera,
|
|
137
|
+
render_globe,
|
|
138
|
+
Node,
|
|
139
|
+
Layer,
|
|
140
|
+
Scene,
|
|
141
|
+
)
|
|
142
|
+
from naramotion import fx
|
|
143
|
+
from naramotion.fx import (
|
|
144
|
+
FXPipeline,
|
|
145
|
+
gaussian_blur,
|
|
146
|
+
box_blur,
|
|
147
|
+
box_blur_integral,
|
|
148
|
+
bloom,
|
|
149
|
+
neon_glow,
|
|
150
|
+
drop_shadow,
|
|
151
|
+
chromatic_aberration,
|
|
152
|
+
vignette,
|
|
153
|
+
film_grain,
|
|
154
|
+
color_grade,
|
|
155
|
+
grayscale,
|
|
156
|
+
invert,
|
|
157
|
+
sepia,
|
|
158
|
+
tone_map_aces,
|
|
159
|
+
tone_map_reinhard,
|
|
160
|
+
scanlines,
|
|
161
|
+
glitch_displacement,
|
|
162
|
+
)
|
|
163
|
+
from naramotion.license import (
|
|
164
|
+
set_license,
|
|
165
|
+
is_licensed,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
# Alias geo -> shapgeo for developer convenience
|
|
169
|
+
geo = shapgeo
|
|
170
|
+
|
|
171
|
+
__version__ = "0.24.0"
|
|
172
|
+
__author__ = "Islam Arifi, NaraMotion Team, Blend2D Authors"
|
|
173
|
+
|
|
174
|
+
# Backward compatibility alias
|
|
175
|
+
import sys
|
|
176
|
+
sys.modules["blend2d"] = sys.modules[__name__]
|
|
177
|
+
|
|
178
|
+
__all__ = [
|
|
179
|
+
# Core
|
|
180
|
+
"Image",
|
|
181
|
+
"Context",
|
|
182
|
+
"Path",
|
|
183
|
+
"Blend2DError",
|
|
184
|
+
"set_license",
|
|
185
|
+
"is_licensed",
|
|
186
|
+
# Post-Processing FX Engine
|
|
187
|
+
"fx",
|
|
188
|
+
"FXPipeline",
|
|
189
|
+
"gaussian_blur",
|
|
190
|
+
"box_blur",
|
|
191
|
+
"bloom",
|
|
192
|
+
"neon_glow",
|
|
193
|
+
"drop_shadow",
|
|
194
|
+
"chromatic_aberration",
|
|
195
|
+
"vignette",
|
|
196
|
+
"film_grain",
|
|
197
|
+
"color_grade",
|
|
198
|
+
"grayscale",
|
|
199
|
+
"invert",
|
|
200
|
+
"sepia",
|
|
201
|
+
"scanlines",
|
|
202
|
+
"glitch_displacement",
|
|
203
|
+
# Motion Graphics & Animation Engine
|
|
204
|
+
"motion",
|
|
205
|
+
"Timeline",
|
|
206
|
+
"Easing",
|
|
207
|
+
"Spring",
|
|
208
|
+
"Action",
|
|
209
|
+
"DrawReveal",
|
|
210
|
+
"Create",
|
|
211
|
+
"ShowCreation",
|
|
212
|
+
"Uncreate",
|
|
213
|
+
"Typewriter",
|
|
214
|
+
"Stagger",
|
|
215
|
+
"interpolate",
|
|
216
|
+
"Extrapolate",
|
|
217
|
+
"chaikin_smooth",
|
|
218
|
+
"chaikin_smooth_points",
|
|
219
|
+
"Sequence",
|
|
220
|
+
"Composition",
|
|
221
|
+
"delay_render",
|
|
222
|
+
"CubicBezier",
|
|
223
|
+
"trim_path",
|
|
224
|
+
"PathFollower",
|
|
225
|
+
"PathMorph",
|
|
226
|
+
"ParticleSystem",
|
|
227
|
+
"Camera2D",
|
|
228
|
+
"PerspectiveCamera",
|
|
229
|
+
"render_globe",
|
|
230
|
+
"Node",
|
|
231
|
+
"Layer",
|
|
232
|
+
"Scene",
|
|
233
|
+
# Geospatial (GeoPandas & Shapely C++ Engine)
|
|
234
|
+
"shapgeo",
|
|
235
|
+
"geo",
|
|
236
|
+
"GeoCanvas",
|
|
237
|
+
"GeoTransform",
|
|
238
|
+
"from_shapely",
|
|
239
|
+
"from_geojson",
|
|
240
|
+
"from_wkt",
|
|
241
|
+
"render_gdf",
|
|
242
|
+
"auto_bounds",
|
|
243
|
+
"compute_center",
|
|
244
|
+
"get_center",
|
|
245
|
+
"get_centroid",
|
|
246
|
+
"read_file",
|
|
247
|
+
"read_parquet",
|
|
248
|
+
"read_shapefile",
|
|
249
|
+
"read_geojson",
|
|
250
|
+
"proj",
|
|
251
|
+
"Transformer",
|
|
252
|
+
"to_web_mercator",
|
|
253
|
+
"to_wgs84",
|
|
254
|
+
"reproject_gdf",
|
|
255
|
+
# Palette & Color Harmony
|
|
256
|
+
"Palette",
|
|
257
|
+
# Video & Native FFmpeg Engine
|
|
258
|
+
"video",
|
|
259
|
+
"VideoWriter",
|
|
260
|
+
"VideoReader",
|
|
261
|
+
"record_animation",
|
|
262
|
+
"detect_hardware_encoders",
|
|
263
|
+
"VideoError",
|
|
264
|
+
"CodecNotFoundError",
|
|
265
|
+
"FrameFormatError",
|
|
266
|
+
# SVG Vector Export
|
|
267
|
+
"svg",
|
|
268
|
+
"SvgContext",
|
|
269
|
+
"export_svg",
|
|
270
|
+
# Diagnostics & Troubleshooting
|
|
271
|
+
"diagnose_environment",
|
|
272
|
+
"print_diagnostic_report",
|
|
273
|
+
"get_error_details",
|
|
274
|
+
"get_runtime_info",
|
|
275
|
+
# Styles
|
|
276
|
+
"Gradient",
|
|
277
|
+
"LinearGradient",
|
|
278
|
+
"RadialGradient",
|
|
279
|
+
"ConicGradient",
|
|
280
|
+
"Pattern",
|
|
281
|
+
# Colors
|
|
282
|
+
"Rgba32",
|
|
283
|
+
"Rgba",
|
|
284
|
+
"parse_color",
|
|
285
|
+
"NAMED_COLORS",
|
|
286
|
+
# Typography
|
|
287
|
+
"FontFace",
|
|
288
|
+
"Font",
|
|
289
|
+
"FontMetrics",
|
|
290
|
+
"TextMetrics",
|
|
291
|
+
# Geometry
|
|
292
|
+
"Point",
|
|
293
|
+
"PointI",
|
|
294
|
+
"Size",
|
|
295
|
+
"SizeI",
|
|
296
|
+
"Rect",
|
|
297
|
+
"RectI",
|
|
298
|
+
"Box",
|
|
299
|
+
"BoxI",
|
|
300
|
+
"Circle",
|
|
301
|
+
"Ellipse",
|
|
302
|
+
"RoundRect",
|
|
303
|
+
"Triangle",
|
|
304
|
+
"Arc",
|
|
305
|
+
"Line",
|
|
306
|
+
"Matrix2D",
|
|
307
|
+
# Colors
|
|
308
|
+
"Color",
|
|
309
|
+
"Rgba32",
|
|
310
|
+
"Rgba",
|
|
311
|
+
"parse_color",
|
|
312
|
+
# Enums
|
|
313
|
+
"Format",
|
|
314
|
+
"CompOp",
|
|
315
|
+
"FillRule",
|
|
316
|
+
"GeometryType",
|
|
317
|
+
"ExtendMode",
|
|
318
|
+
"GradientType",
|
|
319
|
+
"StrokeCap",
|
|
320
|
+
"StrokeCapPosition",
|
|
321
|
+
"StrokeJoin",
|
|
322
|
+
"StrokeTransformOrder",
|
|
323
|
+
"TransformOp",
|
|
324
|
+
"ClipOp",
|
|
325
|
+
"FlattenMode",
|
|
326
|
+
"RenderingEngine",
|
|
327
|
+
"ResultCode",
|
|
328
|
+
"ContextHint",
|
|
329
|
+
"RenderingQuality",
|
|
330
|
+
"GradientQuality",
|
|
331
|
+
"PatternQuality",
|
|
332
|
+
"RuntimeInfoType",
|
|
333
|
+
"RuntimeCpuArch",
|
|
334
|
+
"RuntimeCpuFeatures",
|
|
335
|
+
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|