コード例 #1
0
    def _create_visuals_style_presets(self):
        """
        Creates the visuals style presets using :attr:`GamutView.settings`
        attribute value.
        """

        for visual, styles in self._settings['styles']['gamut_view'].items():
            self._visuals_style_presets[visual] = []

            for style in styles:
                if visual in ('input_colourspace_visual',
                              'correlate_colourspace_visual'):
                    self._visuals_style_presets[style['visual']].append(
                        RGB_ColourspaceVisualPreset(
                            name=style['name'],
                            description=style['description'],
                            segments=style['segments'],
                            uniform_colour=style['uniform_colour'],
                            uniform_opacity=style['uniform_opacity'],
                            wireframe=style['wireframe'],
                            wireframe_colour=style['wireframe_colour'],
                            wireframe_opacity=style['wireframe_opacity']))
                elif visual in 'grid_visual':
                    self._visuals_style_presets[style['visual']].append(
                        GridVisualPreset(
                            name=style['name'],
                            description=style['description'],
                            uniform_colour=style['uniform_colour']))

            self._visuals_style_presets[visual] = Cycle(
                self._visuals_style_presets[visual])
コード例 #2
0
    def __init__(self,
                 scene_canvas=None,
                 image=None,
                 input_colourspace='ITU-R BT.709',
                 correlate_colourspace='ACEScg',
                 diagram='CIE 1931',
                 **kwargs):
        self._initialised = False

        ViewBox.__init__(self, **kwargs)

        self.unfreeze()

        self._scene_canvas = scene_canvas

        self._image = None
        self.image = image
        self._input_colourspace = None
        self.input_colourspace = input_colourspace
        self._correlate_colourspace = None
        self.correlate_colourspace = correlate_colourspace
        self._diagram = None
        self.diagram = diagram

        self._diagrams_cycle = Cycle(CHROMATICITY_DIAGRAMS)

        self._grid = None

        self._label = None

        self._chromaticity_diagram_visual = None
        self._spectral_locus_visual = None
        self._RGB_scatter_visual = None
        self._input_colourspace_visual = None
        self._correlate_colourspace_visual = None
        self._pointer_gamut_visual = None
        self._pointer_gamut_boundaries_visual = None
        self._grid_visual = None
        self._axis_visual = None

        self._visuals = ('chromaticity_diagram_visual',
                          'spectral_locus_visual',
                          'RGB_scatter_visual',
                          'input_colourspace_visual',
                          'correlate_colourspace_visual',
                          'pointer_gamut_visual',
                          'pointer_gamut_boundaries_visual',
                          'grid_visual',
                          'axis_visual')

        self._visuals_visibility = None

        self._create_visuals()
        self._attach_visuals()
        self._create_camera()

        self._create_label()

        self._initialised = True