Terrain (height for each X, Y) data calculated from CastleScript expression. At construction, pass FunctionExpression, that is CastleScript language expression calculating height based on X, Y.
This descends from TTerrainImage, so you add an image to your function result.