e2D 2.0.0__cp313-cp313-win_amd64.whl → 2.0.2__cp313-cp313-win_amd64.whl

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.
e2D/winrec.pyi ADDED
@@ -0,0 +1,87 @@
1
+ from __future__ import annotations
2
+ from typing import Any
3
+
4
+ from typing import Optional
5
+ import numpy as np
6
+ import cv2
7
+ import threading
8
+ import queue
9
+
10
+ class WinRec:
11
+ """Asynchronous screen recorder for ModernGL-based e2D applications."""
12
+
13
+ rootEnv: Any
14
+ path: str
15
+ fps: int
16
+ draw_on_screen: bool
17
+ is_recording: bool
18
+ screenshot_counter: int
19
+ recording_frames: int
20
+ pause_start_time: Optional[float]
21
+ total_pause_duration: float
22
+ video_writer: cv2.VideoWriter
23
+ frame_buffer: np.ndarray
24
+ frame_queue: queue.Queue
25
+ running: bool
26
+ frames_written: int
27
+ frames_dropped: int
28
+ write_start_time: float
29
+ last_stat_update: float
30
+ current_write_fps: float
31
+ write_thread: threading.Thread
32
+
33
+ def __init__(
34
+ self,
35
+ rootEnv: Any,
36
+ fps: int = 30,
37
+ draw_on_screen: bool = True,
38
+ path: str = 'output.mp4'
39
+ ) -> None: ...
40
+
41
+ def _write_worker(self) -> None:
42
+ """Background thread that writes frames to video file."""
43
+ ...
44
+
45
+ def handle_input(self) -> None:
46
+ """Handle recording control keyboard inputs (F9-F12)."""
47
+ ...
48
+
49
+ def update(self) -> None:
50
+ """Capture frame from ModernGL framebuffer and queue for writing."""
51
+ ...
52
+
53
+ def get_rec_seconds(self) -> float:
54
+ """Get recorded time in seconds (excludes paused time)."""
55
+ ...
56
+
57
+ def draw(self) -> None:
58
+ """Draw recording statistics overlay on screen."""
59
+ ...
60
+
61
+ def pause(self) -> None:
62
+ """Pause recording (stop capturing frames)."""
63
+ ...
64
+
65
+ def resume(self) -> None:
66
+ """Resume recording (continue capturing frames)."""
67
+ ...
68
+
69
+ def toggle_recording(self) -> None:
70
+ """Toggle between pause and resume."""
71
+ ...
72
+
73
+ def restart(self) -> None:
74
+ """Restart recording: clear buffer, reset all counters and timers, resume recording."""
75
+ ...
76
+
77
+ def clear_buffer(self) -> None:
78
+ """Clear the frame queue and reset write statistics."""
79
+ ...
80
+
81
+ def take_screenshot(self, filename: Optional[str] = None) -> str:
82
+ """Save current screen as PNG screenshot."""
83
+ ...
84
+
85
+ def quit(self) -> None:
86
+ """Stop recording and release resources."""
87
+ ...
@@ -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
 
