Rust Embedded Graphics

69 Members
Help and chat for embedded-graphics and the wider embedded Rust graphics ecosystem | https://github.com/jamwaffles/embedded-graphics | https://crates.io/crates/embedded-graphics9 Servers

Load older messages

17 Sep 2020
@reflog:matrix.orgreflogone sec, gonna push the repo09:56:15
@reflog:matrix.orgreflogrelevant files: game/src/main.rs and shared/src/lib.rs09:59:46
@jamwaffles:matrix.orgjamwafflesCheers for that. I'll take a look when I've got a spare minute09:59:48
@reflog:matrix.orgreflogthanks for taking a look!09:59:50
@jamwaffles:matrix.orgjamwafflesNo prob!09:59:56
@jamwaffles:matrix.orgjamwaffles You're not wrapping the Tga in an Image in shared/src/lib.rs. pixel_iter() is on Image (provided by e-g), not Tga 10:03:46
@jamwaffles:matrix.orgjamwafflesHold on that might not be right... let me look a bit harder10:06:48

tinytga requires the graphics feature to be enabled. In shared/Cargo.toml:

tinytga= { version = "", features = [ "graphics" ] }

We're looking to change this in https://github.com/jamwaffles/embedded-graphics/issues/422 so it will be less of a pain in the future.

FWIW you should also be able to change your draw() method in shared/src/lib.rs to this one liner:

Image::new(&self.image, self.offset).draw(display);
@jamwaffles:matrix.orgjamwaffles I did see a strange error when adding .unwrap() to the end but that's a different issue now 10:25:51
@jamwaffles:matrix.orgjamwaffles ... which is fixable by adding a DT::Error: core::fmt::Debug trait bound 10:26:43
@jamwaffles:matrix.orgjamwaffles Also note that your image might not look correct if you have to convert between bit depths. One solution to this is given here. It's not that clean (or performant AFAIK) but works for now 10:27:42
@reflog:matrix.orgreflogamazing. thank you!11:13:40
Download image.png
@reflog:matrix.orgreflogAnother question (sorry for bombarding you) - rendering TinyTGA to RGB888 display works great. But when changing to RGB565 display - the result is garbage: 15:37:21
@reflog:matrix.orgreflogthe actual image looks like:15:37:39
Download ground.png
@reflog:matrix.orgreflogshould I convert the TGA file somehow to be digestible on 565?15:38:22

Idk I think "acid trip mode" might be a popular feature?

Converting the image is one option (although not sure if it'll work), the other is to convert the pixels using an iterator like this. If conversion works, that's fewer cycles to have to do when loading the image so is preferable.

@bugadani:matrix.orgbugadanican confirm, acid trip mode was the thing I needed right now! thanks for the laugh ^^18:21:23
@jamwaffles:matrix.orgjamwaffleshaha no worries. I definitely feel like it should be a feature not a bug18:25:08
@bugadani:matrix.orgbugadaniinvert color, mix up channels, done18:25:47
@bugadani:matrix.orgbugadaniI think this is the safer method, I think the other option has some legal issues18:28:44
18 Sep 2020
@caspermeijn:matrix.orgCasper Meijn joined the room.07:25:44
@reflog:matrix.orgreflogThanks guys!08:24:42
19 Sep 2020
@jamwaffles:matrix.orgjamwafflesRedacted or Malformed Event16:29:10
@jamwaffles:matrix.orgjamwaffles@room cough https://crates.io/crates/embedded-graphics/0.7.0-alpha.1 - the first 0.7 alpha is out!16:29:56
@jamwaffles:matrix.orgjamwafflesDocs.rs should update soon - queue is small at the moment. Please post here or on Github any issues you find. Note that this is an alpha and is released to surface any issues with the library before we release 0.7.0 proper16:30:58
@jamwaffles:matrix.orgjamwaffles * @room cough https://crates.io/crates/embedded-graphics/0.7.0-alpha.1 - the first 0.7 alpha is out!16:31:44
@bugadani:matrix.orgbugadaniawesome, time to rewrite the world on top of 0.7 :)18:33:41

There are no newer messages yet.

Back to Room List