pub mod action;
pub mod action_bar;
pub mod actions;
pub mod composite;
pub mod controller;
pub mod history;
pub mod icons;
pub mod mode;
pub mod options_panel;
pub mod privacy;
pub mod registry;
pub mod selection;
pub mod settings;
pub mod stroke;
pub mod toolbar;
pub mod ui;
pub use action::{
ActionContext, ActionInfo, ActionResult, DrawingContext, ScreenAction, ToolCategory,
};
pub use action_bar::ActionBar;
pub use history::History;
pub use icons::IconCache;
pub use mode::{ModeState, ScreenshotMode};
pub use options_panel::OptionsPanel;
pub use privacy::{PrivacyRegion, PrivacyTool, apply_blur, apply_mosaic, apply_smart_erase};
pub use registry::{ActionRegistry, create_default_registry};
pub use selection::Selection;
pub use settings::ScreenshotSettings;
pub use toolbar::Toolbar;
pub use controller::ScreenshotFeature;
use crate::error::Result;
#[derive(Debug, Clone, Copy)]
pub struct ScreenRegion {
pub x: i32,
pub y: i32,
pub width: u32,
pub height: u32,
}
impl ScreenRegion {
pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self {
Self { x, y, width, height }
}
}
#[derive(Debug, Clone)]
pub struct ScreenshotResult {
pub region: ScreenRegion,
pub image: Vec<u8>,
}
impl ScreenshotResult {
pub fn new(region: ScreenRegion, image: Vec<u8>) -> Self {
Self { region, image }
}
}
pub fn start_interactive() -> Result<Option<ScreenshotResult>> {
Ok(None)
}
pub fn capture_region(region: ScreenRegion) -> Result<ScreenshotResult> {
#[cfg(feature = "screen")]
{
let capture = crate::screen::capture_screen_region(
Some(region.x as u32),
Some(region.y as u32),
Some(region.width),
Some(region.height),
)?;
Ok(ScreenshotResult::new(region, capture.image))
}
#[cfg(not(feature = "screen"))]
{
Err(crate::error::AumateError::Screenshot("Screen capture feature not enabled".to_string()))
}
}