aboutsummaryrefslogtreecommitdiffstats
path: root/style/fixed.go
diff options
context:
space:
mode:
Diffstat (limited to 'style/fixed.go')
-rw-r--r--style/fixed.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/style/fixed.go b/style/fixed.go
new file mode 100644
index 0000000..fe3f91e
--- /dev/null
+++ b/style/fixed.go
@@ -0,0 +1,11 @@
+package style
+
+import "golang.org/x/image/math/fixed"
+
+func fixed26ToFloat(n fixed.Int26_6) float64 {
+ return float64(n) / (1 << 6)
+}
+
+func floatToFixed26(f float64) fixed.Int26_6 {
+ return fixed.Int26_6(f * (1 << 6))
+}