Bump image crate (#13397)
Bumping the image crate for better support of image formats. The latest version does not have a `BGRA` type it only has `RGBA` it doesn't really matter as the size is the same but the type name is a little confusing as we need it as `BGRA`. Also there is no `into_bgra8` but we can use `into_rgba8` but then it must be converted before creating the `ImageData`. Release Notes: - N/A
This commit is contained in:
parent
55511d1591
commit
54afa6f69f
6 changed files with 346 additions and 94 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::{size, DevicePixels, Result, SharedString, Size};
|
||||
|
||||
use image::{Bgra, ImageBuffer};
|
||||
use image::RgbaImage;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
fmt,
|
||||
|
@ -40,12 +40,12 @@ pub(crate) struct RenderImageParams {
|
|||
pub struct ImageData {
|
||||
/// The ID associated with this image
|
||||
pub id: ImageId,
|
||||
data: ImageBuffer<Bgra<u8>, Vec<u8>>,
|
||||
data: RgbaImage,
|
||||
}
|
||||
|
||||
impl ImageData {
|
||||
/// Create a new image from the given data.
|
||||
pub fn new(data: ImageBuffer<Bgra<u8>, Vec<u8>>) -> Self {
|
||||
pub fn new(data: RgbaImage) -> Self {
|
||||
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
|
||||
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue