diff options
Diffstat (limited to 'silx/gui/plot/items/complex.py')
-rw-r--r-- | silx/gui/plot/items/complex.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/silx/gui/plot/items/complex.py b/silx/gui/plot/items/complex.py index 988022a..8f0694d 100644 --- a/silx/gui/plot/items/complex.py +++ b/silx/gui/plot/items/complex.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2017-2019 European Synchrotron Radiation Facility +# Copyright (c) 2017-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -165,6 +165,11 @@ class ImageComplexData(ImageBase, ColormapMixIn, ComplexMixIn): data = self.getRgbaImageData(copy=False) else: colormap = self.getColormap() + if colormap.isAutoscale(): + # Avoid backend to compute autoscale: use item cache + colormap = colormap.copy() + colormap.setVRange(*colormap.getColormapRange(self)) + data = self.getData(copy=False) if data.size == 0: @@ -173,7 +178,6 @@ class ImageComplexData(ImageBase, ColormapMixIn, ComplexMixIn): return backend.addImage(data, origin=self.getOrigin(), scale=self.getScale(), - z=self.getZValue(), colormap=colormap, alpha=self.getAlpha()) @@ -191,6 +195,8 @@ class ImageComplexData(ImageBase, ColormapMixIn, ComplexMixIn): colormap = self._colormaps[self.getComplexMode()] if colormap is not super(ImageComplexData, self).getColormap(): super(ImageComplexData, self).setColormap(colormap) + + self._setColormappedData(self.getData(copy=False), copy=False) return changed def _setAmplitudeRangeInfo(self, max_=None, delta=2): @@ -260,6 +266,7 @@ class ImageComplexData(ImageBase, ColormapMixIn, ComplexMixIn): self._data = data self._dataByModesCache = {} + self._setColormappedData(self.getData(copy=False), copy=False) # TODO hackish data range implementation if self.isVisible(): |