Skip to main content

Module utils

Module utils 

Source

Structs§

CameraControl
This struct tells you everything about a particular KnownCameraControl.
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 frame rate(u8).
CameraInfo
Information about a Camera e.g. its name. description amd misc may contain information that may differ from backend to backend. Refer to each backend for details. index is a camera’s index given to it by (usually) the OS usually in the order it is known to the system.
RequestedFormat
A request to the camera for a valid CameraFormat
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§

ApiBackend
The list of known capture backends to the library.
CameraIndex
Describes the index of the camera.
ControlValueDescription
The values for a CameraControl.
ControlValueSetter
The setter for a control value
FrameFormat
Describes a frame format (i.e. how the bytes themselves are encoded). Often called FourCC.
KnownCameraControl
The list of known camera controls to the library.
These can control the picture brightness, etc.
Note that not all backends/devices support all these. Run supported_camera_controls() to see which ones can be set.
KnownCameraControlFlag
This tells you weather a KnownCameraControl is automatically managed by the OS/Driver or manually managed by you, the programmer.
RequestedFormatType
Tells the init function what camera format to pick.

Functions§

all_known_camera_controls
All camera controls in an array.
buf_bgr_to_rgb
buf_mjpeg_to_rgb
Equivalent to mjpeg_to_rgb except with a destination buffer.
buf_nv12_to_rgb
Converts a YUYV 4:2:0 bi-planar (NV12) datastream to a RGB888 Stream and outputs it into a destination buffer. For further reading
buf_yuyv422_to_rgb
Same as yuyv422_to_rgb but with a destination buffer instead of a return Vec<u8>
color_frame_formats
Returns all the color frame formats
frame_formats
Returns all the frame formats
mjpeg_to_rgb
Converts a MJPEG stream of &[u8] into a Vec<u8> of RGB888. (R,G,B,R,G,B,…)
nv12_to_rgb
Converts a YUYV 4:2:0 bi-planar (NV12) datastream to a RGB888 Stream. For further reading
yuyv422_predicted_size
Returns the predicted size of the destination YUYV422 buffer.
yuyv422_to_rgb
Converts a YUYV 4:2:2 datastream to a RGB888 Stream. For further reading
yuyv444_to_rgb
Convert YCbCr 4:4:4 to a RGB888. For further reading
yuyv444_to_rgba
Convert YCbCr 4:4:4 to a RGBA8888. For further reading