diff options
author | 2022-11-05 03:18:13 +0100 | |
---|---|---|
committer | 2022-11-05 03:20:00 +0100 | |
commit | 438f97a6d00ad0312e7c84b4c1529968bdfba849 (patch) | |
tree | fbd6f3e26b52947810d4f30943a8cdff5b103cb2 /native/src/image.rs | |
parent | 8ce8d374b1e8d1d394a42a5ee2bca8af790f0b71 (diff) | |
download | iced-438f97a6d00ad0312e7c84b4c1529968bdfba849.tar.gz iced-438f97a6d00ad0312e7c84b4c1529968bdfba849.tar.bz2 iced-438f97a6d00ad0312e7c84b4c1529968bdfba849.zip |
Use RGBA texture for `image` and `svg` pipelines
Diffstat (limited to 'native/src/image.rs')
-rw-r--r-- | native/src/image.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/native/src/image.rs b/native/src/image.rs index b313d96d..06fd7ae6 100644 --- a/native/src/image.rs +++ b/native/src/image.rs @@ -22,7 +22,7 @@ impl Handle { } /// Creates an image [`Handle`] containing the image pixels directly. This - /// function expects the input data to be provided as a `Vec<u8>` of BGRA + /// function expects the input data to be provided as a `Vec<u8>` of RGBA /// pixels. /// /// This is useful if you have already decoded your image. @@ -31,7 +31,7 @@ impl Handle { height: u32, pixels: impl Into<Cow<'static, [u8]>>, ) -> Handle { - Self::from_data(Data::Pixels { + Self::from_data(Data::Rgba { width, height, pixels: pixels.into(), @@ -93,8 +93,8 @@ pub enum Data { /// In-memory data Bytes(Cow<'static, [u8]>), - /// Decoded image pixels in BGRA format. - Pixels { + /// Decoded image pixels in RGBA format. + Rgba { /// The width of the image. width: u32, /// The height of the image. @@ -109,7 +109,7 @@ impl std::fmt::Debug for Data { match self { Data::Path(path) => write!(f, "Path({:?})", path), Data::Bytes(_) => write!(f, "Bytes(...)"), - Data::Pixels { width, height, .. } => { + Data::Rgba { width, height, .. } => { write!(f, "Pixels({} * {})", width, height) } } |