Map Algebraic Distance Transformation (Octagonal, Manhattan) C Implementation Code