pub struct IconImage { /* private fields */ }Expand description
行优先、非预乘 alpha 的 RGBA8 位图。
Implementations§
Source§impl IconImage
impl IconImage
Sourcepub fn new(
width: u32,
height: u32,
rgba: impl Into<Arc<[u8]>>,
) -> Option<IconImage>
pub fn new( width: u32, height: u32, rgba: impl Into<Arc<[u8]>>, ) -> Option<IconImage>
校验尺寸与 RGBA 长度;尺寸为 0 或字节数不等于 width * height * 4 时返回 None。
Sourcepub fn from_rgba(width: u32, height: u32, rgba: Vec<u8>) -> Option<IconImage>
pub fn from_rgba(width: u32, height: u32, rgba: Vec<u8>) -> Option<IconImage>
从 Vec<u8> 构造 RGBA 位图。
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn rgba(&self) -> &[u8] ⓘ
Trait Implementations§
impl Eq for IconImage
impl StructuralPartialEq for IconImage
Auto Trait Implementations§
impl Forget for IconImage
impl Freeze for IconImage
impl Move for IconImage
impl RefUnwindSafe for IconImage
impl Send for IconImage
impl Sync for IconImage
impl Unpin for IconImage
impl UnsafeUnpin for IconImage
impl UnwindSafe for IconImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.