@@ -0,0 +1,46 @@
1
+ e2D/__init__.py,sha256=4nHe2BM_96KpCiIyou-vXMRZYpb29J0iyss_tZw1l1I,21367
2
+ e2D/__init__.pyi,sha256=GDsOLGkttx3m6j_5fQoMWiM6wAEnlM5VhLtdHQa1qQg,5389
3
+ e2D/ccolors.c,sha256=Jwq7_RSoivaWCu22YVe-Bc9PthbN37G_legE17w49Dg,1362725
4
+ e2D/ccolors.cp313-win_amd64.pyd,sha256=TLAOCFubcc9rYbzmUFrQeu9RvmkJSKJ59DHTnQl6PB8,184320
5
+ e2D/ccolors.pyi,sha256=YigNgTp0YWL4sdJs9Twb5gfWDgD0R0ic5WnGoCIVYmI,1157
6
+ e2D/ccolors.pyx,sha256=d11z7TLFKPAw5Xz1LA2_Xh27xWGzmqoQD0aMcWHy1PY,10116
7
+ e2D/color_defs.py,sha256=9zMRdGGDENjhaSDmFA0V-Nxtga_Q5sJUL1RwigXq6sI,9475
8
+ e2D/colors.py,sha256=ntuaRWf3EZf7FQlaKQqEVZRJoP7L-Wz2k9e12Onh4Mk,12981
9
+ e2D/colors.pyi,sha256=swdU3wcIoh4kEVY7lKv50zw2OyO2XDO4pqTJ3HetWp8,3917
10
+ e2D/commons.py,sha256=HHCns8CpKw51R6jlsrItwINVTULqOnk3bhUuIPT4_60,3732
11
+ e2D/commons.pyi,sha256=gMXLKPM2I8DHs3ZbFNa2K1iRp4VWqiauMub5kT4cslE,2153
12
+ e2D/cvectors.c,sha256=zv03i5AJTHPM8xJO5zY289OGj6afd2froVCOXJp9I0o,1222782
13
+ e2D/cvectors.cp313-win_amd64.pyd,sha256=tL8ZyK2ZQl-YnV1G1M2sC8N06f3RKN7Yy7gqyAvOnKc,228864
14
+ e2D/cvectors.pxd,sha256=7y2VUafKkVFezGQioTlF66dy4g5aNbGnGLhLtHZpuM4,2137
15
+ e2D/cvectors.pyi,sha256=DbhamdowlGb4e-FhAUQDW-NlWCOPTNrxeQOs73DzvKE,6895
16
+ e2D/cvectors.pyx,sha256=xJW6dD6JikkUXy0cuytgIijZJLcTpzJ0NpJ-aIErdzg,19048
17
+ e2D/devices.py,sha256=PYEayxU78qTUlTMN5qmiE5PgqOlzupzIFui-yzOXxxo,2903
18
+ e2D/devices.pyi,sha256=A7MYcTGcQ7kyj6A6d0kAIXyK6C4n5rZkfeUJkZIkZFY,1859
19
+ e2D/plots.py,sha256=PhrsZoip07y6tqwWguNVAk2TlTM1F4b6Ovi3ByEsZFI,21982
20
+ e2D/plots.pyi,sha256=HHtNg9eMCHijfTVPCfRjGgY2h9CgEdgy_bgMHUGZL9k,6645
21
+ e2D/shapes.py,sha256=dOXt-OY8-LaBwpNKBcqfvuDsvzeL9x8Pg6QkjW_T0cI,45823
22
+ e2D/shapes.pyi,sha256=Dp5QyZ91fw8sWGZ3048cKMegETBnmsejHZ12XAr-F3A,8357
23
+ e2D/test_colors.py,sha256=rWgCrV4nj8jtK4fh89aW76Gl7R8QyGPeb5AJ3hWFsxY,3872
24
+ e2D/text_renderer.py,sha256=054Vl_tsV8DU-E17JB8a5FAcXq2m6UqlPahTa_NhM74,21015
25
+ e2D/text_renderer.pyi,sha256=Bylzoy_HX-Bu1viKzYQR9pfHRK5ywUXiamtqoUcaw94,3199
26
+ e2D/types.py,sha256=eJGqMWKlEk_bX-_B4mcZo5at22DKOEuPr-Nn_bZcvCE,1764
27
+ e2D/types.pyi,sha256=INQYPvpGcQH9cgKzUiAPYDabazOyf2lNTbzW_LUV9hU,1595
28
+ e2D/vectors.py,sha256=ViZwLpLmfkIEdBDYRpv69Yaf-nishh-Q5LXmZzkkjCg,11519
29
+ e2D/vectors.pyi,sha256=Fc1hPx1PCqJ_K3cVDg3R9W_yq5E21RzgOJVJB09kfhY,2399
30
+ e2D/winrec.py,sha256=--KZZsUUIH0w_TD91MpFAwcMCCdFyzKz4RL6V4h0LEY,11281
31
+ e2D/winrec.pyi,sha256=5uOJA6_ANS4UnFCP281o0wnQOozFwZoThId-ibBzMj0,2393
32
+ e2D/shaders/curve_fragment.glsl,sha256=tKI3rDSlJPrWrQiATn6Rf4bJv7YGWVF6sgU9Y5H5qOk,94
33
+ e2D/shaders/curve_vertex.glsl,sha256=uEp9OwcTSB_EfJhQRkNPalpT6jvJ2FO42vnPeKZl9J8,324
34
+ e2D/shaders/line_instanced_vertex.glsl,sha256=r4XUNFogDH-Q9d_uXZQcT47iuiO8LeYXbEbqzRCFKSo,1049
35
+ e2D/shaders/plot_grid_fragment.glsl,sha256=rOKW6Bold7d9Bunaf1SJeLYOgbsHfKk_UVFGMpkMq4c,1338
36
+ e2D/shaders/plot_grid_vertex.glsl,sha256=-t8E3D0KBjaxIFbhZl87A0_4TzJ7fmajyLXoAaLu7_M,139
37
+ e2D/shaders/segment_fragment.glsl,sha256=tKI3rDSlJPrWrQiATn6Rf4bJv7YGWVF6sgU9Y5H5qOk,94
38
+ e2D/shaders/segment_vertex.glsl,sha256=I-hgbl2SnR5tWH9KRhz3CCj3ZZ7poz_gUfph1ydisaQ,233
39
+ e2D/shaders/stream_fragment.glsl,sha256=EBI2wXv_LjoikQ3sbPtRw5gA5lIeLimNBUSoU6UWSqM,246
40
+ e2D/shaders/stream_shift_compute.glsl,sha256=nwTD8IJjsFpl2XUXInc8IBDdW-DOmvaMLygLdquidyg,290
41
+ e2D/shaders/stream_vertex.glsl,sha256=Wxa8YtgxlMNL7OYq5LwqoOA_B4iRilC5_ArznyT018Y,608
42
+ e2d-2.0.2.dist-info/licenses/LICENSE,sha256=hbjljn38VVW9en51B0qzRK-v2FBDijqRWbZIVTk7ipU,1094
43
+ e2d-2.0.2.dist-info/METADATA,sha256=4FGqpudVja0bpGK8VZOGa4HkP5AkrhD6rx7i87BdmfE,9092
44
+ e2d-2.0.2.dist-info/WHEEL,sha256=-WvvtQtdhM1F5HMi-4hSXLQ_1Tg6qJRWO1HnLNr4mCU,102
45
+ e2d-2.0.2.dist-info/top_level.txt,sha256=3vKZ-CGzNlTCpzVMmM0Ht76krCofKw7hZ0wBf-dnKdM,4
46
+ e2d-2.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp313-cp313-win_amd64
5
5
 
