magick_rust/types/
geometry_info.rs

1/*
2 * Copyright 2024 5ohue
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16use crate::bindings;
17
18#[derive(Debug, Copy, Clone, PartialEq)]
19pub struct GeometryInfo(bindings::GeometryInfo);
20
21impl GeometryInfo {
22    pub fn new() -> GeometryInfo {
23        let inner = bindings::GeometryInfo {
24            rho: 0.0,
25            sigma: 0.0,
26            xi: 0.0,
27            psi: 0.0,
28            chi: 0.0,
29        };
30
31        Self(inner)
32    }
33
34    pub fn set_rho(&mut self, rho: f64) {
35        self.0.rho = rho;
36    }
37    pub fn set_sigma(&mut self, sigma: f64) {
38        self.0.sigma = sigma;
39    }
40    pub fn set_xi(&mut self, xi: f64) {
41        self.0.xi = xi;
42    }
43    pub fn set_psi(&mut self, psi: f64) {
44        self.0.psi = psi;
45    }
46    pub fn set_chi(&mut self, chi: f64) {
47        self.0.chi = chi;
48    }
49
50    pub(crate) fn inner(&self) -> &bindings::GeometryInfo {
51        &self.0
52    }
53}
54
55impl Default for GeometryInfo {
56    fn default() -> Self {
57        Self::new()
58    }
59}