當前位置: 首頁>>代碼示例>>Python>>正文


Python ColorManager.undistort_hue方法代碼示例

本文整理匯總了Python中adjbases.ColorManager.undistort_hue方法的典型用法代碼示例。如果您正苦於以下問題:Python ColorManager.undistort_hue方法的具體用法?Python ColorManager.undistort_hue怎麽用?Python ColorManager.undistort_hue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在adjbases.ColorManager的用法示例。


在下文中一共展示了ColorManager.undistort_hue方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from adjbases import ColorManager [as 別名]
# 或者: from adjbases.ColorManager import undistort_hue [as 別名]
 def __init__(self, parent, target):
     gtk.Dialog.__init__(
         self,
         C_(
             u"HCY Gamut Mask new-from-template dialog: window title",
             "New Gamut Mask from Template",
         ),
         parent,
         gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
         (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT),
     )
     self.set_position(gtk.WIN_POS_MOUSE)
     target_mgr = target.get_color_manager()
     prefs_ro = deepcopy(target_mgr.get_prefs())
     datapath = target_mgr.get_data_path()
     mgr = ColorManager(prefs=prefs_ro, datapath=datapath)
     mgr.set_wheel_type(target_mgr.get_wheel_type())
     self.target = target
     for name, desc, mask_shapes_float in self.__templates:
         mask = []
         for mask_shape_float in mask_shapes_float:
             shape = []
             for h, c, y in mask_shape_float:
                 h = mgr.undistort_hue(h)
                 shape.append(HCYColor(h, c, y))
             mask.append(shape)
         label = gtk.Label()
         label.set_markup("<b>%s</b>\n\n%s" % (name, desc))
         label.set_size_request(375, -1)
         label.set_line_wrap(True)
         label.set_alignment(0, 0.5)
         preview = HCYMaskPreview()
         preview.set_color_manager(mgr)
         preview.set_mask(mask)
         preview_frame = gtk.AspectFrame(obey_child=True)
         preview_frame.add(preview)
         preview_frame.set_shadow_type(gtk.SHADOW_NONE)
         hbox = gtk.HBox()
         hbox.set_spacing(6)
         hbox.pack_start(preview_frame, False, False)
         hbox.pack_start(label, True, True)
         button = gtk.Button()
         button.add(hbox)
         button.set_relief(gtk.RELIEF_NONE)
         button.connect("clicked", self.__button_clicked_cb, mask)
         self.vbox.pack_start(button, True, True)
     self.connect("response", self.__response_cb)
     self.connect("show", self.__show_cb)
     for w in self.vbox:
         w.show_all()
     ref_color = target.get_managed_color()
     mgr.set_color(ref_color)
開發者ID:MeanGreanHare,項目名稱:mypaint,代碼行數:54,代碼來源:hcywheel.py

示例2: __init__

# 需要導入模塊: from adjbases import ColorManager [as 別名]
# 或者: from adjbases.ColorManager import undistort_hue [as 別名]
 def __init__(self, parent, target):
     super(HCYMaskTemplateDialog, self).__init__(
         title=C_(
             u"HCY Gamut Mask new-from-template dialog: window title",
             "New Gamut Mask from Template",
         ),
         transient_for=parent,
         modal=True,
         destroy_with_parent=True,
         window_position=Gtk.WindowPosition.MOUSE,
         buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT),
     )
     target_mgr = target.get_color_manager()
     prefs_ro = deepcopy(target_mgr.get_prefs())
     datapath = target_mgr.get_data_path()
     mgr = ColorManager(prefs=prefs_ro, datapath=datapath)
     mgr.set_wheel_type(target_mgr.get_wheel_type())
     self.target = target
     for name, desc, mask_shapes_float in self.__templates:
         mask = []
         for mask_shape_float in mask_shapes_float:
             shape = []
             for h, c, y in mask_shape_float:
                 h = mgr.undistort_hue(h)
                 shape.append(HCYColor(h, c, y))
             mask.append(shape)
         label = Gtk.Label()
         label.set_markup("<b>%s</b>\n\n%s" % (name, desc))
         label.set_size_request(375, -1)
         label.set_line_wrap(True)
         label.set_alignment(0, 0.5)
         preview = HCYMaskPreview()
         preview.set_color_manager(mgr)
         preview.set_mask(mask)
         preview_frame = Gtk.AspectFrame(obey_child=True)
         preview_frame.add(preview)
         preview_frame.set_shadow_type(Gtk.ShadowType.NONE)
         hbox = Gtk.HBox()
         hbox.set_spacing(6)
         hbox.pack_start(preview_frame, False, False, 0)
         hbox.pack_start(label, True, True, 0)
         button = Gtk.Button()
         button.add(hbox)
         button.set_relief(Gtk.ReliefStyle.NONE)
         button.connect("clicked", self.__button_clicked_cb, mask)
         self.vbox.pack_start(button, True, True, 0)
     self.connect("response", self.__response_cb)
     self.connect("show", self.__show_cb)
     for w in self.vbox:
         w.show_all()
     ref_color = target.get_managed_color()
     mgr.set_color(ref_color)
開發者ID:benpope82,項目名稱:mypaint,代碼行數:54,代碼來源:hcywheel.py


注:本文中的adjbases.ColorManager.undistort_hue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。