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

ndk: Add DataSpace type and fns on Bitmap and NativeWindow #438

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

MarijnS95
Copy link
Member

The DataSpace type represents typical named color spaces, where each value is a bitmask comprising of a standard, transfer function, and range value. All are implemented as enums with TryFromPrimitive to make it obvious to see and handle unknown values, and include #[non_exhaustive] to allow us to bind new values in future non-breaking patch releases.

@MarijnS95
Copy link
Member Author

Note that I ran into various upstream doc issues while porting them to Rust:

android/ndk#1933
https://issuetracker.google.com/issues/300602767

Will have to do another pass based on upstream fixes.

The `DataSpace` type represents typical named color spaces, where each
value is a bitmask comprising of a standard, transfer function, and range
value.  All are implemented as `enum`s with `TryFromPrimitive` to make it
obvious to see and handle unknown values, and include `#[non_exhaustive]`
to allow us to bind new values in future non-breaking patch releases.
@MarijnS95 MarijnS95 merged commit 2412804 into master Oct 14, 2023
36 checks passed
@MarijnS95 MarijnS95 deleted the data-space branch October 14, 2023 21:51
MarijnS95 added a commit to MarijnS95/ndk that referenced this pull request Oct 14, 2023
Map the new compression functions that are available in API level 30,
which also take a `DataSpace` that has recently been added in rust-mobile#438.

Also turn `BitmapError` into a proper `non_exhaustive` `enum` with
`num_enum`'s `catch_all` parser, similar to `MediaError`.
MarijnS95 added a commit to MarijnS95/ndk that referenced this pull request Oct 14, 2023
Map the new compression functions that are available in API level 30,
which also take a `DataSpace` that has recently been added in rust-mobile#438.

Also turn `BitmapError` into a proper `non_exhaustive` `enum` with
`num_enum`'s `catch_all` parser, similar to `MediaError`.
MarijnS95 added a commit to MarijnS95/ndk that referenced this pull request Oct 14, 2023
Map the new compression functions that are available in API level 30,
which also take a `DataSpace` that has recently been added in rust-mobile#438.

Also turn `BitmapError` into a proper `non_exhaustive` `enum` with
`num_enum`'s `catch_all` parser, similar to `MediaError`.
MarijnS95 added a commit that referenced this pull request Oct 14, 2023
Map the new compression functions that are available in API level 30,
which also take a `DataSpace` that has recently been added in #438.

Also turn `BitmapError` into a proper `non_exhaustive` `enum` with
`num_enum`'s `catch_all` parser, similar to `MediaError`.
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.

1 participant