19 private readonly ImageConverterCInterface.Handle _handle;
26 var handle =
new ImageConverterCInterface.Handle();
27 DllHelper.ExecuteAndMapReturnCodes(() =>
28 ImageConverterCInterface.CInterface.peak_icv_Preprocessing_ImageConverter_Create(out handle));
33 public override string TypeId =>
"MonoConversion";
41 GC.SuppressFinalize(
this);
72 PixelFormat outputFormat = GetOutputFormat(inputFormat);
74 if (inputFormat == outputFormat)
79 var outputImageHandle =
new Image.Handle();
81 DllHelper.ExecuteAndMapReturnCodes(() =>
82 ImageConverterCInterface.CInterface.peak_icv_Preprocessing_ImageConverter_Convert(_handle,
84 outputFormat, out outputImageHandle));
86 return new Image(outputImageHandle);
107 DllHelper.ExecuteAndMapReturnCodes(() =>
108 ImageConverterCInterface.CInterface.peak_icv_Preprocessing_ImageConverter_ReleaseBuffers(_handle));
115 if (info.IsSingleChannel && info.HasIntensityChannel)
120 var bitDepth = info.StorageBitsPerChannel;
122 return bitDepth
switch
127 _ => PixelFormat.Mono16
Base class for all pipeline modules.
virtual bool IsEnabled
Get whether this module is enabled.
Mono conversion is an image pipeline module that converts images to a monochrome format.
MonoConversionModule()
Creates an instance of class MonoConversionModule.
override Image Process(Image inputImage)
Converts the input image to the configured output pixel format.
void ReleaseBuffers()
Frees unused internal buffers.
override void ResetToDefault()
Calling this method has no effect.
void Dispose()
Releases all resources used by this class.
override string TypeId
The unique type identifier for this module implementation.This should be a unique string identifying ...
Constructs an Image from an IImageView Instance.
PixelFormat PixelFormat
Gets the pixel format from the image.
PixelFormat
Each enumerator represents a specific pixel layout and bit-depth, used for interpreting raw image dat...