pub struct Histogram { /* private fields */ }Expand description
Overlapping channels from ready-made bins, in a linear or logarithmic scale, with a mark at each end when too much of a channel piles up there. Where channels overlap, their colors add up, as light does, so each stays readable.
use ravenrs_core::Color;
use ravenrs_widgets::{Histogram, HistogramChannel, HistogramScale};
let red: Vec<u32> = (0..256).map(|i| (i * (256 - i)) as u32).collect();
let view = Histogram::new([HistogramChannel::new("Red", Color::rgb(0.9, 0.2, 0.2), red)])
.scale(HistogramScale::Logarithmic)
.zones(5);Implementations§
Source§impl Histogram
impl Histogram
Sourcepub fn new(channels: impl IntoIterator<Item = HistogramChannel>) -> Histogram
pub fn new(channels: impl IntoIterator<Item = HistogramChannel>) -> Histogram
A histogram of these channels, 96 logical pixels tall, across its parent.
Sourcepub fn scale(self, scale: HistogramScale) -> Histogram
pub fn scale(self, scale: HistogramScale) -> Histogram
How counts turn into heights (Linear by default).
The share of a channel that must sit in an end bin to light that end’s mark, from 0 to 1 (0.001 by default, which ignores a stray reflection).
Trait Implementations§
Auto Trait Implementations§
impl !Send for Histogram
impl !Sync for Histogram
impl Freeze for Histogram
impl RefUnwindSafe for Histogram
impl Unpin for Histogram
impl UnsafeUnpin for Histogram
impl UnwindSafe for Histogram
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.