[−][src]Struct cpclib::ga::Palette
The palette maps one Ink for each Pen
Methods
impl Palette
[src]
pub fn new() -> Palette
[src]
Create a new palette. All pens are black.
pub fn empty() -> Palette
[src]
Create an empty Palette. An empty palette does not contains all the inks and must make crash most of the code that has been previously written !
pub fn contains_pen(&self, pen: &Pen) -> bool
[src]
Verifies if the palette contains the required pen
pub fn contains_border(&self) -> bool
[src]
pub fn next_unused_pen(&self) -> Option<Pen>
[src]
Provides the next unused pen if there is one
pub fn to_gate_array(&self) -> [u8; 17]
[src]
pub fn add_novel_inks_except_in_border(
&mut self,
inks: &[Ink]
) -> (usize, usize)
[src]
&mut self,
inks: &[Ink]
) -> (usize, usize)
Add the inks if not present in empty slots of the palette as soon as it is possible. Returns the number of inks added a,d the number of inks impossible to add because of the lack of space.
pub fn inks_with_border(&self) -> Vec<Ink>
[src]
Returns the list of inks contained in the palette with the border
pub fn inks(&self) -> Vec<Ink>
[src]
Returns the list of inks contained in the palette without taking into account the border
pub fn pens_with_border(&self) -> Vec<Pen>
[src]
Returns all the set pens (without the border)
pub fn pens(&self) -> Vec<Pen>
[src]
Returns all the set pens (without the border)
pub fn get(&self, pen: &Pen) -> &Ink
[src]
Get the ink of the requested pen. Pen MUST be present
pub fn get_border(&self) -> &Ink
[src]
pub fn set(&mut self, pen: &Pen, ink: Ink)
[src]
Change the ink of the specified pen
pub fn set_border(&mut self, ink: Ink)
[src]
pub fn get_pen_for_ink(&self, expected: &Ink) -> Option<Pen>
[src]
Get the pen that corresponds to the required ink. Ink 16 (border) is never tested
pub fn contains_ink(&self, expected: &Ink) -> bool
[src]
Returns true if the palette contains the inks in one of its pens (except border)
pub fn to_mode3_mixed_with_mode0(&self) -> Palette
[src]
Replicate the firsts 4 pens in order to manage special texture that contains both mode 0 and mode 3 patterns
Trait Implementations
impl Default for Palette
[src]
impl Clone for Palette
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> From<Vec<T>> for Palette where
Ink: From<T>,
T: Copy,
[src]
Ink: From<T>,
T: Copy,
impl<'_> Into<Vec<u8>> for &'_ Palette
[src]
impl Into<Vec<u8>> for Palette
[src]
impl Debug for Palette
[src]
impl Serialize for Palette
[src]
impl<'de> Deserialize<'de> for Palette
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<Palette, D::Error>
[src]
deserializer: D
) -> Result<Palette, D::Error>
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,