diff src/th06/anm0.rs @ 643:01849ffd0180

Add an anmrenderer binary.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 02 Aug 2019 20:24:45 +0200
parents a8e0219162b6
children 7bde50132735
line wrap: on
line diff
--- a/src/th06/anm0.rs
+++ b/src/th06/anm0.rs
@@ -76,6 +76,12 @@ impl Anm0 {
         assert_eq!(anm0.len(), 1);
         Ok(anm0[0].clone())
     }
+
+    /// TODO
+    pub fn inv_size(&self) -> (f32, f32) {
+        let (x, y) = self.size;
+        (1. / x as f32, 1. / y as f32)
+    }
 }
 
 fn parse_name(i: &[u8], is_present: bool) -> IResult<&[u8], String> {