e2D 2.0.0__tar.gz → 2.0.2__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.
Files changed (60) hide show
  1. {e2d-2.0.0 → e2d-2.0.2}/MANIFEST.in +1 -1
  2. {e2d-2.0.0/e2D.egg-info → e2d-2.0.2}/PKG-INFO +95 -26
  3. {e2d-2.0.0 → e2d-2.0.2}/README.md +87 -23
  4. {e2d-2.0.0 → e2d-2.0.2}/e2D/__init__.py +199 -72
  5. e2d-2.0.2/e2D/__init__.pyi +145 -0
  6. e2d-2.0.2/e2D/ccolors.c +34514 -0
  7. e2d-2.0.2/e2D/ccolors.pyi +51 -0
  8. e2d-2.0.2/e2D/ccolors.pyx +350 -0
  9. e2d-2.0.2/e2D/color_defs.py +238 -0
  10. e2d-2.0.2/e2D/colors.py +380 -0
  11. e2d-2.0.2/e2D/colors.pyi +104 -0
  12. e2d-2.0.2/e2D/commons.py +84 -0
  13. e2d-2.0.2/e2D/commons.pyi +79 -0
  14. {e2d-2.0.0 → e2d-2.0.2}/e2D/cvectors.c +152 -152
  15. e2d-2.0.2/e2D/cvectors.pyi +243 -0
  16. {e2d-2.0.0 → e2d-2.0.2}/e2D/devices.py +19 -6
  17. e2d-2.0.2/e2D/devices.pyi +65 -0
  18. {e2d-2.0.0 → e2d-2.0.2}/e2D/plots.py +55 -29
  19. e2d-2.0.2/e2D/plots.pyi +238 -0
  20. {e2d-2.0.0 → e2d-2.0.2}/e2D/shapes.py +81 -44
  21. e2d-2.0.2/e2D/shapes.pyi +272 -0
  22. e2d-2.0.2/e2D/test_colors.py +122 -0
  23. {e2d-2.0.0 → e2d-2.0.2}/e2D/text_renderer.py +46 -16
  24. e2d-2.0.2/e2D/text_renderer.pyi +118 -0
  25. e2d-2.0.2/e2D/types.py +58 -0
  26. e2d-2.0.2/e2D/types.pyi +61 -0
  27. e2d-2.0.2/e2D/vectors.py +339 -0
  28. e2d-2.0.2/e2D/vectors.pyi +106 -0
  29. e2d-2.0.2/e2D/winrec.py +275 -0
  30. e2d-2.0.2/e2D/winrec.pyi +87 -0
  31. {e2d-2.0.0 → e2d-2.0.2/e2D.egg-info}/PKG-INFO +95 -26
  32. {e2d-2.0.0 → e2d-2.0.2}/e2D.egg-info/SOURCES.txt +20 -6
  33. {e2d-2.0.0 → e2d-2.0.2}/e2D.egg-info/requires.txt +8 -1
  34. {e2d-2.0.0 → e2d-2.0.2}/pyproject.toml +9 -2
  35. {e2d-2.0.0 → e2d-2.0.2}/setup.cfg +10 -5
  36. {e2d-2.0.0 → e2d-2.0.2}/setup.py +10 -0
  37. e2d-2.0.0/e2D/commons.py +0 -56
  38. e2d-2.0.0/e2D/vectors.py +0 -247
  39. e2d-2.0.0/examples/compare_performance.py +0 -166
  40. e2d-2.0.0/examples/default.py +0 -96
  41. e2d-2.0.0/examples/example_usage.py +0 -168
  42. e2d-2.0.0/examples/graphs.py +0 -181
  43. e2d-2.0.0/examples/shapes_demo.py +0 -233
  44. {e2d-2.0.0 → e2d-2.0.2}/LICENSE +0 -0
  45. {e2d-2.0.0 → e2d-2.0.2}/QUICKSTART.md +0 -0
  46. {e2d-2.0.0 → e2d-2.0.2}/e2D/cvectors.pxd +0 -0
  47. {e2d-2.0.0 → e2d-2.0.2}/e2D/cvectors.pyx +0 -0
  48. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/curve_fragment.glsl +0 -0
  49. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/curve_vertex.glsl +0 -0
  50. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/line_instanced_vertex.glsl +0 -0
  51. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/plot_grid_fragment.glsl +0 -0
  52. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/plot_grid_vertex.glsl +0 -0
  53. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/segment_fragment.glsl +0 -0
  54. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/segment_vertex.glsl +0 -0
  55. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/stream_fragment.glsl +0 -0
  56. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/stream_shift_compute.glsl +0 -0
  57. {e2d-2.0.0 → e2d-2.0.2}/e2D/shaders/stream_vertex.glsl +0 -0
  58. {e2d-2.0.0 → e2d-2.0.2}/e2D.egg-info/dependency_links.txt +0 -0
  59. {e2d-2.0.0 → e2d-2.0.2}/e2D.egg-info/not-zip-safe +0 -0
  60. {e2d-2.0.0 → e2d-2.0.2}/e2D.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  # Include Cython source files for compilation during install
