-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility of supporting no_std
?
#108
Comments
Absolutely! And if it's an opt-in feature I suppose it can be released as a
patch to 0.4. I think only a couple of things actually require std, and
those should not be essential. The only thing I would imagine that could
make it hard is if any dependencies doesn't work without it.
If you want to give it a try, I would suggest that you branch from the
0.4.0 release label and see if it can be done in a backwards compatible way
(disabling incompatible parts with a cargo feature is fine). Feel free to
ask if anything is unclear, and it's fine to open a work in progress pull
request.
Den fre 22 juni 2018 17:57Mark Barbone <[email protected]> skrev:
… I was wondering if it would be possible for this library to support a
#![no_std] environment. Because it's mostly conversion logic, I think a
lot of it could be useful in embedded situations when it's necessary to
e.g. write colors to a framebuffer, or control an RGB LED, or something
like that.
My specific use case is in a project I'm working on with bare-metal
raspberry pi development, where you can get a 24-bit color depth
framebuffer from the GPU. I would love to just use
Pixel::from_raw_slice_mut as shown in the docs
<https://docs.rs/palette/0.4.0/palette/#1-decoding>, but I was forced to
roll my own struct Pixel(u8, u8, u8) instead.
If it's simple enough, I'd be willing to try to implement this myself with
some help. (I don't know enough about colors or about the Pixel-deriving
mechanism to do anything very complicated, though.)
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#108>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANvzfTM3jgLQSUSme9gdFp85mu5Vuizks5t_RPlgaJpZM4U0CsU>
.
|
I have just pushed a 0.4 branch for non-breaking things. |
I have a mostly-working prototype branch.
I didn't want to open a PR because it's horribly incomplete (e.g. the tests don't even work yet without I'd appreciate any comments! |
Awesome! I will take a closer look later, but it's nice to see that you have made progress! Too bad it's not as straight forward as I thought.
That was expected. I'm fine with disabling them completely for now, in
I didn't know that... Annoying, but I see why it's necessary. I did a bit of research and it looks like there are some attempts to writing pure Rust replacements for
That sounds weird. It didn't look like you did a lot of changes there, but maybe the generated code need to be tweaked more. Hard to say without seeing the warnings. |
Thanks for the pointer to What would be optimal would be to only have those crates as dependencies under Is adding a dependency (even if it's not used) OK for a patch release, or is it a breaking change? |
It's not breaking if it doesn't replace a public dependency (any dependency items that are exported from this library), but I realized that we have entered breaking territory anyway. The fact that As for always including them, they seem small enough to not be a burden, but it's icky. I'm also not sure Yet another alternative is to hook in the libm bindings on linux, but that's a bit niche and will add C dependencies. |
Here's my idea for this, let me know what you think. From a user's perspective:
Some more notes about this: It should be noted that the |
That sounds like a good plan to get it all going! It can always be improved if a better option appears. It would be nice if you could add a section in the readme that explains why it's not trivial and give an example or at least some pointers to how to get it working without |
110: No std support r=Ogeon a=mb64 Adds support for using palette without the standard library, as discussed in issue #108. Fixes #108. One tiny question: because this would be in a future release (not 0.4.0), what version should be in the README example Cargo.toml for `#![no_std]`? I put 0.4, but was unsure about if it should be something different. Co-authored-by: Mark Barbone <[email protected]>
I was wondering if it would be possible for this library to support a
#![no_std]
environment. Because it's mostly conversion logic, I think a lot of it could be useful in embedded situations when it's necessary to e.g. write colors to a framebuffer, or control an RGB LED, or something like that.My specific use case is in a project I'm working on with bare-metal raspberry pi development, where you can get a 24-bit color depth framebuffer from the GPU. I would love to just use
Pixel::from_raw_slice_mut
as shown in the docs, but I was forced to roll my ownstruct Pixel(u8, u8, u8)
instead.If it's simple enough, I'd be willing to try to implement this myself with some help. (I don't know enough about colors or about the Pixel-deriving mechanism to do anything very complicated, though.)
Thanks!
The text was updated successfully, but these errors were encountered: