-
Notifications
You must be signed in to change notification settings - Fork 781
Change color type to use f32 values internally #9820
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
Conversation
|
I know this is a DRAFT, but be careful not to change the public API. |
Fair enough, I'll restore the old structs/functions and mark them as deprecated. |
ca01bc5 to
e442f12
Compare
|
Okay, I've decided to approach this slightly differently. I've changed the color type to use f32 values internally which makes some things a lot more sensible, without doing any changes elsewhere. |
|
I think that's a very good direction. I think on desktop and MPU this makes sense. But we may need to retain the Tangential: In the spirit of the |
What's the best way to determine if int values should be used? |
|
That's a good question. Perhaps the
(we could rename it if necessary) Let's see what Olivier says. |
280e8dd to
23673c4
Compare
| // therefore it is ok to reinterpret_cast | ||
| ("MenuEntryModel".into(), "std::shared_ptr<slint::Model<MenuEntry>>".into()), | ||
| ("Coord".into(), "float".into()), | ||
| ("Channel".into(), "uint8_t".into()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, otherwise it tries to use an undefined Channel type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess the differences in rendering come from changing the mix/transparentize functions now operating always on f32?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct

Currently, our
Colortype is quantized to 8 bits for no good reason. I thought I'd change it to use floating point values between 0.0 and 1.0,as well as introduce explicitly quantized color types (one encoded using the sRGB transfer function and another quantized linearly). This will require a lot of code changes elsewhere and will probably not get merged any time soon.Edit: I've changed this to just include the first Color changes