Texture creation with callback

Allow the user to pass a callback function to the texture creation
function to provide values for each texel, as well as just passing a
list of values.