summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image/raster.rs
diff options
context:
space:
mode:
authorLibravatar Greg V <greg@unrelenting.technology>2020-06-05 21:18:22 +0300
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-02-13 15:53:24 +0100
commit8f126c212b887b2621cd8220bc4a52ba4febb1eb (patch)
tree5ec5abca6b01139e6679ede53ec5432af0eb01a9 /wgpu/src/image/raster.rs
parent9f5c2eb0c43daa61b19769322cf3692b29e0ac0f (diff)
downloadiced-8f126c212b887b2621cd8220bc4a52ba4febb1eb.tar.gz
iced-8f126c212b887b2621cd8220bc4a52ba4febb1eb.tar.bz2
iced-8f126c212b887b2621cd8220bc4a52ba4febb1eb.zip
Add image format options to reduce code bloat, fixes #376
Diffstat (limited to 'wgpu/src/image/raster.rs')
-rw-r--r--wgpu/src/image/raster.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/wgpu/src/image/raster.rs b/wgpu/src/image/raster.rs
index 25607dab..d5c62545 100644
--- a/wgpu/src/image/raster.rs
+++ b/wgpu/src/image/raster.rs
@@ -4,7 +4,7 @@ use std::collections::{HashMap, HashSet};
#[derive(Debug)]
pub enum Memory {
- Host(::image::ImageBuffer<::image::Bgra<u8>, Vec<u8>>),
+ Host(::image_rs::ImageBuffer<::image_rs::Bgra<u8>, Vec<u8>>),
Device(atlas::Entry),
NotFound,
Invalid,
@@ -42,14 +42,14 @@ impl Cache {
let memory = match handle.data() {
image::Data::Path(path) => {
- if let Ok(image) = ::image::open(path) {
+ if let Ok(image) = ::image_rs::open(path) {
Memory::Host(image.to_bgra8())
} else {
Memory::NotFound
}
}
image::Data::Bytes(bytes) => {
- if let Ok(image) = ::image::load_from_memory(&bytes) {
+ if let Ok(image) = ::image_rs::load_from_memory(&bytes) {
Memory::Host(image.to_bgra8())
} else {
Memory::Invalid
@@ -60,7 +60,7 @@ impl Cache {
height,
pixels,
} => {
- if let Some(image) = ::image::ImageBuffer::from_vec(
+ if let Some(image) = ::image_rs::ImageBuffer::from_vec(
*width,
*height,
pixels.to_vec(),