![]() |
IDS peak ICV v1.2.0
|
Public Member Functions | |
| None | __init__ (self, Union[Image, ids_peak_ipl.Image] image) |
| Creates a Painter object. | |
| Color | color (self) |
| Get the current color for painting. | |
| None | color (self, Union[Color, ColorConstant, ColorPalette, ColorPaletteConstant] color) |
| Set the color for painting an object into the image. | |
| Opacity | opacity (self) |
| Get the current opacity for painting. | |
| None | opacity (self, Opacity opacity) |
| Set the Opacity for painting. | |
| None | draw (self, IDrawable drawable) |
Draws the drawable onto the image, the painter was initialized with. | |
Protected Attributes | |
| _image = _check_and_get_icv_image(image) | |
| _drawing_options = DrawingOptions() | |
Class for painting simple things (e.g.
a region) on images.
With the Painter, objects derived from IDrawable can be drawn in order to visualize them. It is possible to configure the drawing style, including color and opacity settings, for customized results.
The Painter is initialized with the image onto which the object is to be painted. It must be of type RGB8, BGR8, RGBa8 or BGRa8. Optionally, you can configure the painter by setting the color and opacity; if omitted, default values from DrawingOptions are used. Once configured, the object to be rendered can be passed to the draw method, which paints it onto the image. :: painter = Painter(image) painter.color = ColorConstant.BLUE painter.opacity = Opacity(50) painter.draw(region)
Definition at line 12 of file painter.py.
| None __init__ | ( | self, | |
| Union[Image, ids_peak_ipl.Image] | image ) |
Creates a Painter object.
| image | The image all painting operations are performed on. |
Definition at line 35 of file painter.py.
| Color color | ( | self | ) |
Get the current color for painting.
Definition at line 48 of file painter.py.
| None color | ( | self, | |
| Union[Color, ColorConstant, ColorPalette, ColorPaletteConstant] | color ) |
Set the color for painting an object into the image.
If the draw method is called several times, there are two options:
For the first option a Color or a ColorConstant must be passed, for the second a ColorPalette or a ColorPaletteConstant.
| color | The color to set. |
| NotSupportedException | If color is not a Color or ColorConstant. |
Definition at line 60 of file painter.py.
| None draw | ( | self, | |
| IDrawable | drawable ) |
Draws the drawable onto the image, the painter was initialized with.
For more info, please see the documentation of the specific object that shall be drawn.
The following objects can be drawn:
| drawable | The object to be drawn. |
Definition at line 112 of file painter.py.
| Opacity opacity | ( | self | ) |
Get the current opacity for painting.
Definition at line 89 of file painter.py.
| None opacity | ( | self, | |
| Opacity | opacity ) |
Set the Opacity for painting.
| opacity | The opacity to set. |
Definition at line 101 of file painter.py.
|
protected |
Definition at line 45 of file painter.py.
|
protected |
Definition at line 44 of file painter.py.