IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
DebayerModule Class Reference
Inheritance diagram for DebayerModule:

Public Member Functions

 DebayerModule ()
 Creates an instance of class DebayerModule.
 
void Dispose ()
 Releases all resources used by this class.
 
override object Process (object input)
 Converts a Bayer or mono image to a color image, or returns the input image unchanged.
 
override Image Process (Image inputImage)
 Converts a Bayer or mono image to a color image, or returns the input image unchanged.
 
override void Serialize (IArchive archive)
 Serializes the object's internal state into the provided archive.
 
override void Deserialize (IArchive archive)
 Restores the object's state from the provided archive.
 
override void ResetToDefault ()
 Resets all module settings to its default settings.
 
void ReleaseBuffers ()
 Frees unused internal buffers.
 

Static Public Attributes

const DebayerChannelLayout DefaultChannelLayout = DebayerChannelLayout.RGB
 The default channel layout.
 
const DebayerConversionPolicy DefaultConversionPolicy = DebayerConversionPolicy.BayerOnly
 The default conversion policy.
 
const uint DefaultTargetBitDepth = 8
 The default target bit depth.
 
const ProcessingPolicy DefaultPolicy = ProcessingPolicy.Fast
 The default processing policy.
 

Properties

override string TypeId [get]
 The unique type identifier for this module implementation.This should be a unique string identifying the specific implementation of the module.
 
DebayerChannelLayout ChannelLayout = DefaultChannelLayout [get, set]
 The output channel layout used for debayered images.
 
DebayerConversionPolicy ConversionPolicy = DefaultConversionPolicy [get, set]
 The debayer conversion policy.
 
uint TargetBitDepth = DefaultTargetBitDepth [get, set]
 The target bit depth for processed images.
 
ProcessingPolicy ProcessingPolicy = DefaultPolicy [get, set]
 The processing policy defines how the target bit depth interacts with the input image bit depth.
 
int Version = 1 [get]
 The module version.
 
virtual bool IsEnabled = true [get, set]
 Get whether this module is enabled.
 

Detailed Description

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

It 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 is inferred from the input, depending on the selected processing policy.

Defaults
  • DebayerChannelLayout.RGB
  • DebayerConversionPolicy.BayerOnly
  • Target bit depth = 8
  • ProcessingPolicy.Fast
Since
IDSImaging.Peak.ICV 1.3

Definition at line 29 of file DebayerModule.cs.

Constructor & Destructor Documentation

◆ DebayerModule()

DebayerModule ( )
inline

Creates an instance of class DebayerModule.

Definition at line 58 of file DebayerModule.cs.

Member Function Documentation

◆ Deserialize()

override void Deserialize ( IArchive archive)
inlinevirtual

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.

Note
This function requires that the archive contains all expected fields as produced by a corresponding Serialize call.
Parameters
archiveThe source archive containing the serialized parameters.
Exceptions
IcvCorruptedExceptionThe archive is malformed, misses keys or the values are invalid.
IcvNotSupportedExceptionThe Version entry indicates an unsupported version.

Reimplemented from ModuleBase.

Definition at line 237 of file DebayerModule.cs.

◆ Dispose()

void Dispose ( )
inline

Releases all resources used by this class.

Definition at line 118 of file DebayerModule.cs.

◆ Process() [1/2]

override Image Process ( Image inputImage)
inline

Converts a Bayer or mono image to a color image, or returns the input image unchanged.

A demosaicing algorithm is applied according to the configured conversion policy. The input image is returned unchanged if the module is disabled, the policy indicates bypass, or the image format is not eligible for conversion. Otherwise, the Bayer RAW image is converted to the configured output format.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputImageThe input image (Bayer, mono, or already color).
Returns
The processed color image or the unmodified input image.

Definition at line 169 of file DebayerModule.cs.

◆ Process() [2/2]

override object Process ( object input)
inlinevirtual

Converts a Bayer or mono image to a color image, or returns the input image unchanged.

A demosaicing algorithm is applied according to the configured conversion policy. The input image is returned unchanged if the module is disabled, the policy indicates bypass, or the image format is not eligible for conversion. Otherwise, the Bayer RAW image is converted to the configured output format.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image (Bayer, mono, or already color).
Returns
The processed color image or the unmodified input image.

Reimplemented from ModuleBase.

Definition at line 144 of file DebayerModule.cs.

◆ ReleaseBuffers()

void ReleaseBuffers ( )
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.

Definition at line 288 of file DebayerModule.cs.

◆ ResetToDefault()

override void ResetToDefault ( )
inlinevirtual

Resets all module settings to its default settings.

Note
The enabled state does not change when calling this function.

Reimplemented from ModuleBase.

Definition at line 264 of file DebayerModule.cs.

◆ Serialize()

override void Serialize ( IArchive archive)
inlinevirtual

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.

Reimplemented from ModuleBase.

Definition at line 205 of file DebayerModule.cs.

Field Documentation

◆ DefaultChannelLayout

const DebayerChannelLayout DefaultChannelLayout = DebayerChannelLayout.RGB
static

The default channel layout.

Definition at line 34 of file DebayerModule.cs.

◆ DefaultConversionPolicy

const DebayerConversionPolicy DefaultConversionPolicy = DebayerConversionPolicy.BayerOnly
static

The default conversion policy.

Definition at line 39 of file DebayerModule.cs.

◆ DefaultPolicy

const ProcessingPolicy DefaultPolicy = ProcessingPolicy.Fast
static

The default processing policy.

Definition at line 49 of file DebayerModule.cs.

◆ DefaultTargetBitDepth

const uint DefaultTargetBitDepth = 8
static

The default target bit depth.

Definition at line 44 of file DebayerModule.cs.

Property Documentation

◆ ChannelLayout

The output channel layout used for debayered images.

This controls the order and number of color channels in the converted image.

Definition at line 75 of file DebayerModule.cs.

◆ ConversionPolicy

The debayer conversion policy.

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

Definition at line 84 of file DebayerModule.cs.

◆ IsEnabled

virtual bool IsEnabled = true
getsetinherited

Get whether this module is enabled.

When disabled, Process returns the input image unchanged.

Implements IModule.

Definition at line 28 of file ModuleBase.cs.

◆ ProcessingPolicy

The processing policy defines how the target bit depth interacts with the input image bit depth.

Definition at line 113 of file DebayerModule.cs.

◆ TargetBitDepth

uint TargetBitDepth = DefaultTargetBitDepth
getset

The target bit depth for processed images.

The effective output bit depth depends on the selected ProcessingPolicy:

  • Fast: The minimum of the input bit depth and the target bit depth.
  • Balanced: Equal to the input bit depth.
  • Enhanced: The maximum of the input bit depth and the target bit depth.

Typical values are 8, 10, or 12.

Definition at line 108 of file DebayerModule.cs.

◆ TypeId

override string TypeId
get

The unique type identifier for this module implementation.This should be a unique string identifying the specific implementation of the module.

Implements IModule.

Definition at line 67 of file DebayerModule.cs.

◆ Version

int Version = 1
getinherited

The module version.

Definition at line 20 of file ModuleBase.cs.