Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@gamma.setter
def gamma(self, value):
self.status = format_float(value)
self._gamma = value
self._update_thumbnail()
self.events.gamma()
def contrast_limits(self, contrast_limits):
self._contrast_limits_msg = (
format_float(contrast_limits[0])
+ ', '
+ format_float(contrast_limits[1])
)
self.status = self._contrast_limits_msg
self._contrast_limits = contrast_limits
if contrast_limits[0] < self._contrast_limits_range[0]:
self._contrast_limits_range[0] = copy(contrast_limits[0])
if contrast_limits[1] > self._contrast_limits_range[1]:
self._contrast_limits_range[1] = copy(contrast_limits[1])
self._update_thumbnail()
self.events.contrast_limits()
def iso_threshold(self, value):
self.status = format_float(value)
self._iso_threshold = value
self._update_thumbnail()
self.events.iso_threshold()
def edge_width(self, edge_width: Union[None, float]) -> None:
self._edge_width = edge_width
self.status = format_float(self.edge_width)
self.events.edge_width()
self.events.highlight()
def edge_width(self, edge_width):
self._edge_width = edge_width
if self._update_properties:
index = self.selected_data
for i in index:
self._data_view.update_edge_width(i, edge_width)
self.status = format_float(self.edge_width)
self.events.edge_width()
def opacity(self, opacity):
if not 0.0 <= opacity <= 1.0:
raise ValueError(
'opacity must be between 0.0 and 1.0; ' f'got {opacity}'
)
self._opacity = opacity
self._update_thumbnail()
self.status = format_float(self.opacity)
self.events.opacity()
def brush_size(self, brush_size):
self._brush_size = int(brush_size)
self.cursor_size = self._brush_size / self.scale_factor
self.status = format_float(self.brush_size)
self.events.brush_size()
def opacity(self, opacity):
if not 0.0 <= opacity <= 1.0:
raise ValueError(
'opacity must be between 0.0 and 1.0; ' f'got {opacity}'
)
self._opacity = opacity
if self._update_properties:
index = self.selected_data
for i in index:
self._data_view.update_opacity(i, opacity)
self.status = format_float(self.opacity)
self.events.opacity()
def size(self, size: Union[None, float]) -> None:
self._size = size
if self._update_properties and len(self.selected_data) > 0:
for i in self.selected_data:
self.sizes[i, :] = (self.sizes[i, :] > 0) * size
self.refresh()
self.status = format_float(self.size)
self.events.size()
def gamma(self, value):
self.status = format_float(value)
self._gamma = value
self._update_thumbnail()
self.events.gamma()