IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
DebayerModule Class Reference

#include <peak_icv/pipeline/detail/peak_icv_debayer_module.hpp>

Inheritance diagram for DebayerModule:

Public Member Functions

 DebayerModule ()
 Creates an instance of class DebayerModule with default settings.
 
 ~DebayerModule () override
 
 DebayerModule (const DebayerModule &other)=delete
 Copy constructor for class DebayerModule is deleted.
 
 DebayerModule (DebayerModule &&other) noexcept
 
DebayerModule & operator= (const DebayerModule &other)=delete
 Copy assignment for class DebayerModule is deleted.
 
DebayerModule & operator= (DebayerModule &&other) noexcept
 
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the object's internal state into the provided archive.
 
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Restores the object's state from the provided archive.
 
void SetEnabled (bool enabled) override
 Sets the enabled state of this module.
 
bool IsEnabled () const override
 Checks if the module is currently enabled.
 
const char * GetType () const override
 Returns the type of the module for serialization purposes.
 
void ResetToDefault () override
 Resets the channel layout and the conversion policy to the default settings.
 
void SetChannelLayout (DebayerChannelLayout layout)
 Sets the desired channel layout for the output image.
 
DebayerChannelLayout GetChannelLayout () const
 Gets the current channel layout setting.
 
void SetConversionPolicy (DebayerConversionPolicy policy)
 Sets the conversion policy for the Debayer module.
 
DebayerConversionPolicy GetConversionPolicy () const
 Retrieves the current conversion policy.
 
void SetTargetBitDepth (size_t bitDepth)
 Set the target bit depth.
 
void SetProcessingPolicy (ProcessingPolicy policy)
 Set the processing policy.
 
peak::icv::Image Process (const peak::icv::Image &input) const
 Converts a Bayer or mono image to a color image, or passes through unmodified images.
 
peak::common::Any Process (const peak::common::Any &input) const override
 Converts a Bayer or mono image to a color image, or passes through unmodified images.
 
void ReleaseBuffers () const
 Frees unused internal buffers.
 

Detailed Description

Debayer is an image pipeline module that converts Bayer RAW images into standard color formats.

Debayer is an image pipeline module that performs demosaicing on Bayer-pattern RAW images, converting them into full-color images using configurable channel layouts such as RGB, BGR, RGBA, or BGRA. The bit depth of the output image is automatically inferred from the input.

The module can also be configured to convert Bayer or monochrome images, while passing through other image types unchanged.

Defaults
Since
ids_peak_icv 1.0

Definition at line 97 of file peak_icv_debayer_module.hpp.

Constructor & Destructor Documentation

◆ DebayerModule() [1/3]

DebayerModule ( )
inline

Creates an instance of class DebayerModule with default settings.

Since
ids_peak_icv 1.0

Definition at line 358 of file peak_icv_debayer_module.hpp.

◆ ~DebayerModule()

~DebayerModule ( )
inlineoverride
Since
ids_peak_icv 1.0

Definition at line 365 of file peak_icv_debayer_module.hpp.

◆ DebayerModule() [2/3]

DebayerModule ( const DebayerModule & other)
delete

Copy constructor for class DebayerModule is deleted.

Note
If you need to copy a module, you can create a new one and copy the parameters via Serialize() and Deserialize().
Since
ids_peak_icv 1.0

◆ DebayerModule() [3/3]

DebayerModule ( DebayerModule && other)
inlinenoexcept
Since
ids_peak_icv 1.0

Definition at line 373 of file peak_icv_debayer_module.hpp.

Member Function Documentation

◆ Deserialize()

void Deserialize ( const peak::common::serialization::IArchive & archive)
inlineoverridevirtual

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.

Parameters
archiveThe source archive containing the serialized parameters.
Exceptions
CorruptedExceptionIf Archive is malformed, misses keys or the values are invalid
NotSupportedExceptionIf the 'Version' entry indicates an unsupported version.
Note
This function requires that the archive contains all expected fields as produced by a corresponding Serialize() call.
Since
ids_peak_icv 1.0

Implements ISerializable.

Definition at line 404 of file peak_icv_debayer_module.hpp.

◆ GetChannelLayout()

DebayerChannelLayout GetChannelLayout ( ) const
inline

Gets the current channel layout setting.

Returns
The currently configured channel layout.
Since
ids_peak_icv 1.0

Definition at line 441 of file peak_icv_debayer_module.hpp.

◆ GetConversionPolicy()

DebayerConversionPolicy GetConversionPolicy ( ) const
inline

Retrieves the current conversion policy.

Returns
The currently active conversion policy.
Since
ids_peak_icv 1.0

Definition at line 452 of file peak_icv_debayer_module.hpp.

◆ GetType()

const char * GetType ( ) const
inlineoverridevirtual

Returns the type of the module for serialization purposes.

Returns
A string representing the module's type.
Since
ids_peak_icv 1.0

Implements IModule.

Definition at line 430 of file peak_icv_debayer_module.hpp.

◆ IsEnabled()

bool IsEnabled ( ) const
inlineoverridevirtual

Checks if the module is currently enabled.

Returns
True if the module is enabled, false otherwise.
Since
ids_peak_icv 1.0

