17#include <peak_icv_c/algorithms/filters/peak_icv_image_filter_sharpening.h>
216 static constexpr int moduleVersion{ 1 };
217 static constexpr auto levelKey{
"Level" };
219 uint32_t m_level{ 0 };
221 bool m_enabled{
true };
226 m_enabled = other.m_enabled;
233 m_enabled = other.m_enabled;
241 archive.
SetInt(
"Version", moduleVersion);
244 archive.
SetInt(levelKey, m_level);
249 const auto version = archive.
GetInt(
"Version");
254 m_level =
static_cast<uint32_t
>(archive.
GetInt(levelKey));
280 if (level < range.GetMinimum() || level > range.GetMaximum())
294 peak_common_interval_u cRange{};
296 return PEAK_ICV_C_ABI_PREFIX peak_icv_ImageFilter_Sharpening_GetRange(&cRange);
299 return { cRange.minimum, cRange.maximum };
324 if (!isSupportedMonoImage && !isSupportedColorImage)
329 auto*
const inputImageHandle = peak::common::detail::BackendAccessor<peak::icv::Image>::BackendHandle(inputImage);
332 return PEAK_ICV_C_ABI_PREFIX peak_icv_ImageFilter_Sharpening_ProcessInPlace(inputImageHandle, m_level);
A type-erased container for any copyable value.
T & AnyCast()
Casts the stored value to the specified type.
Represents a continuous numeric interval with inclusive lower and upper bounds.
Interface for a hierarchical key-value archive system.
virtual void SetBool(const std::string &key, bool value)=0
Stores a boolean value.
virtual void SetInt(const std::string &key, int64_t value)=0
Stores a 64-bit signed integer.
virtual int64_t GetInt(const std::string &key) const =0
Retrieves a 64-bit signed integer by key.
virtual bool GetBool(const std::string &key) const =0
Retrieves a boolean value by key.
For detailed information about the use of ids_peak_icv Image refer to the Image Guide.
peak::common::PixelFormat GetPixelFormat() const
Provides the pixel format of the image.
Thrown when a value is outside the allowed range.
Sharpening is an image pipeline module that applies a sharpening filter to enhance image detail.
~SharpeningModule() override=default
const char * GetType() const override
Returns the type of the module for serialization purposes.
SharpeningModule & operator=(const SharpeningModule &other)=delete
Copy assignment for class SharpeningModule is deleted.
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the object's internal state into the provided archive.
peak::icv::Image Process(const peak::icv::Image &input) const
Processes the input image and returns a sharpened output image.
void SetEnabled(bool enabled) override
Sets the enabled state of this module.
void SetLevel(uint32_t level)
Sets the sharpness level.
void Deserialize(const peak::common::serialization::IArchive &archive) override
Restores the object's state from the provided archive.
uint32_t GetLevel() const
Retrieves the current sharpness level.
void ResetToDefault() override
Resets the sharpness level to the default value.
SharpeningModule()=default
Creates an instance of class SharpeningModule with default values.
SharpeningModule(const SharpeningModule &other)=delete
Copy constructor for class SharpeningModule is deleted.
bool IsEnabled() const override
Checks if the module is currently enabled.
peak::common::IntervalU GetLevelRange() const
Returns the valid range of sharpness levels.
Interface for a module used within a pipeline.
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
@ Mono12
Mono 12-Bit pixel format.
@ BGR10p32
BGR 10-Bit packed 32-bit format.
@ Mono10
Mono 10-Bit pixel format.
@ Mono8
Mono 8-Bit pixel format.
@ RGB10p32
RGB 10-Bit packed 32-bit format.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
void ValidateVersion(int64_t version, const std::string &moduleName)