diff --git a/README.md b/README.md index 164c8d1..e7f68fc 100644 --- a/README.md +++ b/README.md @@ -86,3 +86,4 @@ Planned changes: 4. Don't enable `gbr` and `argb` features. All pixel types are enabled by default. 5. In generic code operating on pixels, add `Copy + 'static` bounds to the pixel types and/or their components. 6. Test your code with `rgb = { version = "0.8.46", features = ["unstable-experimental"] }`, which enables some of the future breaking changes on the older version. This feature flag is only for testing, and will be changed/removed in the future. +7. Avoid wildcard imports from `rgb::alt::*`, and avoid using `GRAY8`-`GRAYA16` type aliases. diff --git a/src/legacy/alt.rs b/src/legacy/alt.rs index 8c35c93..a889ab2 100644 --- a/src/legacy/alt.rs +++ b/src/legacy/alt.rs @@ -52,15 +52,19 @@ pub type ARGB16 = crate::Argb; pub type GRB8 = crate::formats::grb::Grb; /// 8-bit gray +#[deprecated(note = "Refer to ::rgb::alt::Gray directly (this type alias will change in the next major version)")] pub type GRAY8 = Gray; /// 16-bit gray in machine's native endian +#[deprecated(note = "Refer to ::rgb::alt::Gray directly (this type alias will change in the next major version)")] pub type GRAY16 = Gray; /// 8-bit gray with alpha in machine's native endian +#[deprecated(note = "Refer to ::rgb::alt::GrayAlpha directly (this type alias will change in the next major version)")] pub type GRAYA8 = GrayAlpha; /// 16-bit gray with alpha in machine's native endian +#[deprecated(note = "Refer to ::rgb::alt::GrayAlpha directly (this type alias will change in the next major version)")] pub type GRAYA16 = GrayAlpha; @@ -234,6 +238,7 @@ impl From> for GrayAlpha { } #[test] +#[allow(deprecated)] fn gray() { let rgb: crate::RGB<_> = Gray(1).into(); assert_eq!(rgb.r, 1);