2
2
  include e2D/*.pyx
3
3
  include e2D/*.pxd
4
- include e2D/*.c
4
+ include e2D/*.pyi
5
5
 
6
6
  # Include shader files
7
7
  recursive-include e2D/shaders *.glsl
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: e2D
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: High-performance 2D graphics and math library with ultra-optimized vector operations
5
5
  Home-page: https://github.com/marick-py/e2D
6
6
  Author: Riccardo Mariani
7
- Author-email: Riccardo Mariani <ricomari2006@gmail.com>
7
+ Author-email: Riccardo Mariani <riccardo.mariani@emptyhead.dev>
8
8
  License: MIT
9
9
  Project-URL: Homepage, https://github.com/marick-py/e2D
10
10
  Project-URL: Repository, https://github.com/marick-py/e2D
@@ -30,9 +30,10 @@ Requires-Python: >=3.9
30
30
  Description-Content-Type: text/markdown
31
31
  License-File: LICENSE
32
32
  Requires-Dist: numpy>=1.19.0
33
- Requires-Dist: pygame
34
33
  Requires-Dist: moderngl
35
34
  Requires-Dist: glfw
35
+ Requires-Dist: Pillow>=8.0.0
36
+ Requires-Dist: attrs
36
37
  Provides-Extra: dev
37
38
  Requires-Dist: build; extra == "dev"
38
39
  Requires-Dist: twine; extra == "dev"
@@ -41,6 +42,10 @@ Requires-Dist: black; extra == "dev"
41
42
  Requires-Dist: mypy; extra == "dev"
42
43
  Provides-Extra: performance
43
44
  Requires-Dist: cython>=0.29.0; extra == "performance"
45
+ Provides-Extra: rec
46
+ Requires-Dist: opencv-python; extra == "rec"
47
+ Provides-Extra: all
48
+ Requires-Dist: opencv-python; extra == "all"
44
49
  Dynamic: license-file
45
50
 
46
51
  # e2D - High-Performance 2D Graphics and Math Library
@@ -62,7 +67,9 @@ Dynamic: license-file
62
67
  ### 🎮 Modern Graphics
63
68
  - **ModernGL** rendering pipeline
64
69
  - **Shape rendering** with instancing support
65
- - **Text rendering** with custom styles
70
+ - **Text rendering** with custom styles and TTF fonts
71
+ - **Screen recording** with async video encoding
72
+ - **Color system** with 80+ pre-defined colors
66
73
  - **GLFW window management**
67
74
 
68
75
  ### 🎯 Game Development Tools
@@ -73,18 +80,51 @@ Dynamic: license-file
73
80
 
74
81
  ## 📦 Installation
75
82
 
83
+ ### Basic Installation
84
+
76
85
  ```bash
77
86
  pip install e2D
78
87
  ```
79
88
 
80
89
  The package will automatically compile the Cython extensions during installation for optimal performance (like numpy). If compilation fails, it falls back to pure Python mode.
81
90
 
91
+ ### Optional Features
92
+
93
+ Install with screen recording support:
94
+ ```bash
95
+ pip install e2D[rec]
96
+ ```
97
+
98
+ Install for development (includes testing tools):
99
+ ```bash
100
+ pip install e2D[dev]
101
+ ```
102
+
103
+ Install with performance monitoring (includes Cython source):
104
+ ```bash
105
+ pip install e2D[performance]
106
+ ```
107
+
108
+ Install everything:
109
+ ```bash
110
+ pip install e2D[all]
111
+ ```
112
+
113
+ ### Legacy Version (1.x with Pygame)
114
+
115
+ If you need the old pygame-based version:
116
+ ```bash
117
+ pip install "e2D<2.0"
118
+ ```
119
+
82
120
  ### Requirements
83
121
  - Python 3.9+
84
- - NumPy
85
- - ModernGL
86
- - GLFW
87
- - Pygame
122
+ - NumPy (required)
123
+ - ModernGL (required)
124
+ - GLFW (required)
125
+ - Pillow (required - for text rendering)
126
+ - attrs (required - for data structures)
127
+ - OpenCV-Python (optional, for recording - install with `[rec]` extra)
88
128
 
89
129
  ## 🚀 Quick Start
90
130
 
@@ -119,26 +159,50 @@ pos_array = vectors_to_array(positions)
119
159
  ### Graphics Rendering
120
160
 
121
161
  ```python
122
- from e2D import RootEnv
123
-
124
- class MyApp(RootEnv):
125
- def __init__(self):
126
- super().__init__(
127
- window_size=(1920, 1080),
128
- target_fps=60,
129
- vsync=True
130
- )
162
+ from e2D import RootEnv, DefEnv
163
+
164
+ class MyApp(DefEnv):
165
+ def __init__(self) -> None:
166
+ pass
131
167
 
132
- def update(self):
168
+ def update(self) -> None:
133
169
  # Your game logic here
134
170
  pass
135
171
 
136
- def draw(self):
172
+ def draw(self) -> None:
137
173
  # Your rendering code here
138
174
  pass
139
175
 
140
- app = MyApp()
141
- app.run()
176
+ # Initialize and run
177
+ rootEnv = RootEnv(window_size=(1920, 1080), target_fps=60)
178
+ rootEnv.init(MyApp())
179
+
180
+ # Optional: Enable screen recording
181
+ rootEnv.init_rec(fps=30, draw_on_screen=True, path='output.mp4')
182
+
183
+ rootEnv.loop()
184
+ ```
185
+
186
+ ### Color System
187
+
188
+ ```python
189
+ from e2D import Color, WHITE, RED, CYAN, normalize_color
190
+ from e2D.color_defs import MD_BLUE, PASTEL_PINK, NEON_GREEN
191
+
192
+ # Create colors
193
+ color1 = Color.from_hex("#FF5733")
194
+ color2 = Color.from_rgb255(100, 150, 200)
195
+ color3 = Color.from_hsv(0.5, 0.8, 1.0)
196
+
197
+ # Color operations
198
+ lighter = color1.lighten(0.2)
199
+ darker = color1.darken(0.2)
200
+ inverted = color1.invert()
201
+ rotated = color1.rotate_hue(120)
202
+
203
+ # Use pre-defined colors
204
+ from e2D import draw_circle
205
+ draw_circle((100, 100), 50, color=RED, fill_mode='fill')
142
206
  ```
143
207
 
144
208
  ## 📊 Performance
@@ -162,9 +226,9 @@ Perfect for:
162
226
 
163
227
  ## 📚 Documentation
164
228
 
229
+ - **[API Reference](docs/API_REFERENCE.md)** - Complete API documentation
165
230
  - **[Quick Start Guide](QUICKSTART.md)** - Get up and running in minutes
166
- - **[API Reference](https://github.com/marick-py/e2D)** - Full API documentation
167
- - **[Examples](examples/)** - Working code examples
231
+ - **[Developer Guide](DEVELOPER_GUIDE.md)** - Development workflow and contributing
168
232
 
169
233
  ## 🎯 Use Cases
170
234
 
@@ -239,7 +303,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
239
303
  ## 👤 Author
240
304
 
241
305
  **Riccardo Mariani**
242
- - Email: ricomari2006@gmail.com
306
+ - Email: riccardo.mariani@emptyhead.dev
243
307
  - GitHub: [@marick-py](https://github.com/marick-py)
244
308
 
245
309
  ## 🙏 Acknowledgments
@@ -250,8 +314,13 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
250
314
 
251
315
  ## 📈 Version History
252
316
 
253
- - **2.0.0** - Added ultra-optimized Vector2D with Cython compilation
254
- - **1.4.24** - Previous stable release with pure Python vectors
317
+ ### Version 2.x (ModernGL-based - Current)
318
+ - **2.0.2** (Current) - Bug fixes and documentation improvements
319
+ - **2.0.0** - Complete rewrite with ModernGL rendering, Cython-optimized vectors, modern color system, screen recording, removed pygame dependency
320
+
321
+ ### Version 1.x (Pygame-based - Legacy)
322
+ - **1.4.24** - Previous stable release with pure Python vectors and pygame
323
+ - Legacy versions available via: `pip install "e2D<2.0"`
255
324
 
256
325
  ---
257
326
 
@@ -17,7 +17,9 @@
17
17
  ### 🎮 Modern Graphics
18
18
  - **ModernGL** rendering pipeline
19
19
  - **Shape rendering** with instancing support
20
- - **Text rendering** with custom styles
20
+ - **Text rendering** with custom styles and TTF fonts
21
+ - **Screen recording** with async video encoding
22
+ - **Color system** with 80+ pre-defined colors
21
23
  - **GLFW window management**
22
24
 
23
25
  ### 🎯 Game Development Tools
@@ -28,18 +30,51 @@
28
30
 
29
31
  ## 📦 Installation
30
32
 
33
+ ### Basic Installation
34
+
31
35
  ```bash
32
36
  pip install e2D
33
37
  ```
34
38
 
35
39
  The package will automatically compile the Cython extensions during installation for optimal performance (like numpy). If compilation fails, it falls back to pure Python mode.
36
40
 
41
+ ### Optional Features
42
+
43
+ Install with screen recording support:
44
+ ```bash
45
+ pip install e2D[rec]
46
+ ```
47
+
48
+ Install for development (includes testing tools):
49
+ ```bash
50
+ pip install e2D[dev]
51
+ ```
52
+
53
+ Install with performance monitoring (includes Cython source):
54
+ ```bash
55
+ pip install e2D[performance]
56
+ ```
57
+
58
+ Install everything:
59
+ ```bash
60
+ pip install e2D[all]
61
+ ```
62
+
63
+ ### Legacy Version (1.x with Pygame)
64
+
65
+ If you need the old pygame-based version:
66
+ ```bash
67
+ pip install "e2D<2.0"
68
+ ```
69
+
37
70
  ### Requirements
38
71
  - Python 3.9+
39
- - NumPy
40
- - ModernGL
41
- - GLFW
42
- - Pygame
72
+ - NumPy (required)
73
+ - ModernGL (required)
74
+ - GLFW (required)
75
+ - Pillow (required - for text rendering)
76
+ - attrs (required - for data structures)
77
+ - OpenCV-Python (optional, for recording - install with `[rec]` extra)
43
78
 
44
79
  ## 🚀 Quick Start
45
80
 
@@ -74,26 +109,50 @@ pos_array = vectors_to_array(positions)
74
109
  ### Graphics Rendering
75
110
 
76
111
  ```python
77
- from e2D import RootEnv
78
-
79
- class MyApp(RootEnv):
80
- def __init__(self):
81
- super().__init__(
82
- window_size=(1920, 1080),
83
- target_fps=60,
84
- vsync=True
85
- )
112
+ from e2D import RootEnv, DefEnv
113
+
114
+ class MyApp(DefEnv):
115
+ def __init__(self) -> None:
116
+ pass
86
117
 
87
- def update(self):
118
+ def update(self) -> None:
88
119
  # Your game logic here
89
120
  pass
90
121
 
91
- def draw(self):
122
+ def draw(self) -> None:
92
123
  # Your rendering code here
93
124
  pass
94
125
 
95
- app = MyApp()
96
- app.run()
126
+ # Initialize and run
127
+ rootEnv = RootEnv(window_size=(1920, 1080), target_fps=60)
128
+ rootEnv.init(MyApp())
129
+
130
+ # Optional: Enable screen recording
131
+ rootEnv.init_rec(fps=30, draw_on_screen=True, path='output.mp4')
132
+
133
+ rootEnv.loop()
134
+ ```
135
+
136
+ ### Color System
137
+
138
+ ```python
139
+ from e2D import Color, WHITE, RED, CYAN, normalize_color
140
+ from e2D.color_defs import MD_BLUE, PASTEL_PINK, NEON_GREEN
141
+
142
+ # Create colors
143
+ color1 = Color.from_hex("#FF5733")
144
+ color2 = Color.from_rgb255(100, 150, 200)
145
+ color3 = Color.from_hsv(0.5, 0.8, 1.0)
146
+
147
+ # Color operations
148
+ lighter = color1.lighten(0.2)
149
+ darker = color1.darken(0.2)
150
+ inverted = color1.invert()
151
+ rotated = color1.rotate_hue(120)
152
+
153
+ # Use pre-defined colors
154
+ from e2D import draw_circle
155
+ draw_circle((100, 100), 50, color=RED, fill_mode='fill')
97
156
  ```
98
157
 
99
158
  ## 📊 Performance
@@ -117,9 +176,9 @@ Perfect for:
117
176
 
118
177
  ## 📚 Documentation
119
178
 
179
+ - **[API Reference](docs/API_REFERENCE.md)** - Complete API documentation
120
180
  - **[Quick Start Guide](QUICKSTART.md)** - Get up and running in minutes
121
- - **[API Reference](https://github.com/marick-py/e2D)** - Full API documentation
122
- - **[Examples](examples/)** - Working code examples
181
+ - **[Developer Guide](DEVELOPER_GUIDE.md)** - Development workflow and contributing
123
182
 
124
183
  ## 🎯 Use Cases
125
184
 
@@ -194,7 +253,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
194
253
  ## 👤 Author
195
254
 
196
255
  **Riccardo Mariani**
197
- - Email: ricomari2006@gmail.com
256
+ - Email: riccardo.mariani@emptyhead.dev
198
257
  - GitHub: [@marick-py](https://github.com/marick-py)
199
258
 
200
259
  ## 🙏 Acknowledgments
@@ -205,8 +264,13 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
205
264
 
206
265
  ## 📈 Version History
207
266
 
208
- - **2.0.0** - Added ultra-optimized Vector2D with Cython compilation
209
- - **1.4.24** - Previous stable release with pure Python vectors
267
+ ### Version 2.x (ModernGL-based - Current)
268
+ - **2.0.2** (Current) - Bug fixes and documentation improvements
269
+ - **2.0.0** - Complete rewrite with ModernGL rendering, Cython-optimized vectors, modern color system, screen recording, removed pygame dependency
270
+
271
+ ### Version 1.x (Pygame-based - Legacy)
272
+ - **1.4.24** - Previous stable release with pure Python vectors and pygame
273
+ - Legacy versions available via: `pip install "e2D<2.0"`
210
274
 
211
275
  ---
212
276