def test_wfviewcolorbar(tname): print('%s:' % sys._getframe().f_code.co_name) import numpy as np arr = np.random.random((1000, 100)) #arr = image_with_random_peaks((1000, 1000)) ctab = ct.color_table_rainbow(ncolors=1000, hang1=250, hang2=-20) #ctab = ct.color_table_monochr256() #ctab = ct.color_table_interpolated() app = QApplication(sys.argv) w = None if tname == '0': w = FWViewColorBar(None, coltab=ctab, orient='H', change_mode=1, scale_ctl='H') elif tname == '1': w = FWViewColorBar(None, coltab=ctab, orient='V') else: print('test %s is not implemented' % tname) return w.setWindowTitle(w._name) w.connect_mouse_move_event_to(w.test_mouse_move_event_reception) w.connect_new_color_table_index_is_selected_to( w.test_new_color_table_index_is_selected_reception) w.connect_new_color_table_to(w.test_new_color_table_reception) w.show() app.exec_() del w del app
def __init__(self, parent=None, arr=None,\ coltab=ct.color_table_rainbow(ncolors=1000, hang1=250, hang2=-20),\ origin='UL', scale_ctl='HV') : FWViewImage.__init__(self, parent, arr, coltab, origin, scale_ctl) self.add_request = None self.lst_drag_items = [] self.scale_ctl_normal = scale_ctl
def __init__(self, parent=None, arr=None,\ coltab=ct.color_table_rainbow(ncolors=1000, hang1=250, hang2=-20),\ origin='UL', scale_ctl='HV') : h, w = arr.shape rscene = QRectF(0, 0, w, h) FWView.__init__(self, parent, rscene, origin, scale_ctl) self._name = self.__class__.__name__ self.set_coltab(coltab) self.pmi = None self.set_pixmap_from_arr(arr)
def __init__(self, parent=None, arr=None,\ coltab=ct.color_table_rainbow(ncolors=1000, hang1=250, hang2=-20),\ origin='UL', scale_ctl='HV', show_mode=0, signal_fast=True): h, w = arr.shape rscene = QRectF(0, 0, w, h) FWView.__init__(self, parent, rscene, origin, scale_ctl, show_mode, signal_fast) self._name = self.__class__.__name__ self.set_coltab(coltab) self.pmi = None self.arr_limits_old = None self.arr_in_rect = None self.set_pixmap_from_arr(arr)
def __init__(self, parent=None,\ coltab=ct.color_table_rainbow(ncolors=1000, hang1=250, hang2=-20),\ orient='H', wlength=200, wwidth=50, change_mode=0o3, scale_ctl=''): self.orient = orient #print('XXX FWViewColorBar.orient: %s' % self.orient) arrct = ct.array_for_color_bar(coltab, orient) self._ctab_ind = None self._ctab = coltab self.wlength = wlength self.wwidth = wwidth self.change_mode = change_mode FWViewImage.__init__(self, parent, arrct, coltab=None, origin='UL', scale_ctl=scale_ctl) self._name = self.__class__.__name__
def set_coltab(self, coltab=ct.color_table_rainbow(ncolors=1000, hang1=250, hang2=-20)): self.coltab = coltab