Struct apriltag::image_buf::Image

source ·
#[repr(transparent)]
pub struct Image { /* private fields */ }
Expand description

The single-channel image with pixels in bytes.

Implementations§

Give width and height and create an uninitialized image.

Safety

After the image is returned, the caller must explicitly initialize the image buffer.

Give width, height and stride and create an uninitialized image.

Safety

After the image is returned, the caller must explicitly initialize the image buffer.

Create an image from a PNM file.

Create an image from a PNM file with a specified alignment.

Create a zerod image.

The stride must be more than or equal to width. Otherwise it returns None.

Create a zerod image.

The alignment must be non-zero. Otherwise it returns None.

Create an iterator traversing pixels in row-major order.

Create an iterator that traverses pixels with pixel positions in row-major order.

The iterator item is in (x, y, pixel_value) format.

Gets the image width.

Gets the image height.

Gets the per-row stride in bytes.

Get the pixel buffer with size height*stride.

Get the mutable pixel buffer with size height*stride.

Creates an instance from pointer.

The pointer will be managed by the type. Do not run manual deallocation on the pointer. Panics if the pointer is null.

Safety

The method is safe when the pointer was created by image_u8_create_stride or image_u8_create_alignment.

Returns the underlying pointer.

Trait Implementations§

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.