Struct realsense_rust::frame::ImageFrame[][src]

pub struct ImageFrame<Kind> { /* fields omitted */ }
Expand description

Holds the raw data pointer and derived data for an RS2 Image frame.

This generic type isn’t particularly useful on it’s own. In all cases, you want a specialized version of this class (DepthFrame, ColorFrame, DisparityFrame).

Implementations

Given the 2D depth coordinate (x,y) provide the corresponding depth in metric units.

Warning

It is fairly expensive to use this in practice as it will copy the underlying pixel into a f32 value that gives you the direct distance. In practice getting DepthFrame::depth_units and then applying that to the raw data with ImageFrame::get is a much more efficient way to handle this.

Get the metric units currently used for reporting depth information.

Given the 2D depth coordinate (x,y) provide the corresponding depth in metric units.

Warning

Like with depth frames, this method is fairly expensive to use in practice. The disparity can be converted to depth fairly easily, but this will effectively copy every pixel if you loop through the data with this method for every index.

It is often much more efficient to directly stream the Rs2Format::Distance format if you want the distance directly, and access the frame data with ImageFrame::get.

Get the metric units currently used for reporting depth information.

Get the baseline used during construction of the Disparity frame

Iterator through every pixel of an image frame.

Get a pixel value from the Video Frame.

Safety

This makes a call directly to the underlying data pointer inherited from the rs2_frame.

Get the stride of this Video frame’s pixel in bytes.

Get the bits per pixel.

Get the size of the data in this Video frame in bytes.

Get a reference to the raw data held by this Video frame.

Safety

This is a raw pointer to the underlying data. This data has to be interpreted according to the format of the frame itself. In most scenarios you will probably want to just use the get_unchecked function associated with the FrameEx trait, but this can be useful if you need more immediate access to the underlying pixel data.

Get the width of this Video frame in pixels

Get the height of this Video frame in pixels

Given a row and column index, Get a pixel value from this frame.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Get the stream profile associated with the frame.

Get the sensor associated with the frame.

Get the frame timestamp.

Get the RealSense timestamp domain for the current timestamp.

Get frame metadata. Read more

Test whether the metadata arguemnt is supported by the frame.

Get (and own) the underlying frame pointer for this frame. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Attempt to construct an Image frame of extension K from the raw rs2_frame.

All members of the ImageFrame struct are validated and populated during this call.

Errors

There are a number of errors that may occur if the data in the rs2_frame is not valid, all of type FrameConstructionError.

See FrameConstructionError documentation for more details.

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.