pub trait ExportImage {
    // Required methods
    fn get_size(&self) -> (usize, usize);
    fn get_lightpower(&self) -> f32;
    fn to_rgbaf32(&self) -> Vec<f32>;

    // Provided method
    fn to_rgba8(&self, rays: usize, exposure: f64, exponent: f32) -> Vec<u8> { ... }
}
Expand description

This trait provides interfaces to extract the image data from a render target.

Required Methods§

source

fn get_size(&self) -> (usize, usize)

Returns the image size in pixels in the format (width, height)

source

fn get_lightpower(&self) -> f32

Returns the lightpower of the scene most recently rendered to this image.

source

fn to_rgbaf32(&self) -> Vec<f32>

Outputs the image. Serialsiing the image to a sequence of 32 bit floating point RGBA samples stored in a Vec<f32>, suitible for use in high bit depth images such as used by blender.

Provided Methods§

source

fn to_rgba8(&self, rays: usize, exposure: f64, exponent: f32) -> Vec<u8>

Outputs the image. Serialsiing the image to a sequence of 8 bit RGB samples stored in a Vec<u8>, suitible for use in file streams and other outputs.

This function also normalises the image applying exposure and gamma. gamma is passed in the form of an exponent which is defined as 1.0 / gamma

Implementors§