pub struct Palette { /* private fields */ }
Expand description
A palette for translating indexed colors to actual colors.
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn read<R>(reader: &mut R) -> QResult<Palette>where
R: Read,
pub fn read<R>(reader: &mut R) -> QResult<Palette>where
R: Read,
Reads a palette from a reader and returns it.
Sourcepub fn write<W>(&self, writer: &mut W) -> QResult<()>where
W: Write,
pub fn write<W>(&self, writer: &mut W) -> QResult<()>where
W: Write,
Writes this palette to the given Write
instance.
Sourcepub fn from_image(image: &DynamicImage) -> QResult<Palette>
pub fn from_image(image: &DynamicImage) -> QResult<Palette>
Creates a palette from an image. It returns an error if there are more than 256 colors in the image.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Palette
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin for Palette
impl UnwindSafe for Palette
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more