+import os
+
class Progress:
def __init__(self, context):
self.task = ""
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
+
+def image_name(img):
+ fp = img.filepath
+ if fp:
+ return os.path.split(fp)[1]
+ else:
+ return img.name