Implements IModule.

Definition at line 425 of file peak_icv_debayer_module.hpp.

◆ operator=() [1/2]

DebayerModule & operator= ( const DebayerModule & other)
delete

Copy assignment for class DebayerModule is deleted.

Note
If you need to copy a module, you can create a new one and copy the parameters via Serialize() and Deserialize().
Since
ids_peak_icv 1.0

◆ operator=() [2/2]

DebayerModule & operator= ( DebayerModule && other)
inlinenoexcept
Since
ids_peak_icv 1.0

Definition at line 382 of file peak_icv_debayer_module.hpp.

◆ Process() [1/2]

peak::common::Any Process ( const peak::common::Any & input) const
inlineoverridevirtual

Converts a Bayer or mono image to a color image, or passes through unmodified images.

This function applies a demosaicing algorithm to the input image if required, depending on the configured conversion policy. If conversion is not applicable, the image is returned unchanged.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image (Bayer, mono, or already-color).
Returns
A processed color image or a pass-through copy of the input image.
Exceptions
peak::common::InvalidCastExceptionIf the input cast to peak::icv::Image failed.
Since
ids_peak_icv 1.0

Implements IModule.

Definition at line 569 of file peak_icv_debayer_module.hpp.

◆ Process() [2/2]

peak::icv::Image Process ( const peak::icv::Image & input) const
inline

Converts a Bayer or mono image to a color image, or passes through unmodified images.

This function applies a demosaicing algorithm to the input image if required, depending on the configured conversion policy. If conversion is not applicable, the image is returned unchanged.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image (Bayer, mono, or already-color).
Returns
A processed color image or a pass-through copy of the input image.
Since
ids_peak_icv 1.0

Definition at line 564 of file peak_icv_debayer_module.hpp.

◆ ReleaseBuffers()

void ReleaseBuffers ( ) const
inline

Frees unused internal buffers.

This module uses pre-allocated internal buffers to accelerate conversions. When the image size or pixel format changes, new buffers are allocated, which may cause the internal buffer pool to grow over time. This function can be used to release unused buffers and reduce memory usage.

Note
Avoid calling this function too frequently (e.g., after every resize or format change), as it introduces some overhead.
Since
ids_peak_icv 1.0

Definition at line 597 of file peak_icv_debayer_module.hpp.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets the channel layout and the conversion policy to the default settings.

Since
ids_peak_icv 1.0

Implements IModule.

Definition at line 414 of file peak_icv_debayer_module.hpp.

◆ Serialize()

void Serialize ( peak::common::serialization::IArchive & archive) const
inlineoverridevirtual

Serializes the object's internal state into the provided archive.

This function populates the given 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.

Parameters
archiveThe target archive that will store the serialized parameters.
Since
ids_peak_icv 1.0

Implements ISerializable.

Definition at line 395 of file peak_icv_debayer_module.hpp.

◆ SetChannelLayout()

void SetChannelLayout ( DebayerChannelLayout layout)
inline

Sets the desired channel layout for the output image.

This controls the order and number of color channels in the converted image. The bit depth is automatically inherited from the input Bayer image.

Parameters
layoutThe channel layout to use (e.g., RGB, BGRA).
Since
ids_peak_icv 1.0

Definition at line 435 of file peak_icv_debayer_module.hpp.

◆ SetConversionPolicy()

void SetConversionPolicy ( DebayerConversionPolicy policy)
inline

Sets the conversion policy for the Debayer module.

This policy determines which types of input images will be converted. All other image types are passed through unchanged.

Parameters
policyThe conversion policy to apply.
Since
ids_peak_icv 1.0

Definition at line 446 of file peak_icv_debayer_module.hpp.

◆ SetEnabled()

void SetEnabled ( bool enabled)
inlineoverridevirtual

Sets the enabled state of this module.

Parameters
enabledIf true, the module is enabled; otherwise, it is disabled.
Since
ids_peak_icv 1.0

Implements IModule.

Definition at line 420 of file peak_icv_debayer_module.hpp.

◆ SetProcessingPolicy()

void SetProcessingPolicy ( ProcessingPolicy policy)
inline

Set the processing policy.

Defines how the bit depth is handled during image processing — whether it is increased, decreased, or preserved.

  • Fast: When converting a Bayer or mono image to a color image, the resulting bit depth is the minimum of the input image and the target bit depth.
  • Balanced: When converting a Bayer or mono image to a color image, the original bit depth of the input image is preserved.
  • Enhanced: When converting a Bayer or mono image to a color image, the resulting bit depth is the maximum of the input image and the target bit depth.
Parameters
policyThe desired processing policy
Since
ids_peak_icv 1.0

Definition at line 559 of file peak_icv_debayer_module.hpp.

◆ SetTargetBitDepth()

void SetTargetBitDepth ( size_t bitDepth)
inline

Set the target bit depth.

Specifies the desired bit depth for image processing. Whether the actual bit depth is increased, decreased, or preserved depends on the selected processing policy and the bit depth of the input image.

Parameters
bitDepthThe target bit depth to use during processing.
Since
ids_peak_icv 1.0

Definition at line 264 of file peak_icv_debayer_module.hpp.