2011-05-31 05:51:53 +00:00
|
|
|
package raster
|
|
|
|
|
|
|
|
type Fix int32
|
|
|
|
|
|
|
|
const (
|
2011-06-01 07:38:45 +00:00
|
|
|
FIXED_SHIFT = 16
|
2011-05-31 05:51:53 +00:00
|
|
|
FIXED_FLOAT_COEF = 1 << FIXED_SHIFT
|
|
|
|
)
|
|
|
|
|
|
|
|
/*! Fixed point math inevitably introduces rounding error to the DDA. The error is
|
|
|
|
* fixed every now and then by a separate fix value. The defines below set these.
|
|
|
|
*/
|
|
|
|
const (
|
|
|
|
SLOPE_FIX_SHIFT = 8
|
2011-06-01 07:38:45 +00:00
|
|
|
SLOPE_FIX_STEP = 1 << SLOPE_FIX_SHIFT
|
|
|
|
SLOPE_FIX_MASK = SLOPE_FIX_STEP - 1
|
|
|
|
)
|