Skip to content
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

Rework ColorParams internals and allow conversion from fz_color_params #102

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

ginnyTheCat
Copy link
Collaborator

@ginnyTheCat ginnyTheCat commented Jan 30, 2025

Shrinks ColorParams size from an i32 down to a u8 using a bitflag approach. Imagining the u8 byte as a array of bits the layout looks like this: [0, 0, 0, opm, op, bp, ri, ri].

This also implements From<fz_color_params> and adds a Debug implementation that displays the ColorParams as a struct: ColorParams { rendering_intent: Saturation, bp: true, op: false, opm: false } for the result of ColorParams::new(RenderingIntent::Saturation, true, false, false).

@ginnyTheCat ginnyTheCat changed the title Rework ColorParams internals and allow conversion back to fz_color_params Rework ColorParams internals and allow conversion from fz_color_params Jan 30, 2025
@messense messense merged commit b70a8f4 into messense:main Feb 5, 2025
7 of 11 checks passed
@ginnyTheCat ginnyTheCat deleted the color_params branch February 5, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants