Depth Map Generator in C