Skip to main content

hdim_core/
state.rs

1//! Application state management.
2//!
3//! This module defines the core state structures used to track the active tool
4//! and tool-specific configuration (like crop boundaries).
5
6/// Represents the currently active tool in the editor.
7#[derive(Clone, Copy, Debug, PartialEq)]
8pub enum Tool {
9    /// The transform tool, allowing rotation, flipping, and cropping.
10    Transform,
11    /// The EXIF metadata viewer.
12    Exif,
13}
14
15/// Represents the state of the transform tool operation.
16#[derive(Clone, Copy, Debug, PartialEq, Default)]
17pub struct TransformState {
18    /// Pixels to remove from the left edge.
19    pub left: u32,
20    /// Pixels to remove from the right edge.
21    pub right: u32,
22    /// Pixels to remove from the top edge.
23    pub top: u32,
24    /// Pixels to remove from the bottom edge.
25    pub bottom: u32,
26    /// Rotation in degrees (0, 90, 180, 270).
27    pub rotation: i32,
28    /// Whether the image is flipped horizontally.
29    pub flip_horizontal: bool,
30    /// Whether the image is flipped vertically.
31    pub flip_vertical: bool,
32}