Expand description
Safe Rust API for Hikrobot MVS cameras. Hikrobot MVS 相机的安全 Rust API。
The crate keeps Hikrobot’s C/C++ types behind a small C ABI. Camera handles and frame 本 crate 通过精简的 C ABI 隔离 Hikrobot 的 C/C++ 类型。相机句柄与帧 buffers are released through RAII, while callback data is copied into Rust-owned memory 缓冲区通过 RAII 释放,回调数据则复制到 Rust 自有内存中, before it leaves the SDK callback thread. 确保数据离开 SDK 回调线程前已经完成复制。
§Typical workflow
§典型工作流程
- Create one
Sdkguard withSdk::initialize. - 使用
Sdk::initialize创建一个Sdk生命周期守卫。 - Discover devices with
Sdk::enumerateand open one by serial number. - 使用
Sdk::enumerate发现设备,并按序列号打开相机。 - Configure GenICam nodes, select a trigger mode, then call
Camera::start. - 配置 GenICam 节点并选择触发模式,然后调用
Camera::start。 - Acquire frames with
Camera::graborCamera::frame_channel. - 使用
Camera::grab或Camera::frame_channel获取帧。
Dropping Frame, Camera, and Sdk releases resources in the required order.
Frame、Camera 和 Sdk 析构时会按要求的顺序释放资源。
Modules§
- camera
- Camera handles, acquisition control, and general operations. 相机句柄、采集控制与通用操作。 Camera handles and control. 相机句柄与控制。
- error
- Error and result types. 错误和结果类型。 Error handling. 错误处理。
- events
- Callbacks, asynchronous events, and network statistics. 回调、异步事件和网络统计。 Callback events and network statistics. 回调事件与网络统计。
- frame
- Frame buffers, Chunk metadata, and output formats. 帧缓冲、Chunk 元数据与输出格式。 Image frames and Chunk data. 图像帧与 Chunk 数据。
- imaging
- Image encoding and geometric transformation types. 图片编码和几何变换类型。 Image encoding and geometric transforms. 图片编码与几何变换。
- params
- GenICam parameter values and constraints. GenICam 参数值及约束类型。 GenICam parameter values. GenICam 参数值。
- sdk
- SDK lifetime, discovery, and network-level operations. SDK 生命周期、设备发现与网络级操作。 SDK lifetime and device discovery. SDK 生命周期与设备发现。
Structs§
- Action
Result - Acknowledgement returned by one device after an Action Command broadcast. 在Action Command广播后,一台设备返回了确认。
- Camera
- Exclusive camera handle tied to the lifetime of an initialized
Sdk. 独占的相机句柄,绑定于初始化的Sdk的生命周期。 - Camera
Event - Owned camera event delivered by
Camera::event_channel. 由Camera::event_channel提供自有相机事件。 - Chunk
Metadata - Frame watermark and Chunk fields parsed by the MVS SDK. 帧水印和块字段由 MVS SDK 解析。
- Device
Info - Owned camera description produced by device enumeration. 自有相机描述由设备枚举生成。
- Float
Value - Floating-point GenICam node value and constraints. 浮点 GenICam 节点值与约束。
- Frame
- Owned frame returned by synchronous acquisition and image transforms. 拥有帧通过同步采集和图像转换返回。
- IntValue
- Integer GenICam node value and constraints. 整数GenICam节点值与约束。
- Network
Stats - Cumulative GigE stream health counters returned by
Camera::network_stats. 累计GigE流的健康状态计数器由Camera::network_stats返回。 - Owned
Frame - Rust-owned frame delivered by
Camera::frame_channel. 由Camera::frame_channel交付、所有权属于 Rust 的帧。 - Sdk
- Process-level MVS SDK lifetime guard. 进程级MVS SDK生命周期守护。
- SdkVersion
- Four-component version number reported by
MV_CC_GetSDKVersion. 四组件版本号由“MV_CC_GetSDKVersion”报告。
Enums§
- Error
- Error produced by the safe wrapper before or during an MVS operation. 安全封装层在MVS操作前或运行期间产生的错误。
- Exception
Event - Asynchronous device exception delivered by
Camera::exception_channel. 异步设备异常由Camera::exception_channel提供。 - Flip
Direction - Axis used by
Camera::flip. 轴线由Camera::flip使用。 - Image
Format - File encoding used by
Camera::save_image. 文件编码由Camera::save_image使用。 - Output
Format - Pixel representation requested from
Camera::grab. 像素表示请求来自Camera::grab。 - Rotation
- Clockwise rotation angle for
Camera::rotate. 顺时针旋转角度 Camera::rotate。 - Transport
- Camera transport reported by the MVS enumeration API. MVS枚举API报告的相机传输。
Type Aliases§
- Result
- Result type returned by all fallible high-level operations in this crate. 该箱中所有可出错的高层操作返回的结果类型。