Fix missing feature flags in graphics::image
This commit is contained in:
parent
867fe819c0
commit
74c8641e2c
2 changed files with 5 additions and 4 deletions
|
|
@ -6,8 +6,6 @@ use crate::core::Rectangle;
|
|||
use crate::core::image;
|
||||
use crate::core::svg;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A raster or vector image.
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
|
@ -40,6 +38,7 @@ impl Image {
|
|||
}
|
||||
|
||||
/// An image buffer.
|
||||
#[cfg(feature = "image")]
|
||||
pub type Buffer = ::image::ImageBuffer<::image::Rgba<u8>, image::Bytes>;
|
||||
|
||||
#[cfg(feature = "image")]
|
||||
|
|
@ -149,7 +148,10 @@ pub fn load(handle: &image::Handle) -> Result<Buffer, image::Error> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "image")]
|
||||
fn to_error(error: ::image::ImageError) -> image::Error {
|
||||
use std::sync::Arc;
|
||||
|
||||
match error {
|
||||
::image::ImageError::IoError(error) => {
|
||||
image::Error::Inaccessible(Arc::new(error))
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
use crate::core::Size;
|
||||
use crate::core::image;
|
||||
use crate::graphics;
|
||||
use crate::graphics::image::image_rs;
|
||||
use crate::image::atlas::{self, Atlas};
|
||||
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
pub type Image = image_rs::ImageBuffer<image_rs::Rgba<u8>, image::Bytes>;
|
||||
pub type Image = graphics::image::Buffer;
|
||||
|
||||
/// Entry in cache corresponding to an image handle
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue