Originally colorspace of float images was converted using CPU. GLSL will render images much faster.
Originally image was converted to global_role_default_byte space, disregarding view transform and also display device, which now is possible to specify. These parameters could be set via commandline to settings used in Blender, however if they are to be set by users, these needs to be sanitized.
Right now defaults are assumed for device given for COLOR_ROLE_DEFAULT_BYTE. This should produce same behavior as implemented before.
Together with D11167 animation player performance should be much better.
This code was mostly copy-pasted from sequencer.