@@ -1,26 +0,0 @@
1
- e2D/__init__.py,sha256=rNGyv9X8ZdmTJvgjXaO8SKGTnQlrvhtIBF8PP3VpBFA,18054
2
- e2D/commons.py,sha256=vs6UqYGtm2-oHfv5kCSjMaQ243Xq6OqWh4Jt520H6Ho,2522
3
- e2D/cvectors.c,sha256=Rqj99mKXScJ2OMc4y5KSBXhjLyuV4bP7T5v-nOgEooY,1222782
4
- e2D/cvectors.cp313-win_amd64.pyd,sha256=_gzGIOVkH7XbiEr2fQ_QjCkuOytuzPqWgscRqUL2xmE,228864
5
- e2D/cvectors.pxd,sha256=7y2VUafKkVFezGQioTlF66dy4g5aNbGnGLhLtHZpuM4,2137
6
- e2D/cvectors.pyx,sha256=xJW6dD6JikkUXy0cuytgIijZJLcTpzJ0NpJ-aIErdzg,19048
7
- e2D/devices.py,sha256=iAUNXSSD0wEqLqHV6ET3dcqx4C62ifxaXcN_8xaV7sI,2440
8
- e2D/plots.py,sha256=gaCnnA-gUY1Hnmgquo7mqWlxSzAY4swTfwoPmw9ZF2k,21272
9
- e2D/shapes.py,sha256=PY2G0EFCLqERTR0UfK8jqSanh5wwIBTYRPA5a6LRs7w,45450
10
- e2D/text_renderer.py,sha256=u3i0qxnqgnVGUB6f0bKb1QtElVe535cDIIpjtRRcLAY,19752
11
- e2D/vectors.py,sha256=WXNzaA1bLjM5movVWOn7gDy73H1xA0cavlP7djO1FSc,6781
12
- e2D/shaders/curve_fragment.glsl,sha256=tKI3rDSlJPrWrQiATn6Rf4bJv7YGWVF6sgU9Y5H5qOk,94
13
- e2D/shaders/curve_vertex.glsl,sha256=uEp9OwcTSB_EfJhQRkNPalpT6jvJ2FO42vnPeKZl9J8,324
14
- e2D/shaders/line_instanced_vertex.glsl,sha256=r4XUNFogDH-Q9d_uXZQcT47iuiO8LeYXbEbqzRCFKSo,1049
15
- e2D/shaders/plot_grid_fragment.glsl,sha256=rOKW6Bold7d9Bunaf1SJeLYOgbsHfKk_UVFGMpkMq4c,1338
16
- e2D/shaders/plot_grid_vertex.glsl,sha256=-t8E3D0KBjaxIFbhZl87A0_4TzJ7fmajyLXoAaLu7_M,139
17
- e2D/shaders/segment_fragment.glsl,sha256=tKI3rDSlJPrWrQiATn6Rf4bJv7YGWVF6sgU9Y5H5qOk,94
18
- e2D/shaders/segment_vertex.glsl,sha256=I-hgbl2SnR5tWH9KRhz3CCj3ZZ7poz_gUfph1ydisaQ,233
19
- e2D/shaders/stream_fragment.glsl,sha256=EBI2wXv_LjoikQ3sbPtRw5gA5lIeLimNBUSoU6UWSqM,246
20
- e2D/shaders/stream_shift_compute.glsl,sha256=nwTD8IJjsFpl2XUXInc8IBDdW-DOmvaMLygLdquidyg,290
21
- e2D/shaders/stream_vertex.glsl,sha256=Wxa8YtgxlMNL7OYq5LwqoOA_B4iRilC5_ArznyT018Y,608
22
- e2d-2.0.0.dist-info/licenses/LICENSE,sha256=hbjljn38VVW9en51B0qzRK-v2FBDijqRWbZIVTk7ipU,1094
23
- e2d-2.0.0.dist-info/METADATA,sha256=EKooTJt_akYAd3s_-S7pvJlmnogTloMGmR-pFnutUMc,7117
24
- e2d-2.0.0.dist-info/WHEEL,sha256=T5i2ODeLs0s2las6bzoWK6w-WYjxkhtXh7SRJsBsjo4,102
25
- e2d-2.0.0.dist-info/top_level.txt,sha256=3vKZ-CGzNlTCpzVMmM0Ht76krCofKw7hZ0wBf-dnKdM,4
26
- e2d-2.0.0.dist-info/RECORD,,