rust-mobile / ndk

Rust bindings to the Android NDK
Apache License 2.0
1.11k stars 110 forks source link

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

Closed MarijnS95 closed 10 months ago

MarijnS95 commented 11 months ago

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 commented 11 months ago

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

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

Will have to do another pass based on upstream fixes.