[−][src]Struct pathtracer::Map
High abstraction Map which helps position objects.
Methods
impl Map
[src]
pub fn new() -> Self
[src]
Creates a new map, no min_max are intially required and are generated automatically when calling Map::map.
pub fn save(self, path: &Path) -> Result<(), Error>
[src]
Saves the image to disk at the given Path.
Examples
let nodes = Node::from_list(&[(0, 0), (10, 10)]); Map::new() .map(&nodes) .save(Path::new("/tmp/example.png"))?;
pub fn consume(self) -> IW
[src]
Consumes the Map and returns the ImageWrapper.
pub fn map<T: Draw + Location + Hash + MinMax>(self, element: &[T]) -> Self
[src]
Maps any struct that has implemented Draw, on to an ImageBuffer.
Examples
let nodes: Vec<Node> = Node::from_list(&[(0, 0), (100, 100)]); // Add content to vectors. let mut map = Map::new(); map = map.map(&nodes);
pub fn map_filter<T: Draw + Location + Hash + MinMax>(
self,
element: &[T],
filter: &dyn Fn(&T) -> bool
) -> Self
[src]
self,
element: &[T],
filter: &dyn Fn(&T) -> bool
) -> Self
Maps the elements but with an added filter parameter to exclude elements.
pub fn map_shape<T: Draw + Location + Hash + MinMax>(
self,
element: &[T],
shape: &Shape
) -> Self
[src]
self,
element: &[T],
shape: &Shape
) -> Self
Maps the elements with a specified shape struct.
pub fn map_absolute<T: Draw + Location + Hash + MinMax>(
self,
element: &[T]
) -> Self
[src]
self,
element: &[T]
) -> Self
Maps the elements without stabalizing the positions on the canvas.
pub fn map_params<T: Draw + Location + Hash + MinMax>(
self,
element: &[T],
filter: &dyn Fn(&T) -> bool,
shape: &Shape
) -> Self
[src]
self,
element: &[T],
filter: &dyn Fn(&T) -> bool,
shape: &Shape
) -> Self
Maps the elements but with all added parameters.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &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> SetParameter for T
[src]
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, 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>,