Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
svbony
Safe, idiomatic Rust wrapper for the SVBony USB
camera SDK. Provides RAII camera handles, Rust enums, and Result-based error
handling over the C SDK.
SDK Installation
The SVBony Camera SDK is closed-source and not bundled with this crate. Download it from SVBony's download page and set an environment variable pointing to the SDK root:
See svbony-sys for platform support
details.
Quick Start
use *;
// List connected cameras
let cameras = connected_cameras.unwrap;
for info in &cameras
// Open the first camera
let cam = open.unwrap;
let prop = cam.property.unwrap;
println!;
// Configure and capture
cam.set_roi.unwrap;
cam.set_mode.unwrap;
cam.set_output_image_type.unwrap;
cam.set_control.unwrap;
cam.start_capture.unwrap;
let bpp = Raw16.bytes_per_pixel;
let mut buf = vec!;
cam.get_frame.unwrap;
cam.stop_capture.unwrap;
// Camera is automatically closed when `cam` is dropped.
Feature Flags
| Feature | Default | Description |
|---|---|---|
image |
off | Adds Camera::get_image() returning an image::DynamicImage. |
Using the image feature
[]
= { = "0.1", = ["image"] }
use *;
let cam = open.unwrap;
// ... configure ROI, mode, format ...
cam.start_capture.unwrap;
let img = cam.get_image.unwrap;
cam.stop_capture.unwrap;
img.save.unwrap;
Pixel format mapping:
ImageType |
DynamicImage variant |
|---|---|
Raw8, Y8 |
ImageLuma8 |
Raw10..Raw16, Y10..Y16 |
ImageLuma16 |
Rgb24 |
ImageRgb8 |
Rgb32 |
ImageRgba8 |
API Overview
Free Functions
sdk_version()-- SDK version stringconnected_cameras()-- list all connected cameras
Camera (RAII)
Open / close: Camera::open(id), auto-close on drop
Properties: property(), property_ex(), firmware_version(),
serial_number(), pixel_size(), supported_modes(), needs_upgrade()
Controls: num_controls(), control_caps(index), get_control(type),
set_control(type, value, auto)
Image format: output_image_type(), set_output_image_type(),
roi(), set_roi(), roi_ex(), set_roi_ex()
Capture: start_capture(), stop_capture(), get_frame(buf, timeout),
get_image(timeout) (feature = "image"), dropped_frames()
Mode / trigger: mode(), set_mode(), send_soft_trigger(),
set_trigger_output(), get_trigger_output()
Guide / misc: pulse_guide(), can_pulse_guide(),
white_balance_once(), set_auto_save(), restore_defaults()
License
Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).
Note: This crate does not bundle the SVBony SDK. The SDK itself is proprietary; refer to SVBony's terms for its usage conditions.