ARGB/RGBA conversions do not build on s390x (big-endian)
Turns out that my rewrite of the pixbuf-to-cairo functions doesn't build on big-endian...
[ 259s] error[E0277]: the trait bound `ARGB<u8>: std::convert::From<rgb::RGBA<u8>>` is not satisfied
[ 259s] --> src/surface_utils/shared_surface.rs:307:67
[ 259s] |
[ 259s] 307 | .for_each(|(src, dest)| *dest = src.premultiply().into());
[ 259s] | ^^^^ the trait `std::convert::From<rgb::RGBA<u8>>` is not implemented for `ARGB<u8>`
[ 259s] |
[ 259s] = help: the following implementations were found:
[ 259s] <ARGB<T, u16> as std::convert::From<BGR<T>>>
[ 259s] <ARGB<T, u16> as std::convert::From<RGB<T>>>
[ 259s] <ARGB<T, u8> as std::convert::From<BGR<T>>>
[ 259s] <ARGB<T, u8> as std::convert::From<RGB<T>>>
[ 259s] = note: required because of the requirements on the impl of `Into<ARGB<u8>>` for `rgb::RGBA<u8>`
[ 259s]
[ 259s] error[E0277]: the trait bound `ARGB<u8>: std::convert::From<rgb::RGBA<u8>>` is not satisfied
[ 259s] --> src/surface_utils/shared_surface.rs:313:65
[ 259s] |
[ 259s] 313 | .for_each(|(src, dest)| *dest = src.alpha(0xff).into());
[ 259s] | ^^^^ the trait `std::convert::From<rgb::RGBA<u8>>` is not implemented for `ARGB<u8>`
[ 259s] |
[ 259s] = help: the following implementations were found:
[ 259s] <ARGB<T, u16> as std::convert::From<BGR<T>>>
[ 259s] <ARGB<T, u16> as std::convert::From<RGB<T>>>
[ 259s] <ARGB<T, u8> as std::convert::From<BGR<T>>>
[ 259s] <ARGB<T, u8> as std::convert::From<RGB<T>>>
[ 259s] = note: required because of the requirements on the impl of `Into<ARGB<u8>>` for `rgb::RGBA<u8>`
[ 259s]
[ 259s] error[E0277]: the trait bound `rgb::RGBA<u8>: std::convert::From<ARGB<u8>>` is not satisfied
[ 259s] --> src/surface_utils/shared_surface.rs:345:45
[ 259s] |
[ 259s] 345 | .for_each(|(src, dest)| *dest = Pixel::from(*src).unpremultiply());
[ 259s] | ^^^^^^^^^^^ the trait `std::convert::From<ARGB<u8>>` is not implemented for `rgb::RGBA<u8>`
[ 259s] |
[ 259s] = help: the following implementations were found:
[ 259s] <rgb::RGBA<T, A> as std::convert::From<(T, T, T, A)>>
[ 259s] <rgb::RGBA<T, A> as std::convert::From<GrayAlpha<T, A>>>
[ 259s] <rgb::RGBA<T, u16> as std::convert::From<BGR<T>>>
[ 259s] <rgb::RGBA<T, u16> as std::convert::From<RGB<T>>>
[ 259s] and 13 others
[ 259s] = note: required by `std::convert::From::from`
I've filed this issue for the rgb crate, but in the meantime I'll fix it for librsvg.
Edited by Federico Mena Quintero