Trait ui_image2d::UiImage2d [−][src]
pub trait UiImage2d { fn image2d<F>(
&self,
ctx: &F,
name: &ImStr,
image: &ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>,
state: &mut State
) -> Result<(), Error>
where
F: Facade; }
Implementation of a UI to visualize a 2D image with ImGui and OpenGL
Required Methods
fn image2d<F>(
&self,
ctx: &F,
name: &ImStr,
image: &ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>,
state: &mut State
) -> Result<(), Error> where
F: Facade,
&self,
ctx: &F,
name: &ImStr,
image: &ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>,
state: &mut State
) -> Result<(), Error> where
F: Facade,
Implementations on Foreign Types
impl<'ui> UiImage2d for Ui<'ui>
[src]
impl<'ui> UiImage2d for Ui<'ui>
fn image2d<F>(
&self,
ctx: &F,
name: &ImStr,
image: &ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>,
state: &mut State
) -> Result<(), Error> where
F: Facade,
[src]
fn image2d<F>(
&self,
ctx: &F,
name: &ImStr,
image: &ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>,
state: &mut State
) -> Result<(), Error> where
F: Facade,
Show image given as input. name
is used as an ID to register the
provided image as an OpenGL texture in [Ui
].
Example
#[macro_use] extern crate imgui; extern crate imgui_glium_renderer; extern crate ndarray; extern crate ui_image2d; use imgui::Ui; use imgui_glium_renderer::AppContext; use ndarray::Array2; use ui_image2d::UiImage2d; fn run(ui: &Ui, ctx: &AppContext) -> Result<(), ui_image2d::Error> { let data = Array2::eye(10); let mut state = ui_image2d::State::default(); ui.image2d(ctx, im_str!("Show my image!"), &data, &mut state) }