Struct Image

Source
pub struct Image<'a, T> { /* private fields */ }
Expand description

An Image as it is captured by the camera.

Implementations§

Source§

impl<'a, T> Image<'a, T>

Source

pub fn pixel(&self, x: usize, y: usize) -> Option<&T>

Get a Pixel from the image.

§Arguments
  • x: Horizontal coordinate of the requested pixel.
  • y: Vertical coordinate of the requested pixel.

returns: Option<&T> A reference to the pixel

Source

pub fn width(&self) -> u32

Get the width of this image in pixels

Source

pub fn height(&self) -> u32

Get the height of this image

Source

pub fn format(&self) -> Type

Format of image data

Source

pub fn nframe(&self) -> u32

Frame number

Source

pub fn black_level(&self) -> u32

Image black level

Source

pub fn padding_x(&self) -> u32

Number of extra bytes provided at the end of each line for alignment

Source

pub fn absolute_offset_x(&self) -> u32

Horizontal offset from the origin of the sensor to the first pixel in this image

Source

pub fn absolute_offset_y(&self) -> u32

Vertical offset from the origin of the sensor to the first line in this image

Source

pub fn transport_format(&self) -> Type

Current format of the pixels on transport layer

Source

pub fn downsampling_x(&self) -> u32

Horizontal downsampling

Source

pub fn downsampling_y(&self) -> u32

Vertical downsampling

Source

pub fn exposure_time_us(&self) -> u32

Exposure time for this image in us

Source

pub fn acq_nframe(&self) -> u32

Aquisition Frame Number. Reset only on acquisition start.

Source

pub fn image_user_data(&self) -> u32

Image user data which can be set using [Camera::set_image_user_data]

Source

pub fn timestamp_raw(&self) -> u64

Raw 64-bit timestamp from the camera. Interpretation of this value differs between camera series. xiQ, xiD: 40-bit microsecond number - (overlaps after 305 hours) xiC, xiB, xiT, xiX: 64-bit 4 nanosecond number (overlaps after 2339 years)

Source

pub fn data(&'a self) -> &'a [T]

Get the raw image data as a slice.

Trait Implementations§

Source§

impl<P> From<Image<'_, <P as Pixel>::Subpixel>> for ImageBuffer<P, Vec<P::Subpixel>>
where P: Pixel,

Source§

fn from(image: Image<'_, P::Subpixel>) -> Self

Converts the image to an ImageBuffer

let image = buffer.next_image::<u8>(None)?;
let image_buffer = ImageBuffer::<Luma<u8>,_>::from(image);
image_buffer.save("test.jpg");
Source§

impl<'a, T> Send for Image<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for Image<'a, T>

§

impl<'a, T> RefUnwindSafe for Image<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> !Sync for Image<'a, T>

§

impl<'a, T> Unpin for Image<'a, T>

§

impl<'a, T> UnwindSafe for Image<'a, T>
where T: RefUnwindSafe,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

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>,

Source§

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>,

Source§

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.