Skip to content

Commit b74e039

Browse files
author
Esther Alter
committed
Added softbuffer-rgb to the newsletter
1 parent 0ea4f35 commit b74e039

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: content/news/053/index.md

+19
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ There you can also find a [progress overview](https://godot.rapier.rs/docs/progr
149149
[godot_rapier_reddit]: https://www.reddit.com/r/godot/comments/1dtoufn/rewriting_godots_physics_server_in_rust/
150150
[godot]: https://godotengine.org/
151151

152+
### softbuffer-rgb
153+
154+
[softbuffer-rgb](https://crates.io/crates/softbuffer-rgb) is a wrapper around [softbuffer](https://docs.rs/softbuffer/latest/softbuffer/) that makes it easier to modify a raw pixel buffer.
155+
156+
Instead of doing this:
157+
158+
```
159+
buffer.buffer_mut()[y * width + x] = u32::from_le_bytes([0, 200, 70, 10]);
160+
```
161+
162+
...you can now do this:
163+
164+
```
165+
buffer.pixels[y][x] = [0, 200, 70, 10];
166+
```
167+
168+
To put it another way: It rearranges the raw pixel buffer from `[u32; width * height]` into `[[[u8; 4]; width]; height]`
169+
170+
152171
## Popular Workgroup Issues in GitHub
153172

154173
<!-- Up to 10 links to interesting issues -->

0 commit comments

Comments
 (0)