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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//! IMX: Image Processing and Manipulation Library
//!
//! This crate provides a comprehensive set of tools for image processing, manipulation,
//! and visualization. It includes functionality for:
//!
//! - Image processing operations (resizing, format conversion, transparency handling)
//! - JPEG XL format support and conversion
//! - Numerical operations for image data
//! - XY plotting capabilities for data visualization
//!
//! # Features
//!
//! - Efficient image processing with support for common operations
//! - JPEG XL format handling with conversion to PNG
//! - Letterboxing removal and transparency handling
//! - Data visualization through XY plotting
//!
//! # Example
//!
//! ```rust,no_run
//! use std::path::PathBuf;
//! use imx::{process_image, PlotConfig, create_plot, LabelAlignment};
//! use anyhow::Result;
//!
//! async fn example() -> Result<()> {
//! // Process an image
//! let path = PathBuf::from("input.jpg");
//! process_image(path, |p| async move {
//! // Process the image here
//! Ok(())
//! }).await?;
//!
//! // Create a plot
//! let config = PlotConfig {
//! images: vec![PathBuf::from("image1.png")],
//! output: PathBuf::from("output.png"),
//! rows: 1,
//! row_labels: vec![],
//! column_labels: vec![],
//! column_label_alignment: LabelAlignment::Center,
//! row_label_alignment: LabelAlignment::Center,
//! debug_mode: false,
//! top_padding: 40,
//! left_padding: 40,
//! font_size: None,
//! };
//! create_plot(&config)?;
//!
//! Ok(())
//! }
//! ```
/// Image processing module providing functions for image manipulation,
/// format conversion, and various transformations.
/// JPEG XL format support module with functions for handling JXL files
/// and converting them to other formats.
///
/// # Examples
///
/// ```rust,no_run
/// use std::path::Path;
/// use anyhow::Result;
/// use imx::jxl::process_jxl_file;
///
/// async fn example() -> Result<()> {
/// let input = Path::new("image.jxl");
///
/// // Process with a simple closure
/// process_jxl_file(input, Some(|path| async move {
/// // Custom processing logic here
/// Ok(())
/// })).await?;
///
/// Ok(())
/// }
/// ```
///
/// You can also use more complex processing logic:
///
/// ```rust,no_run
/// use std::path::Path;
/// use anyhow::Result;
/// use imx::jxl::process_jxl_file;
///
/// async fn example() -> Result<()> {
/// let input = Path::new("image.jxl");
///
/// // Process with more complex logic
/// process_jxl_file(input, Some(|path| async move {
/// // Load the PNG file
/// let img = image::open(&path)?;
///
/// // Apply some transformations
/// let processed = img.grayscale();
///
/// // Save back to the same path
/// processed.save(path)?;
/// Ok(())
/// })).await?;
///
/// Ok(())
/// }
/// ```
/// Numerical operations module for image data processing and analysis.
/// XY plotting module for creating visualizations and graphs.
///
/// # Examples
///
/// ```rust,no_run
/// use std::path::PathBuf;
/// use imx::{process_image, PlotConfig, create_plot, LabelAlignment};
/// use anyhow::Result;
///
/// async fn example() -> Result<()> {
/// // Process an image
/// let path = PathBuf::from("input.jpg");
/// process_image(path, |p| async move {
/// // Process the image here
/// Ok(())
/// }).await?;
///
/// // Create a plot
/// let config = PlotConfig {
/// images: vec![PathBuf::from("image1.png")],
/// output: PathBuf::from("output.png"),
/// rows: 1,
/// row_labels: vec![],
/// column_labels: vec![],
/// column_label_alignment: LabelAlignment::Center,
/// row_label_alignment: LabelAlignment::Center,
/// debug_mode: false,
/// top_padding: 40,
/// left_padding: 40,
/// font_size: None,
/// };
/// create_plot(&config)?;
///
/// Ok(())
/// }
/// ```
///
/// You can also use it with multiple images:
///
/// ```rust,no_run
/// use std::path::PathBuf;
/// use imx::{PlotConfig, create_plot, LabelAlignment};
/// use anyhow::Result;
///
/// fn example() -> Result<()> {
/// let config = PlotConfig {
/// images: vec![
/// PathBuf::from("image1.png"),
/// PathBuf::from("image2.png"),
/// ],
/// output: PathBuf::from("output.png"),
/// rows: 1,
/// row_labels: vec!["Row 1".to_string()],
/// column_labels: vec!["Col 1".to_string(), "Col 2".to_string()],
/// column_label_alignment: LabelAlignment::Center,
/// row_label_alignment: LabelAlignment::Center,
/// debug_mode: false,
/// top_padding: 40,
/// left_padding: 40,
/// font_size: None,
/// };
/// create_plot(&config)?;
/// Ok(())
/// }
/// ```
/// Layout module for debugging and visualizing image grid layouts
/// Image format conversion module with support for various formats
// Re-export commonly used types and functions
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;