X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Futil.py;fp=blender%2Fio_mspgl%2Futil.py;h=70b005f6df60e84db38ea8c35c03fc0bbcc79123;hb=bde3ec824d300e9aff11914406fb76dd9016e387;hp=7e932df382791007e3151beff6d4cc41bf5301ad;hpb=a42739b48ffbd0247a3b3bb6fc67160494959b5b;p=libs%2Fgl.git diff --git a/blender/io_mspgl/util.py b/blender/io_mspgl/util.py index 7e932df3..70b005f6 100644 --- a/blender/io_mspgl/util.py +++ b/blender/io_mspgl/util.py @@ -52,6 +52,18 @@ class Progress: 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 + def image_name(img): fp = img.filepath if fp: