Struct rustic_zen::image::Image

source ·
pub struct Image { /* private fields */ }
Expand description

Represents an image while ray rendering is happening

This struct uses floats to represent each pixel of the image so normalisation can happen after rendering finishes.

Image is created and populated by the renderer. Only export functions are exposed.

Implementations§

source§

impl Image

source

pub fn new(width: usize, height: usize) -> Self

Create new image with the given width and hieght;

Trait Implementations§

source§

impl ExportImage for Image

source§

fn get_lightpower(&self) -> f32

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

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

Returns the image size in pixels in the format (width, height)
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.
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. Read more
source§

impl RenderImage for Image

source§

fn draw_line(&self, ray: RayResult)

Called in every rendering thread to add a Ray to the render target
source§

fn prepare_render(&mut self, lightpower: f32)

called momentarilly before the render begins to allow the render target to set it’s self up to receive calls to draw_line
source§

fn finish_render(&mut self)

called immediately after a render ends to allow the render target to clean up or finalize results

Auto Trait Implementations§

§

impl Freeze for Image

§

impl RefUnwindSafe for Image

§

impl Send for Image

§

impl Sync for Image

§

impl Unpin for Image

§

impl UnwindSafe for Image

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V