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)
| None __init__ | ( | self, | |
| Union[Image, ids_peak_ipl.Image] | image ) |
Creates a Painter object.
| image | The image all painting operations are performed on. |
| Color color | ( | self | ) |
| 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. |
| 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. |
| Opacity opacity | ( | self | ) |
| None opacity | ( | self, | |
| Opacity | opacity ) |
|
protected |
|
protected |