
Public Member Functions | |
| None | __init__ (self) |
| Creates a transformation module. | |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| Image | process (self, Image input) |
| Processes the input image and returns a mirrored and/or rotated copy based on current settings. | |
| None | reset_to_default (self) |
| Resets all settings to their defaults. | |
| bool | mirror_left_right (self) |
| Gets the current left-right mirroring setting. | |
| None | mirror_left_right (self, bool value) |
| Sets whether the image should be mirrored left-right. | |
| bool | mirror_up_down (self) |
| Gets the current up-down mirroring setting. | |
| None | mirror_up_down (self, bool value) |
| Sets whether the image should be mirrored up-down. | |
| Rotation | rotation_angle (self) |
| Gets the current rotation angle. | |
| None | rotation_angle (self, Rotation value) |
| Sets the desired rotation angle. | |
| bool | enabled (self) |
| Gets whether this module is enabled. | |
| None | enabled (self, bool enabled) |
| Enables or disables the module. | |
| None | serialize (self, IArchive archive) |
| Serializes the object's internal state into an archive. | |
| None | deserialize (self, IArchive archive) |
| Restores the object's state from the provided archive. | |
Data Fields | |
| version | |
| mirror_up_down = mirror_archive.get("UpDown", bool) | |
| mirror_left_right = mirror_archive.get("LeftRight", bool) | |
| rotation_angle = Rotation(rotation_archive.get("Angle", int)) | |
Static Public Attributes | |
| bool | DEFAULT_MIRROR_LEFT_RIGHT = False |
| bool | DEFAULT_MIRROR_UP_DOWN = False |
| Rotation | DEFAULT_ROTATION_ANGLE = Rotation.NO_ROTATION |
Protected Attributes | |
| bool | _mirror_left_right = self.DEFAULT_MIRROR_LEFT_RIGHT |
| bool | _mirror_up_down = self.DEFAULT_MIRROR_UP_DOWN |
| Rotation | _rotation_angle = self.DEFAULT_ROTATION_ANGLE |
| bool | _rotation_enabled = True |
| bool | _mirror_enabled = True |
Transformation is an image pipeline module that provides mirror and rotation functionality.
Default configuration:
Definition at line 14 of file transformation_module.py.
| None __init__ | ( | self | ) |
Creates a transformation module.
Reimplemented from ModuleBase.
Definition at line 31 of file transformation_module.py.
| None deserialize | ( | self, | |
| IArchive | archive ) |
Restores the object's state from the provided archive.
This function reads and applies all necessary parameters from the given archive to reconstruct the internal state of the object. It ensures that the object is restored to a valid and consistent state.
| archive | The source archive containing the serialized parameters. |
| CorruptedException | If Archive is malformed, misses keys or the values are invalid |
| NotSupportedException | If the 'Version' entry indicates an unsupported version or if the rotation angle is not transformable into RotationAngle. |
Reimplemented from ModuleBase.
Definition at line 253 of file transformation_module.py.
| bool enabled | ( | self | ) |
Gets whether this module is enabled.
When disabled, :func:process returns the input image unchanged.
Reimplemented from ModuleBase.
Definition at line 199 of file transformation_module.py.
| None enabled | ( | self, | |
| bool | enabled ) |
Enables or disables the module.
When disabled, :func:process returns the input image unchanged.
| enabled | True to enable, False to disable. |
Reimplemented from ModuleBase.
Definition at line 213 of file transformation_module.py.
| bool mirror_left_right | ( | self | ) |
Gets the current left-right mirroring setting.
Definition at line 127 of file transformation_module.py.
| None mirror_left_right | ( | self, | |
| bool | value ) |
Sets whether the image should be mirrored left-right.
| value | If true, the image will be mirrored along the vertical axis. |
Definition at line 139 of file transformation_module.py.
| bool mirror_up_down | ( | self | ) |
Gets the current up-down mirroring setting.
Definition at line 151 of file transformation_module.py.
| None mirror_up_down | ( | self, | |
| bool | value ) |
Sets whether the image should be mirrored up-down.
| value | If true, the image will be mirrored along the horizontal axis. |
Definition at line 163 of file transformation_module.py.
Processes the input image and returns a mirrored and/or rotated copy based on current settings.
|
|
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| input | The input image to be processed. |
| NotSupportedException | If the image has any other than the supported pixel formats. |
Definition at line 57 of file transformation_module.py.
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
Definition at line 108 of file transformation_module.py.
| Rotation rotation_angle | ( | self | ) |
Gets the current rotation angle.
Definition at line 175 of file transformation_module.py.
| None rotation_angle | ( | self, | |
| Rotation | value ) |
Sets the desired rotation angle.
| value | The rotation angle to apply (see RotationAngle enum). |
Definition at line 187 of file transformation_module.py.
| None serialize | ( | self, | |
| IArchive | archive ) |
Serializes the object's internal state into an archive.
This function populates an archive with all parameters required to fully represent the current state of the object. It ensures that the object can be reconstructed or transmitted accurately by saving all relevant data members in a consistent and structured format.
| archive | The target archive that will store the serialized parameters. |
Reimplemented from ModuleBase.
Definition at line 227 of file transformation_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Definition at line 46 of file transformation_module.py.
|
protected |
Definition at line 43 of file transformation_module.py.
|
protected |
Definition at line 39 of file transformation_module.py.
|
protected |
Definition at line 40 of file transformation_module.py.
|
protected |
Definition at line 41 of file transformation_module.py.
|
protected |
Definition at line 42 of file transformation_module.py.
|
static |
Definition at line 27 of file transformation_module.py.
|
static |
Definition at line 28 of file transformation_module.py.
|
static |
Definition at line 29 of file transformation_module.py.
| mirror_left_right = mirror_archive.get("LeftRight", bool) |
Definition at line 281 of file transformation_module.py.
| mirror_up_down = mirror_archive.get("UpDown", bool) |
Definition at line 280 of file transformation_module.py.
| rotation_angle = Rotation(rotation_archive.get("Angle", int)) |
Definition at line 284 of file transformation_module.py.
| version |
Definition at line 240 of file transformation_module.py.