MCPcopy Create free account

hub / github.com/RustCV/RustCV / functions

Functions314 in github.com/RustCV/RustCV

↓ 14 callersFunctionv4l2_ioctl
Call a V4L2 ioctl and convert errors to `io::Result`. 调用 V4L2 ioctl 并将错误转换为 `io::Result`。 # Safety The caller must ensure `arg` points to a valid, co
rustcv-camera/src/backend/linux/sys.rs:75
↓ 9 callersFunctionclamp
(val: i32)
rustcv-backend-msmf/examples/camera_view/convert.rs:89
↓ 9 callersMethoddata
Access the raw pixel data as a byte slice. 以字节切片形式访问原始像素数据。
rustcv-camera/src/mat.rs:84
↓ 9 callersFunctionopen
Opens a camera device and negotiates the video format based on configuration This is the main entry point for opening a camera. The function: 1. Init
rustcv-backend-msmf/src/device.rs:210
↓ 8 callersMethodformat
添加像素格式要求 支持传入 PixelFormat 或 FourCC (会自动转换)
rustcv-core/src/builder.rs:51
↓ 8 callersMethodis_empty
Returns `true` if this Mat contains no data. 如果此 Mat 不包含数据则返回 `true`。
rustcv-camera/src/mat.rs:78
↓ 7 callersMethodresolution
添加分辨率要求
rustcv-core/src/builder.rs:38
↓ 6 callersFunctionclamp
(val: i32)
rustcv/src/videoio/mod.rs:374
↓ 6 callersFunctionclamp
(val: i32)
rustcv-camera/src/decode.rs:226
↓ 6 callersFunctionclip
(val: i32)
rustcv-backend-v4l2/examples/dual_web_streaming.rs:298
↓ 6 callersFunctionclip
(val: i32)
rustcv-backend-v4l2/examples/camera_view.rs:202
↓ 6 callersFunctionclip
(val: i32)
rustcv-backend-v4l2/examples/dual_camera_view.rs:223
↓ 6 callersFunctionclip
(val: i32)
rustcv-backend-v4l2/examples/web_streaming.rs:243
↓ 6 callersFunctionfourcc
Helper macro to build a FourCC u32 from 4 ASCII bytes. 辅助宏:从 4 个 ASCII 字节构造 FourCC u32 值。
rustcv-camera/src/pixel_format.rs:77
↓ 6 callersMethodfps
添加帧率要求
rustcv-core/src/builder.rs:44
↓ 6 callersMethodopen
( &self, id: &str, config: rustcv_core::builder::CameraConfig, )
rustcv-backend-v4l2/src/lib.rs:35
↓ 6 callersMethodsequence
Driver-assigned frame sequence number. 驱动分配的帧序号。
rustcv-camera/src/frame.rs:143
↓ 5 callersMethoddata_mut
Access the raw pixel data as a mutable byte slice. 以可变字节切片形式访问原始像素数据。
rustcv-camera/src/mat.rs:90
↓ 5 callersMethodensure_size
Ensure the internal buffer is large enough for the given dimensions. 确保内部缓冲区对于给定尺寸足够大。 If the size matches the current allocation, no reallocation oc
rustcv-camera/src/mat.rs:65
↓ 5 callersMethodnext_frame
Capture the next frame (zero-copy). 采集下一帧(零拷贝)。 The returned [`Frame`] borrows directly from the kernel's mmap buffer. No data is copied. The frame m
rustcv-camera/src/camera.rs:113
↓ 5 callersMethodnext_frame
(&mut self)
rustcv-backend-v4l2/src/stream.rs:66
↓ 5 callersMethodread
Read the next frame, decoded as BGR, into the provided [`Mat`]. 读取下一帧,解码为 BGR,写入提供的 [`Mat`]。 The `Mat` is reused across calls — its internal buffer i
rustcv-camera/src/videocapture.rs:72
↓ 5 callersMethodstart
(&mut self)
rustcv-backend-v4l2/src/stream.rs:52
↓ 4 callersMethodheight
Image height in pixels. 图像高度(像素)。
rustcv-camera/src/frame.rs:131
↓ 4 callersMethodlist_devices
(&self)
rustcv-backend-v4l2/src/lib.rs:31
↓ 4 callersMethodwidth
Image width in pixels. 图像宽度(像素)。
rustcv-camera/src/frame.rs:125
↓ 3 callersMethodfps
Set the desired frame rate. 设置期望的帧率。
rustcv-camera/src/config.rs:89
↓ 3 callersFunctionioc
Build V4L2 ioctl command numbers at compile time. 在编译时构造 V4L2 ioctl 命令号。 Linux ioctl encoding: `direction(2) | size(14) | type(8) | nr(8)` Linux ioct
rustcv-camera/src/backend/linux/sys.rs:30
↓ 3 callersMethodopen
Open a camera by device index (0 = first camera). 按设备索引打开摄像头(0 = 第一个摄像头)。 Uses default configuration: 640x480, 30fps, auto format selection. 使用默认配置:6
rustcv-camera/src/camera.rs:55
↓ 3 callersFunctionqueue_buffer
Enqueue a buffer — return it to the driver for filling (VIDIOC_QBUF). 将缓冲区入队 —— 归还给驱动以便其写入新数据(VIDIOC_QBUF)。
rustcv-camera/src/backend/linux/sys.rs:288
↓ 3 callersMethodresolution
Set the desired resolution. 设置期望的分辨率。
rustcv-camera/src/config.rs:81
↓ 3 callersFunctionrgb_to_u32
(r: u32, g: u32, b: u32)
rustcv-backend-msmf/examples/camera_view/convert.rs:94
↓ 3 callersFunctionset_media_type_uint64
Sets a 64-bit unsigned integer attribute on the current media type.
rustcv-backend-msmf/src/controls.rs:34
↓ 3 callersFunctionyuyv_to_bgr
Convert YUYV (YUV 4:2:2) packed data to BGR24. 将 YUYV(YUV 4:2:2)打包数据转换为 BGR24。 Uses BT.601 standard with integer arithmetic (no floating point). 使用 B
rustcv-camera/src/decode.rs:160
↓ 2 callersMethodcopy_row
( &mut self, src: *const u8, row: usize, src_pitch: usize, row_bytes:
rustcv-backend-msmf/src/stream.rs:411
↓ 2 callersMethodcorrect
输入一帧的原始硬件时间戳,返回矫正后的系统时间 `hw_ns`: 驱动提供的硬件时间戳 (纳秒) `arrival_time`: 帧到达用户态的系统时刻
rustcv-core/src/time.rs:47
↓ 2 callersFunctiondecode_frame
Decode a [`Frame`] into a BGR [`Mat`]. 将 [`Frame`] 解码为 BGR [`Mat`]。 The `decompressor` parameter is for reusing a turbojpeg Decompressor across frame
rustcv-camera/src/decode.rs:36
↓ 2 callersFunctiondraw_text_osd
(buf: &mut [u32], buf_width: usize, text: &str, x: usize, y: usize, color: u32)
rustcv-backend-avf/examples/camera_view.rs:251
↓ 2 callersFunctionfrom_v4l_fourcc
将 v4l crate 的 FourCC 转换为 rustcv-core 的 FourCC
rustcv-backend-v4l2/src/pixel_map.rs:5
↓ 2 callersFunctionget_attribute_string
Extracts a string attribute from a Media Foundation device
rustcv-backend-msmf/src/device.rs:166
↓ 2 callersFunctionget_current_media_type
Gets the current media type from the source reader.
rustcv-backend-msmf/src/controls.rs:27
↓ 2 callersFunctionget_media_type_uint64
Gets a 64-bit unsigned integer attribute from the current media type.
rustcv-backend-msmf/src/controls.rs:41
↓ 2 callersFunctionget_runtime
获取全局 Runtime,如果不存在则创建 这允许用户不写 #[tokio::main] 也能跑异步驱动
rustcv/src/internal/runtime.rs:9
↓ 2 callersMethodget_src_ptr
( &self, scanline0: *mut u8, pitch: i32, src_pitch: usize, total_heigh
rustcv-backend-msmf/src/stream.rs:395
↓ 2 callersFunctioninitialize_mf
Initializes the Media Foundation and COM subsystem This function performs one-time initialization of the Windows Media Foundation and COM runtime. It
rustcv-backend-msmf/src/device.rs:48
↓ 2 callersMethodinstant_to_duration
(&self, t: Instant)
rustcv-core/src/time.rs:140
↓ 2 callersMethodinstant_to_scalar
辅助:将 Instant 转为 f64 (秒), 仅用于计算差值
rustcv-core/src/time.rs:116
↓ 2 callersMethodlist_devices
(&self)
rustcv-backend-avf/src/lib.rs:37
↓ 2 callersMethodlist_devices
Lists all available video capture devices. This method initializes Media Foundation if needed and enumerates all connected video capture devices. #
rustcv-backend-msmf/src/lib.rs:119
↓ 2 callersFunctionmjpeg_stream_response
通用 MJPEG 响应构造器
rustcv-backend-v4l2/examples/dual_web_streaming.rs:215
↓ 2 callersMethodnext_frame
Waits for and returns the next available frame. This method uses a semaphore to efficiently wait for new frames without busy-waiting.
rustcv-backend-msmf/src/stream.rs:495
↓ 2 callersMethodpixel_format
Pixel format of the raw data. 原始数据的像素格式。
rustcv-camera/src/frame.rs:137
↓ 2 callersFunctionpixel_idx
(x: usize, y: usize, width: usize, buf_len: usize)
rustcv-backend-avf/examples/camera_view.rs:284
↓ 2 callersFunctionrequest_buffers
Request mmap buffers from the kernel (VIDIOC_REQBUFS). 向内核申请 mmap 缓冲区(VIDIOC_REQBUFS)。 The kernel may allocate fewer buffers than requested. Check `r
rustcv-camera/src/backend/linux/sys.rs:259
↓ 2 callersFunctionrgb_to_bgr
Swap R and B channels: RGB24 → BGR24. 交换 R 和 B 通道:RGB24 → BGR24。
rustcv-camera/src/decode.rs:213
↓ 2 callersMethodset_resolution
【新增】设置分辨率 这是一个同步阻塞调用,会等待后台完成硬件重启
rustcv/src/videoio/mod.rs:269
↓ 2 callersFunctionspawn_camera_producer
辅助函数:启动一个摄像头的采集、编码、广播循环
rustcv-backend-v4l2/examples/dual_web_streaming.rs:113
↓ 2 callersMethodstart
开始计时 (Start)
rustcv/src/core/tick_meter.rs:28
↓ 2 callersMethodstop
停止计时 (Stop) 停止后,时间会累积到 total_time 中,且计数器 +1
rustcv/src/core/tick_meter.rs:36
↓ 2 callersMethodto_fourcc
Convert back to a V4L2 FourCC `u32`. 转换回 V4L2 FourCC `u32`。
rustcv-camera/src/pixel_format.rs:112
↓ 2 callersFunctionyuyv_to_rgb32
复用之前的 YUYV 转 RGB 逻辑
rustcv-backend-v4l2/examples/dual_camera_view.rs:177
↓ 1 callersFunctionadd
(left: u64, right: u64)
rustcv-simulation/src/lib.rs:1
↓ 1 callersMethodallocate_buffers
Allocate mmap buffers from the kernel. 从内核分配 mmap 缓冲区。 Steps: 1. VIDIOC_REQBUFS — ask kernel for N buffers 2. For each buffer: VIDIOC_QUERYBUF → mmap
rustcv-camera/src/backend/linux/mod.rs:402
↓ 1 callersFunctionbgr_to_u32
Convert BGR byte slice to u32 display buffer (0x00RRGGBB). 将 BGR 字节切片转换为 u32 显示缓冲区(0x00RRGGBB)。
rustcv-camera/examples/camera_demo.rs:70
↓ 1 callersFunctionbgr_to_u32
Convert BGR byte slice to u32 display buffer (0x00RRGGBB). 将 BGR 字节切片转换为 u32 显示缓冲区(0x00RRGGBB)。
rustcv-camera/examples/resolution_bench.rs:143
↓ 1 callersFunctionbgra32_to_bgr
Drop the alpha channel from BGRA32 to produce BGR24. 从 BGRA32 去掉 Alpha 通道,生成 BGR24。 Input: [B, G, R, A, B, G, R, A, ...] (4 bytes/pixel) Output: [B
rustcv-camera/src/decode.rs:200
↓ 1 callersFunctionbgra_to_bgr
辅助:BGRA -> BGR
rustcv/src/videoio/mod.rs:385
↓ 1 callersFunctionbgra_to_rgb32
( src: &[u8], // AVFoundation 返回的 BGRA 原始像素数据 dst: &mut [u32], // minifb 的 0x00RRGGBB 缓冲区 wid
rustcv-backend-avf/examples/camera_view.rs:196
↓ 1 callersMethodbpp_estimate
估算每像素比特数 (Bits Per Pixel),用于计算带宽
rustcv-core/src/pixel_format.rs:111
↓ 1 callersFunctionbuild_avf_bridge
()
rustcv-camera/build.rs:10
↓ 1 callersFunctioncalculate_format_score
Calculates a score for format selection based on configuration preferences The scoring algorithm prioritizes: 1. Exact resolution match (if configure
rustcv-backend-msmf/src/device.rs:395
↓ 1 callersFunctioncalculate_score
(config: &CameraConfig, w: u32, h: u32, fmt: PixelFormat)
rustcv-backend-v4l2/src/device.rs:125
↓ 1 callersMethodcamera
Access the underlying [`Camera`] for advanced operations. 访问底层 [`Camera`] 进行高级操作。
rustcv-camera/src/videocapture.rs:97
↓ 1 callersFunctioncapture_queue
返回专用的帧捕获串行队列(全局单例,惰性初始化)。 使用串行队列保证帧回调顺序执行,且不阻塞主线程。
rustcv-backend-avf/src/gcd.rs:16
↓ 1 callersFunctionchar_bitmap
(c: char)
rustcv-backend-avf/examples/camera_view.rs:301
↓ 1 callersFunctionchar_glyph
Minimal 5x7 bitmap font glyph for a character. 字符的最小 5x7 位图字体字形。 Each element is a row bitmask (5 bits used, MSB = leftmost pixel). 每个元素是一行的位掩码(使用 5
rustcv-camera/examples/camera_demo.rs:131
↓ 1 callersFunctionchar_glyph
(ch: char)
rustcv-camera/examples/resolution_bench.rs:194
↓ 1 callersFunctionclose_device
Close a V4L2 device file descriptor. 关闭 V4L2 设备文件描述符。
rustcv-camera/src/backend/linux/sys.rs:389
↓ 1 callersFunctioncombine_buffers
将两个 640x480 的图拼成一个 1280x480 的图
rustcv-backend-v4l2/examples/dual_camera_view.rs:159
↓ 1 callersMethodconfig
Get the resolved (actual) configuration. 获取已协商的(实际)配置。
rustcv-camera/src/camera.rs:141
↓ 1 callersMethodcopy_from_2d_buffer
Copies frame data from a 2D buffer with stride handling.
rustcv-backend-msmf/src/stream.rs:317
↓ 1 callersMethodcopy_from_linear_buffer
Copies frame data from a linear/contiguous buffer.
rustcv-backend-msmf/src/stream.rs:428
↓ 1 callersMethodcopy_packed_data
Copies packed format data
rustcv-backend-msmf/src/stream.rs:367
↓ 1 callersMethodcopy_planar_data
Copies planar format data (NV12, YV12).
rustcv-backend-msmf/src/stream.rs:334
↓ 1 callersMethodcopy_sample_to_linear_buffer
Copies frame data from an IMFSample to the linear buffer.
rustcv-backend-msmf/src/stream.rs:303
↓ 1 callersFunctioncreate_controls
(source_reader: SendableSourceReader)
rustcv-backend-msmf/src/controls.rs:14
↓ 1 callersFunctioncreate_controls
(dev: Arc<Device>)
rustcv-backend-v4l2/src/controls.rs:30
↓ 1 callersFunctioncreate_driver
创建驱动实例的工厂函数
rustcv/src/videoio/backend.rs:13
↓ 1 callersFunctioncreate_dummy_controls
()
rustcv-backend-avf/src/lib.rs:82
↓ 1 callersFunctioncreate_media_source
Creates a MediaSource for a specific camera device # Arguments `id` - Device symbolic link ID # Returns The created IMFMediaSource interface for the
rustcv-backend-msmf/src/device.rs:244
↓ 1 callersFunctiondecode_mjpeg
(src: &[u8], mat: &mut Mat)
rustcv-camera/src/decode.rs:93
↓ 1 callersMethoddequeue
Dequeue the next frame (blocking). 出队下一帧(阻塞)。 Blocks until AVFoundation delivers a frame, then copies BGRA32 pixel data into `self.frame_buf`. Return
rustcv-camera/src/backend/macos/mod.rs:209
↓ 1 callersFunctiondequeue_buffer
Dequeue a buffer — retrieve a filled buffer from the driver (VIDIOC_DQBUF). 将缓冲区出队 —— 从驱动取回已写满数据的缓冲区(VIDIOC_DQBUF)。 This call **blocks** until a fram
rustcv-camera/src/backend/linux/sys.rs:318
↓ 1 callersFunctiondestroy_all_windows
销毁所有窗口
rustcv/src/highgui/mod.rs:116
↓ 1 callersFunctiondraw_fps_overlay
Draw FPS value as white pixels in the top-left corner. 在左上角用白色像素绘制 FPS 数值。 Uses a minimal 5x7 bitmap font — no external font dependencies. 使用最小的 5x7
rustcv-camera/examples/camera_demo.rs:84
↓ 1 callersFunctiondraw_fps_overlay
Draw FPS and resolution label overlay. 绘制 FPS 和分辨率标签叠加。
rustcv-camera/examples/resolution_bench.rs:154
↓ 1 callersFunctiondump_capabilities
(dev_path: &str)
rustcv-backend-msmf/examples/camera_view/main.rs:145
↓ 1 callersFunctiondump_capabilities
(dev_path: &str)
rustcv-backend-v4l2/examples/camera_view.rs:213
↓ 1 callersFunctionencode_frame_to_jpeg
--- 图像编码逻辑 (与之前相同) ---
rustcv-backend-v4l2/examples/dual_web_streaming.rs:244
↓ 1 callersFunctionencode_frame_to_jpeg
辅助函数:YUYV -> JPEG 注意:这里的性能不是最优的,仅做演示。 生产环境应直接使用 libjpeg-turbo 的 C 绑定或 SIMD 优化的库。
rustcv-backend-v4l2/examples/web_streaming.rs:186
next →1–100 of 314, ranked by callers