
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.
| 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.
| None __del__ | ( | 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 the archive is malformed, misses keys or the values are invalid |
| NotSupportedException | If the 'Version' entry indicates an unsupported version. |
Reimplemented from ModuleBase.
| DownsamplingMode mode | ( | self | ) |
| None mode | ( | self, | |
| DownsamplingMode | value ) |
| 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. |
| Interval range | ( | self | ) |
Returns the valid range for downsampling factors x and y.
| 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.
| 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.
| str type | ( | self | ) |
Returns the type of the pipeline for serialization purposes.
| int x | ( | self | ) |
Returns the current number of columns used for downsampling.
| None x | ( | self, | |
| int | value ) |
Sets the number of columns to downsample.
| value | 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.
| value | The number of rows to downsample. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
| mode = self._default_mode |
| x = 1): |
| y = self.DEFAULT_Y |