blob: 8d75c107c73cc02a8f76b30aaa88e42f74350477 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# TODO List for 2D Framebuffer Graphics Library (`fbgl`)
## Core Rendering
- [x] Implement pixel manipulation: set, get, and clear individual pixels with color data.
- [ ] Implement basic shapes:
- [x] Draw lines.
- [x] Draw rectangles.
- [x] Draw circles.
- [ ] Draw ellipses.
- [ ] Draw polygons.
- [x] Support filled versions of shapes.
- [x] Support outlined versions of shapes.
- [ ] Implement bitmap rendering:
- [x] Render 2D images (tga) to the framebuffer.
- [ ] Support transparency via alpha channels.
- [ ] Support transparency via a key color.
- [x] Implement text rendering using psf fonts.
---
## Color Handling
- [ ] Support RGB color format.
- [ ] Support grayscale color format.
- [ ] Support indexed color format.
- [ ] Add utility to convert between color formats.
- [ ] Support alpha blending for semi-transparent rendering.
---
## Window and Viewport
- [ ] Add windowing support:
- [ ] Define sub-framebuffers (windows) within the main framebuffer.
- [ ] Maintain independent clipping for each window.
- [ ] Implement clipping to respect rendering boundaries.
---
## Utilities and Effects
- [ ] Implement 2D transformations:
- [ ] Scaling.
- [ ] Rotation.
- [ ] Translation.
- [ ] Transform relative to origin or center.
- [ ] Add optional anti-aliasing for smoother shapes and lines.
- [ ] Implement image manipulation:
- [ ] Scale tga.
- [ ] Crop tga.
- [ ] Rotate tga.
- [ ] Implement gradients and patterns:
- [ ] Fill shapes with gradients.
- [ ] Fill shapes with pattern-based textures.
---
## Performance and Optimization
- [ ] Optimize batch rendering to minimize CPU cycles.
- [ ] Add hooks for hardware acceleration (optional).
---
## Integration
- [ ] Provide initialization routines for creating and managing a framebuffer.
- [ ] Ensure platform independence:
- [ ] Abstract hardware details for Linux framebuffer.
- [ ] Abstract hardware details for SDL2.
- [ ] Add support for reading framebuffer content to standard image formats (e.g., BMP, PNG).
- [ ] Add support for writing framebuffer content to standard image formats (e.g., BMP, PNG).
---
## Debugging and Diagnostics
- [ ] Develop diagnostics tools to inspect pixel data.
- [ ] Add debugging overlays (e.g., FPS, gridlines).
- [ ] Implement graceful error handling for out-of-bounds operations with informative messages.
|