#include <mod128.h>
Definition at line 36 of file mod128.h.
DIR128::DIR128 | ( | ) | [inline] |
DIR128::DIR128 | ( | INT16 | value | ) | [inline] |
DIR128::DIR128 | ( | const FCOORD | fc | ) |
Quantize the direction of an FCOORD to make a DIR128.
Definition at line 64 of file mod128.cpp.
References dir, dirtab, and MODULUS.
00066 { 00067 int high, low, current; //binary search 00068 00069 low = 0; 00070 if (fc.y () == 0) { 00071 if (fc.x () >= 0) 00072 dir = 0; 00073 else 00074 dir = MODULUS / 2; 00075 return; 00076 } 00077 high = MODULUS; 00078 do { 00079 current = (high + low) / 2; 00080 if (dirtab[current] * fc >= 0) 00081 low = current; 00082 else 00083 high = current; 00084 } 00085 while (high - low > 1); 00086 dir = low; 00087 }
INT8 DIR128::get_dir | ( | ) | const [inline] |
Definition at line 84 of file mod128.h.
Referenced by edgesteps_to_edgepts().
00084 { //access function 00085 return dir; 00086 }
ICOORD DIR128::vector | ( | ) | const |
INT8 DIR128::dir [private] |
Definition at line 90 of file mod128.h.
Referenced by DIR128(), operator+(), operator+=(), and vector().