
Public Member Functions | |
| None | __init__ (self, DownsamplingMode default_mode, str custom_type) |
| Creates a DownsamplingModule with default values. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the pipeline for serialization purposes. | |
| Image | process (self, Image input_image) |
| Applies the downsampling factors and mode to the input image and returns a downsampled copy based on current settings. | |
| None | reset_to_default (self) |
| Resets all settings to their default values defined at initialization, i.e. | |
| int | x (self) |
| Returns the current number of columns used for downsampling. | |
| None | x (self, int value) |
| Sets the number of columns to downsample. | |
| int | y (self) |
| Returns the current number of rows used for downsampling. | |
| None | y (self, int value) |
| Sets the number of rows to downsample. | |
| DownsamplingMode | mode (self) |
| Returns the current DownsamplingMode. | |
| None | mode (self, DownsamplingMode value) |
| Sets the DownsamplingMode. | |
| None | serialize (self, IArchive archive) |
| Serializes the object's internal state into the provided archive. | |
| None | deserialize (self, IArchive archive) |
| Restores the object's state from the provided archive. | |
| Interval | range (self) |
| Returns the valid range for downsampling factors x and y. | |
Data Fields | |
| int | x = 1): |
| int | y = self.DEFAULT_Y |
| mode = self._default_mode | |
Static Public Attributes | |
| int | DEFAULT_X = 1 |
| int | DEFAULT_Y = 1 |
Protected Attributes | |
| int | _x = self.DEFAULT_X |
| int | _y = self.DEFAULT_Y |
| _mode = default_mode | |
| _default_mode = default_mode | |
| _type = custom_type | |
| _handle = peak_icv_downsampling_handle(None) | |
Downsampling is used to decrease the image size.
This module provides comprehensive functionality for image downsampling, which is the process of reducing image resolution and dimensions. It supports multiple algorithms optimized for various use cases.
There are two basic techniques for downsampling:
The reduction factors are specified separately for the x (columns) and y (rows) directions.
Definition at line 54 of file downsampling_module.py.
| None __init__ | ( | self, | |
| DownsamplingMode | default_mode, | ||
| str | custom_type ) |
Creates a DownsamplingModule with default values.
| default_mode | Override default mode, used when resetting the module to default |
| custom_type | Override custom mode, used when serialized to disk |
Reimplemented from ModuleBase.
Definition at line 84 of file downsampling_module.py.
| None __del__ | ( | self | ) |
Definition at line 109 of file downsampling_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 the archive is malformed, misses keys or the values are invalid |
| NotSupportedException | If the 'Version' entry indicates an unsupported version. |
Reimplemented from ModuleBase.
Definition at line 275 of file downsampling_module.py.
| DownsamplingMode mode | ( | self | ) |
Returns the current DownsamplingMode.
Definition at line 230 of file downsampling_module.py.
| None mode | ( | self, | |
| DownsamplingMode | value ) |
Sets the DownsamplingMode.
| value | The DownsamplingMode to set. |
Definition at line 242 of file downsampling_module.py.
| Image process | ( | self, | |
| Image | input_image ) |
Applies the downsampling factors and mode to the input image and returns a downsampled copy based on current settings.
|
|
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| input_image | The input image to be processed. |
| NotSupportedException | If input has any other than the supported pixel formats. |
Definition at line 126 of file downsampling_module.py.
| Interval range | ( | self | ) |
Returns the valid range for downsampling factors x and y.
Definition at line 307 of file downsampling_module.py.
| None reset_to_default | ( | self | ) |
Resets all settings to their default values defined at initialization, i.e.
x = 1, y = 1, and the initial downsampling mode.
Definition at line 161 of file downsampling_module.py.
| None serialize | ( | self, | |
| IArchive | archive ) |
Serializes the object's internal state into the provided archive.
This function populates the object into 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 256 of file downsampling_module.py.
| str type | ( | self | ) |
Returns the type of the pipeline for serialization purposes.
Definition at line 115 of file downsampling_module.py.
| int x | ( | self | ) |
Returns the current number of columns used for downsampling.
Definition at line 176 of file downsampling_module.py.
| None x | ( | self, | |
| int | value ) |
Sets the number of columns to downsample.
| value | The number of columns to downsample. |
Definition at line 188 of file downsampling_module.py.
| int y | ( | self | ) |
Returns the current number of rows used for downsampling.
Definition at line 203 of file downsampling_module.py.
| None y | ( | self, | |
| int | value ) |
Sets the number of rows to downsample.
| value | The number of rows to downsample. |
Definition at line 215 of file downsampling_module.py.
|
protected |
Definition at line 98 of file downsampling_module.py.
|
protected |
Definition at line 101 of file downsampling_module.py.
|
protected |
Definition at line 97 of file downsampling_module.py.
|
protected |
Definition at line 99 of file downsampling_module.py.
|
protected |
Definition at line 95 of file downsampling_module.py.
|
protected |
Definition at line 96 of file downsampling_module.py.
|
static |
Definition at line 81 of file downsampling_module.py.
|
static |
Definition at line 82 of file downsampling_module.py.
| mode = self._default_mode |
Definition at line 173 of file downsampling_module.py.
| x = 1): |
Definition at line 148 of file downsampling_module.py.
| y = self.DEFAULT_Y |
Definition at line 172 of file downsampling_module.py.