[][src]Struct openexr::frame_buffer::FrameBufferMut

pub struct FrameBufferMut<'a> { /* fields omitted */ }

Points to and describes in-memory image data for both reading and writing.

Methods

impl<'a> FrameBufferMut<'a>[src]

pub fn new(width: u32, height: u32) -> Self[src]

Creates an empty frame buffer with the given dimensions in pixels.

pub fn new_with_origin(
    origin_x: i32,
    origin_y: i32,
    width: u32,
    height: u32
) -> Self
[src]

Creates an empty frame buffer with the given dimensions and the given origin coordinate.

This is necessary because some OpenEXR files have data windows where the first pixel isn't at (0, 0), and the framebuffer needs to match that. For example, if the data window of the EXR is (-2, -3) to (90, 56), then you pass (-2, -3) as the origin parameter here.

More simply, when reading an EXR file, simply pass the output of header's data_origin() method to this.

pub fn insert_channel<T: PixelData>(
    &mut self,
    name: &str,
    fill: f64,
    data: &'a mut [T]
) -> &mut Self
[src]

Insert a single channel.

The channel will be given the name name, and will use the value fill for all pixels if a file is read that doesn't have a channel with that name.

data is the memory for the channel and should contain precisely width * height elements, where width and height are the dimensions of the FrameBuffer.

pub fn insert_channels<T: PixelStruct>(
    &mut self,
    names_and_fills: &[(&str, f64)],
    data: &'a mut [T]
) -> &mut Self
[src]

Insert multiple channels from a slice of structs or tuples.

The number of channels to be inserted is determined by the implementation of the PixelStruct trait on T. names_and_fills should contains the names and default fill values of each of those channels. The default fill values will be used to fill in a channel that doesn't exist in an input file that's being read.

data is the memory for the channel and should contain precisely width * height elements, where width and height are the dimensions of the FrameBuffer.

pub unsafe fn insert_raw(
    &mut self,
    name: &str,
    type_: PixelType,
    base: *mut c_char,
    stride: (usize, usize),
    sampling: (c_int, c_int),
    fill_value: f64,
    tile_coords: (bool, bool)
) -> &mut Self
[src]

The raw method for inserting a new channel.

This is very unsafe: the other methods should be preferred unless you have a special use-case.

This method corresponds directly to constructing and then inserting a "Slice" in the C++ OpenEXR library. Please see its documentation for details.

Methods from Deref<Target = FrameBuffer<'a>>

pub fn dimensions(&self) -> (u32, u32)[src]

Return the dimensions of the frame buffer.

pub fn origin(&self) -> (i32, i32)[src]

Return the origin of the frame buffer.

Trait Implementations

impl<'a> Deref for FrameBufferMut<'a>[src]

type Target = FrameBuffer<'a>

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a> !Send for FrameBufferMut<'a>

impl<'a> !Sync for FrameBufferMut<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]