Struct surf_n_term::image::OcTree [−][src]
pub struct OcTree { /* fields omitted */ }
Implementations
impl OcTree
[src]
impl OcTree
[src]pub fn find(&self, color: RGBA) -> Option<(usize, RGBA)>
[src]
pub fn find(&self, color: RGBA) -> Option<(usize, RGBA)>
[src]Find nearest color inside the octree
NOTE:
- to get correct palette index call build_palette first.
- prefer
ColorPalette::find
as it produces better result, and can not return None.
pub fn build_palette(&mut self) -> Vec<RGBA>
[src]
pub fn build_palette(&mut self) -> Vec<RGBA>
[src]Exteract all colors present in the octree and update leaf color indices
pub fn prune_until(&mut self, color_count: usize)
[src]
pub fn prune_until(&mut self, color_count: usize)
[src]Prune until desired number of colors is left
pub fn to_digraph<W: Write>(&self, out: W) -> Result<()>
[src]
pub fn to_digraph<W: Write>(&self, out: W) -> Result<()>
[src]Render octree as graphviz digraph (for debugging)
Trait Implementations
impl Extend<RGBA> for OcTree
[src]
impl Extend<RGBA> for OcTree
[src]fn extend<T: IntoIterator<Item = RGBA>>(&mut self, colors: T)
[src]
fn extend<T: IntoIterator<Item = RGBA>>(&mut self, colors: T)
[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)
[src]
fn extend_one(&mut self, item: A)
[src]🔬 This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]🔬 This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl FromIterator<RGBA> for OcTree
[src]
impl FromIterator<RGBA> for OcTree
[src]fn from_iter<T: IntoIterator<Item = RGBA>>(iter: T) -> Self
[src]
fn from_iter<T: IntoIterator<Item = RGBA>>(iter: T) -> Self
[src]Creates a value from an iterator. Read more
Auto Trait Implementations
impl RefUnwindSafe for OcTree
impl Send for OcTree
impl Sync for OcTree
impl Unpin for OcTree
impl UnwindSafe for OcTree
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more