diff options
author | Akshay <[email protected]> | 2021-04-04 11:09:17 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-04-04 14:07:09 +0100 |
commit | c4354e2d8d51cc9fc12dce9ad2d5736e400a8de4 (patch) | |
tree | a651a7d2406886869be693baa7afbd7807fdfa0f /src/guide.rs | |
parent | 62d9de6a368a50dcb62b2b97a5fb02a3858b0977 (diff) |
basic support for adding guides
Diffstat (limited to 'src/guide.rs')
-rw-r--r-- | src/guide.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/guide.rs b/src/guide.rs index 006566e..85d0594 100644 --- a/src/guide.rs +++ b/src/guide.rs | |||
@@ -1,7 +1,21 @@ | |||
1 | use crate::bitmap::Axis; | 1 | use crate::{ |
2 | bitmap::Axis, | ||
3 | lisp::{expr::LispExpr, number::LispNumber}, | ||
4 | }; | ||
2 | 5 | ||
3 | #[derive(Debug)] | 6 | use std::convert::Into; |
7 | |||
8 | #[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)] | ||
4 | pub struct Guide { | 9 | pub struct Guide { |
5 | axis: Axis, | 10 | pub axis: Axis, |
6 | offset: u32, | 11 | pub offset: u32, |
12 | } | ||
13 | |||
14 | impl Into<LispExpr> for Guide { | ||
15 | fn into(self) -> LispExpr { | ||
16 | LispExpr::List(vec![ | ||
17 | self.axis.into(), | ||
18 | LispExpr::Number(LispNumber::Integer(self.offset as i64)), | ||
19 | ]) | ||
20 | } | ||
7 | } | 21 | } |