A class library for mathematical imaging