Skip to main content

MappedImageMut

Struct MappedImageMut 

Source
pub struct MappedImageMut<'a> { /* private fields */ }
Expand description

A handle to a colour-mapped image created by mapped_image.

use ironlab::prelude::*;

let field = Matrix::from_fn(20, 30, |row, col| (row as f64 - 10.0) * (col as f64 - 15.0));
let mut fig = Figure::new();
fig.axes(0, 0)
    .mapped_image(&field)
    .plane(ImagePlane::Xz { y: Some(0.0) })
    .below(Color::BLACK)
    .above(Color::WHITE)
    .non_finite(OutOfRange::Strict);

Implementations§

Source§

impl MappedImageMut<'_>

Source

pub fn id(&self) -> NodeId

Returns the node identifier of the image.

Source

pub fn display_name(&mut self, name: impl Into<Text>) -> &mut Self

Sets the name shown for the image in the legend.

Source

pub fn pixel_columns(&mut self, first: f64, last: f64) -> &mut Self

Places the centres of the first and last columns of the image at the given coordinates along the first axis of its plane (MATLAB’s XData).

The pitch between centres follows from the number of columns, and the image covers half a pitch beyond each centre; a last less than first mirrors the image. Without a range the centres lie at 0, 1, …, n − 1. The coordinates must be finite and may coincide only when the image has one column, as Figure::validate checks.

Source

pub fn pixel_rows(&mut self, first: f64, last: f64) -> &mut Self

Places the centres of the first and last rows of the image at the given coordinates along the second axis of its plane (MATLAB’s YData), as pixel_columns places the columns.

Row 0 of the pixels lies at first, so an image whose rows count down from its top is placed the right way up by a first greater than last.

Source

pub fn plane(&mut self, plane: ImagePlane) -> &mut Self

Sets the plane of the axes in which the image lies, with its offset along the third axis.

The xz and yz planes are the walls of a three-dimensional axes, so placing the image in one of them converts a two-dimensional axes to three dimensions with the default view, as surf does; an axes that is already three-dimensional keeps its view. The xy plane never changes the projection: it is the only plane of a two-dimensional axes, which ignores its height, and the floor of a three-dimensional one.

Source§

impl MappedImageMut<'_>

Source

pub fn below(&mut self, policy: impl Into<OutOfRange>) -> &mut Self

Sets what is drawn for a pixel whose value is less than the lower colour limit.

A Color gives the fixed-colour policy OutOfRange::Rgba. OutOfRange::Strict makes such a pixel a validation error, OutOfRange::Transparent, the default, draws nothing, and OutOfRange::Clamp draws the first entry of the colormap.

Source

pub fn above(&mut self, policy: impl Into<OutOfRange>) -> &mut Self

Sets what is drawn for a pixel whose value is greater than the upper colour limit.

The policies are as for below, except that a clamp draws the last entry of the colormap.

Source

pub fn non_finite(&mut self, policy: impl Into<OutOfRange>) -> &mut Self

Sets what is drawn for a pixel whose value is NaN or infinite.

The policies are as for below, except that a clamp draws nothing, because a non-finite value has no nearest end of the colormap.

Trait Implementations§

Source§

impl<'a> Debug for MappedImageMut<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for MappedImageMut<'a>

§

impl<'a> Freeze for MappedImageMut<'a>

§

impl<'a> RefUnwindSafe for MappedImageMut<'a>

§

impl<'a> Send for MappedImageMut<'a>

§

impl<'a> Sync for MappedImageMut<'a>

§

impl<'a> Unpin for MappedImageMut<'a>

§

impl<'a> UnsafeUnpin for MappedImageMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more