X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2Futil.py;h=6e8ec7746bde7c41b5c4791dfca602d7dd65503b;hp=3b5e8cd56f3349d6ab1f094b8a25cde41015f558;hb=5be6340cbd5da619db56e1658da56840fcfd6293;hpb=dc2e08621ad586663e4c11475f03886a91463907 diff --git a/blender/io_mspgl/util.py b/blender/io_mspgl/util.py index 3b5e8cd5..6e8ec774 100644 --- a/blender/io_mspgl/util.py +++ b/blender/io_mspgl/util.py @@ -48,3 +48,16 @@ class Progress: if self.window_manager: self.window_manager.progress_update(value) self.last = value + + +def linear_to_srgb(l): + if l<0.0031308: + return 12.92*l + else: + return 1.055*(l**(1/2.4))-0.055 + +def get_colormap(srgb): + if srgb: + return linear_to_srgb + else: + return lambda x: x