mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-01 08:07:23 +00:00
Remove embedded_graphics dependency from i-slint-core
This feature was never used.
This commit is contained in:
parent
78679030f9
commit
da83857a60
2 changed files with 0 additions and 35 deletions
|
@ -73,7 +73,6 @@ strum = { version = "0.25.0", default-features = false, features = ["derive"] }
|
||||||
unicode-segmentation = "1.8.0"
|
unicode-segmentation = "1.8.0"
|
||||||
unicode-linebreak = { version = "0.1.2", optional = true }
|
unicode-linebreak = { version = "0.1.2", optional = true }
|
||||||
unicode-script = { version = "0.5.3", optional = true }
|
unicode-script = { version = "0.5.3", optional = true }
|
||||||
embedded-graphics = { version = "0.7.1", optional = true }
|
|
||||||
integer-sqrt = { version = "0.1.5" }
|
integer-sqrt = { version = "0.1.5" }
|
||||||
|
|
||||||
image = { version = "0.24.0", optional = true, default-features = false, features = [ "png", "jpeg" ] }
|
image = { version = "0.24.0", optional = true, default-features = false, features = [ "png", "jpeg" ] }
|
||||||
|
|
|
@ -9,8 +9,6 @@ use crate::graphics::{PixelFormat, Rgb8Pixel};
|
||||||
use crate::lengths::{PointLengths, RectLengths, SizeLengths};
|
use crate::lengths::{PointLengths, RectLengths, SizeLengths};
|
||||||
use crate::Color;
|
use crate::Color;
|
||||||
use derive_more::{Add, Mul, Sub};
|
use derive_more::{Add, Mul, Sub};
|
||||||
#[cfg(feature = "embedded-graphics")]
|
|
||||||
use embedded_graphics::prelude::RgbColor as _;
|
|
||||||
use integer_sqrt::IntegerSquareRoot;
|
use integer_sqrt::IntegerSquareRoot;
|
||||||
|
|
||||||
/// Draw one line of the texture in the line buffer
|
/// 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;
|
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 {
|
impl TargetPixel for crate::graphics::image::Rgb8Pixel {
|
||||||
fn blend(&mut self, color: PremultipliedRgbaColor) {
|
fn blend(&mut self, color: PremultipliedRgbaColor) {
|
||||||
let a = (u8::MAX - color.alpha) as u16;
|
let a = (u8::MAX - color.alpha) as u16;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue