Function streemap::binary [−][src]
pub fn binary<N, T, S, R>(
rect: Rect<N>,
items: &mut [T],
f_item_size: S,
f_item_set_rect: R
) where
N: NumAssignOps + NumOps + PartialOrd + Zero + One + Copy,
S: Fn(&T) -> N,
R: FnMut(&mut T, Rect<N>),
Distribute items
inside rect
by splitting it recursively in 2 areas close to the same sizes.
f_item_size
provide the size of an itemf_item_set_rect
receive the item distributed Rect. Called once for each item and in a stable order.
To maximize the output quality its best to sort items by size in descending order.
Complexity: O(3⨯items.len()⨯log_2(items.len()))