aboutsummaryrefslogtreecommitdiffstats
path: root/style/fixed.go
blob: fe3f91e08f5ee26828555c4deca287033876c651 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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))
}