Remove embedded_graphics dependency from i-slint-core

This feature was never used.
This commit is contained in:
Olivier Goffart 2023-06-22 10:59:19 +02:00 committed by Olivier Goffart
parent 78679030f9
commit da83857a60
2 changed files with 0 additions and 35 deletions

View file

@ -9,8 +9,6 @@ use crate::graphics::{PixelFormat, Rgb8Pixel};
use crate::lengths::{PointLengths, RectLengths, SizeLengths};
use crate::Color;
use derive_more::{Add, Mul, Sub};
#[cfg(feature = "embedded-graphics")]
use embedded_graphics::prelude::RgbColor as _;
use integer_sqrt::IntegerSquareRoot;
/// Draw one line of the texture in the line buffer
@ -457,38 +455,6 @@ pub trait TargetPixel: Sized + Copy {
fn from_rgb(red: u8, green: u8, blue: u8) -> Self;
}
#[cfg(feature = "embedded-graphics")]
impl TargetPixel for embedded_graphics::pixelcolor::Rgb888 {
fn blend(&mut self, color: PremultipliedRgbaColor) {
let a = (u8::MAX - color.alpha) as u16;
*self = Self::new(
(self.r() as u16 * a / 255) as u8 + color.red,
(self.g() as u16 * a / 255) as u8 + color.green,
(self.b() as u16 * a / 255) as u8 + color.blue,
);
}
fn from_rgb(r: u8, g: u8, b: u8) -> Self {
Self::new(r, g, b)
}
}
#[cfg(feature = "embedded-graphics")]
impl TargetPixel for embedded_graphics::pixelcolor::Rgb565 {
fn blend(&mut self, color: PremultipliedRgbaColor) {
let a = (u8::MAX - color.alpha) as u16;
*self = Self::new(
(((self.r() as u16) * a) / 255) as u8 + (color.red >> 3),
(((self.g() as u16) * a) / 255) as u8 + (color.green >> 2),
(((self.b() as u16) * a) / 255) as u8 + (color.blue >> 3),
)
}
fn from_rgb(r: u8, g: u8, b: u8) -> Self {
Self::new(r >> 3, g >> 2, b >> 3)
}
}
impl TargetPixel for crate::graphics::image::Rgb8Pixel {
fn blend(&mut self, color: PremultipliedRgbaColor) {
let a = (u8::MAX - color.alpha) as u16;