Implemented rasterize and setRasterFunction.