1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! Processing blocks available to the RealSense library
//!
//! Processing blocks are used to apply various filters and transformations to frame data.
//! Each processing block operates on frames and outputs modified versions.
//!
//! ## Available Processing Blocks
//!
//! ### Core Processing Blocks
//! - [`align`] - Aligns frames from different sensors to a common coordinate system
//! - [`colorizer`] - Converts depth frames to RGB format for visualization
//! - [`decimation`] - Reduces the resolution of depth frames
//! - [`pointcloud`] - Generates 3D point clouds from depth data
//!
//! ### Filtering Blocks
//! - [`spatial_filter`] - Performs spatial filtering to smooth depth data
//! - [`temporal_filter`] - Reduces temporal noise by averaging frames over time
//! - [`hole_filling`] - Fills holes in depth data using adjacent pixels
//! - [`threshold`] - Filters depth values based on min/max thresholds
//!
//! ### Transform Blocks
//! - [`disparity_transform`] - Converts between depth and disparity domains
//!
//! ### Configuration
//! - [`options`] - Runtime configuration options for processing blocks
//!
//! ## Usage Examples
//!
//! ### Basic Colorizer
//! ```rust,no_run
//! use realsense_rust::processing_blocks::colorizer::Colorizer;
//! use std::time::Duration;
//!
//! # fn example() -> anyhow::Result<()> {
//! let mut colorizer = Colorizer::new(5)?;
//!
//! // Process a depth frame
//! # let depth_frame = todo!(); // Get depth frame from pipeline
//! colorizer.queue(depth_frame)?;
//! let colorized_frame = colorizer.wait(Duration::from_millis(100))?;
//! # Ok(())
//! # }
//! ```
//!
//! ### Filter Chain
//! ```rust,no_run
//! use realsense_rust::processing_blocks::{
//! decimation::Decimation,
//! spatial_filter::SpatialFilter,
//! temporal_filter::TemporalFilter,
//! hole_filling::HoleFillingFilter,
//! colorizer::Colorizer,
//! };
//! use std::time::Duration;
//!
//! # fn example() -> anyhow::Result<()> {
//! // Create filter chain
//! let mut decimation = Decimation::new(5)?;
//! let mut spatial_filter = SpatialFilter::new(5)?;
//! let mut temporal_filter = TemporalFilter::new(5)?;
//! let mut hole_filling = HoleFillingFilter::new(5)?;
//! let mut colorizer = Colorizer::new(5)?;
//!
//! # let depth_frame = todo!(); // Get depth frame
//! // Apply filters in sequence
//! decimation.queue(depth_frame)?;
//! let frame = decimation.wait(Duration::from_millis(100))?;
//!
//! spatial_filter.queue(frame)?;
//! let frame = spatial_filter.wait(Duration::from_millis(100))?;
//!
//! temporal_filter.queue(frame)?;
//! let frame = temporal_filter.wait(Duration::from_millis(100))?;
//!
//! hole_filling.queue(frame)?;
//! let frame = hole_filling.wait(Duration::from_millis(100))?;
//!
//! colorizer.queue(frame)?;
//! let colorized_frame = colorizer.wait(Duration::from_millis(100))?;
//! # Ok(())
//! # }
//! ```
//!
//! See the `examples/` directory for complete working examples.