Crate nokhwa[][src]

Modules

backends

Raw access to each of Nokhwa’s backends.

Structs

Camera

The main Camera struct. This is the struct that abstracts over all the backends, providing a simplified interface for use. For more details, please refer to CaptureBackendTrait

CameraFormat

This is a convenience struct that holds all information about the format of a webcam stream. It consists of a Resolution, FrameFormat, and a framerate(u8).

CameraInfo

Information about a Camera e.g. its name. description amd misc may contain backend-specific information. index is a camera’s index given to it by (usually) the OS usually in the order it is known to the system.

Resolution

Describes a Resolution. This struct consists of a Width and a Height value (x,y).
Note: the Ord implementation of this struct is flipped from highest to lowest.

Enums

CaptureAPIBackend

The list of known capture backends to the library.
Note: Only V4L2 and UVC (and by extension AUTO) is implemented so far.

FrameFormat

Describes a frame format (i.e. how the bytes themselves are encoded). Often called FourCC
YUYV is a mathematical color space. You can read more here.
MJPEG is a motion-jpeg compressed frame, it allows for high frame rates.

NokhwaError

All errors in Nokhwa.

Traits

CaptureBackendTrait

This trait is for any backend that allows you to grab and take frames from a camera. Many of the backends are blocking, if the camera is occupied the library will block while it waits for it to become availible.

VirtualBackendTrait

Functions

mjpeg_to_rgb888

Converts a MJPEG stream of u8 into a Vec of RGB888. (R,G,B,R,G,B,…)

yuyv422_to_rgb888

Converts a YUYV 4:2:2 datastream to a RGB888 Stream. For further reading

yuyv444_to_rgb888

Convert YCbCr 4:4:4 to a RGB888. For further reading