diff options
author | Jelle Spijker <j.spijker@ultimaker.com> | 2020-04-21 17:58:45 +0300 |
---|---|---|
committer | Jelle Spijker <spijker.jelle@gmail.com> | 2020-04-21 17:58:45 +0300 |
commit | 6aedab78dc2e8c55fe6323ff3647203d8b994509 (patch) | |
tree | 536bc25c1adc134bf4ce675fb0336f73974f1dff /cura/PreviewPass.py | |
parent | fb4aec96a86c8a13109997c52528ba84ba103e25 (diff) |
Converted comments in dir Cura/cura to rst style
Converted doxygen style comments to reStructuredText style in the files found in Cura/cura directory using the script dox_2_rst.py (provided in the Uranium repo). Comments were manually checked and changed if needed.
Diffstat (limited to 'cura/PreviewPass.py')
-rw-r--r-- | cura/PreviewPass.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/cura/PreviewPass.py b/cura/PreviewPass.py index da60db2d99..c3d38cb6c6 100644 --- a/cura/PreviewPass.py +++ b/cura/PreviewPass.py @@ -1,7 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from typing import Optional, TYPE_CHECKING, cast +from typing import Optional, TYPE_CHECKING, cast, List from UM.Application import Application @@ -20,9 +20,14 @@ if TYPE_CHECKING: from UM.Scene.Camera import Camera -# Make color brighter by normalizing it (maximum factor 2.5 brighter) -# color_list is a list of 4 elements: [r, g, b, a], each element is a float 0..1 -def prettier_color(color_list): +def prettier_color(color_list: List[float]) -> List[float]: + """Make color brighter by normalizing + + maximum factor 2.5 brighter + + :param color_list: a list of 4 elements: [r, g, b, a], each element is a float 0..1 + :return: a normalized list of 4 elements: [r, g, b, a], each element is a float 0..1 + """ maximum = max(color_list[:3]) if maximum > 0: factor = min(1 / maximum, 2.5) @@ -31,11 +36,14 @@ def prettier_color(color_list): return [min(i * factor, 1.0) for i in color_list] -## A render pass subclass that renders slicable objects with default parameters. -# It uses the active camera by default, but it can be overridden to use a different camera. -# -# This is useful to get a preview image of a scene taken from a different location as the active camera. class PreviewPass(RenderPass): + """A :py:class:`Uranium.UM.View.RenderPass` subclass that renders slicable objects with default parameters. + + It uses the active camera by default, but it can be overridden to use a different camera. + + This is useful to get a preview image of a scene taken from a different location as the active camera. + """ + def __init__(self, width: int, height: int) -> None: super().__init__("preview", width, height, 0) |