
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:
| None __init__ | ( | self | ) |
| 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.
| bool enabled | ( | self | ) |
Gets whether this module is enabled.
When disabled, :func:process returns the input image unchanged.
Reimplemented from ModuleBase.
| 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.
| 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.
| value | If true, the image will be mirrored along the vertical axis. |
| 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.
| value | If true, the image will be mirrored along the horizontal axis. |
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. |
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
| Rotation rotation_angle | ( | self | ) |
Gets the current rotation angle.
| None rotation_angle | ( | self, | |
| Rotation | value ) |
Sets the desired rotation angle.
| value | The rotation angle to apply (see RotationAngle enum). |
| 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.
| str type | ( | self | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
| mirror_left_right = mirror_archive.get("LeftRight", bool) |
| mirror_up_down = mirror_archive.get("UpDown", bool) |
| rotation_angle = Rotation(rotation_archive.get("Angle", int)) |
| version |