| 34 | #[derive(Debug, Parser)] |
| 35 | #[clap(name = "transform", verbatim_doc_comment)] |
| 36 | struct CmdlineOptions { |
| 37 | /// The log level |
| 38 | #[clap(short, long, default_value_t = tracing::Level::INFO)] |
| 39 | log_level: tracing::Level, |
| 40 | |
| 41 | /// Output file to write result to. Defaults to stdout. |
| 42 | #[clap(short, long)] |
| 43 | output: Option<PathBuf>, |
| 44 | |
| 45 | /// Input file to read input from. Defaults to stdin. |
| 46 | #[clap(short, long)] |
| 47 | input: Option<PathBuf>, |
| 48 | |
| 49 | /// How to center the affine transformation |
| 50 | #[clap(long, default_value = "origin")] |
| 51 | center: TransformCenter, |
| 52 | |
| 53 | /// Degrees CCW rotation, applied before any other transformation |
| 54 | #[clap(short, long, default_value_t = 0.0)] |
| 55 | rotation: f64, |
| 56 | |
| 57 | /// Symmetric multiplicative scale, applied after rotation, applied before any x or y scales |
| 58 | #[clap(short, long)] |
| 59 | scale: Option<f64>, |
| 60 | |
| 61 | /// The x multiplicative scale, applied after rotation |
| 62 | #[clap(long)] |
| 63 | scale_x: Option<f64>, |
| 64 | |
| 65 | /// The y multiplicative scale, applied after rotation |
| 66 | #[clap(long)] |
| 67 | scale_y: Option<f64>, |
| 68 | |
| 69 | /// The x additive offset, applied after scale |
| 70 | #[clap(long)] |
| 71 | offset_x: Option<f64>, |
| 72 | |
| 73 | /// The y additive offset, applied after scale |
| 74 | #[clap(long)] |
| 75 | offset_y: Option<f64>, |
| 76 | |
| 77 | /// Degrees x skew, applied after offset |
| 78 | #[clap(long)] |
| 79 | skew_x: Option<f64>, |
| 80 | |
| 81 | /// Degrees y skew, applied after offset |
| 82 | #[clap(long)] |
| 83 | skew_y: Option<f64>, |
| 84 | |
| 85 | /// Convert the input geometries from (x, y) to (r, theta) |
| 86 | /// |
| 87 | /// Any affine transformations are applied in the original coordinate space |
| 88 | #[clap(long, conflicts_with = "from_polar")] |
| 89 | to_polar: bool, |
| 90 | |
| 91 | /// Convert the input geometries from (r, theta) to (x, y) |
| 92 | /// |
| 93 | /// Any affine transformations are applied in the original coordinate space |
nothing calls this directly
no outgoing calls
no test coverage detected