class P1::ImageSdk::ConvertConfig

Overview

Class that configures the Convert pipeline stages. More…

#include <P1ImageConvertConfig.hpp>

class ConvertConfig
{
public:
    // fields

    static const ValueRange<float> ExposureRange;
    static const ValueRange<float> ContrastRange;
    static const ValueRange<float> BrightnessRange;
    static const ValueRange<float> SaturationRange;
    static const ValueRange<float> HighlightRecoveryRange;
    static const ValueRange<float> ShadowRecoveryRange;
    static const ValueRange<float> BlackLevelRange;
    static const ValueRange<float> WhiteLevelRange;
    static const ValueRange<float> MidtoneLevelRange;
    static const ValueRange<double> CurveInOutRange;
    static const ValueRange<int> ClarityMethodRange;
    static const ValueRange<float> ClarityAmountRange;
    static const ValueRange<float> LuminanceNoiseReductionAmountRange;
    static const ValueRange<float> ColorNoiseReductionAmountRange;
    static const ValueRange<float> WhiteBalanceGainRange;
    static const ValueRange<float> SharpeningGain;
    static const ValueRange<float> SharpeningRadius;
    static const ValueRange<float> SharpeningThreshold;
    static const ValueRange<float> SharpeningHaloSuppression;
    static const ValueRange<float> AerialDehazingAmount;
    static const ValueRange<int> AerialDehazingAdaptivity;
    static const ValueRange<float> GeometricCorrectionFocalLengthRange;
    static const ValueRange<float> GeometricCorrectionPixelPitchRange;
    static const ValueRange<float> GeometricCorrectionShiftRange;
    static const ValueRange<float> GeometricCorrectionPolinomRange;
    static const ValueRange<float> GeometricCorrectionAffinityRange;

    // construction

    ConvertConfig();
    ConvertConfig(const ConvertConfig& other);

    // methods

    ConvertConfig& operator = (const ConvertConfig& other);
    CanvasClip GetCanvasClip() const;
    ConvertConfig SetCanvasClip(CanvasClip canvasClip);
    Rect GetCrop() const;
    bool HasCrop() const;
    bool HasOutputScaling() const;
    int GetVersion() const;
    double GetOutputScale() const;
    int32_t GetOutputWidth() const;
    int32_t GetOutputHeight() const;
    BitmapFormat GetOutputFormat() const;
    ColorSpace GetOutputColorSpace() const;
    OrientationMode GetOrientation() const;
    ConvertConfig SetCrop(int32_t x, int32_t y, int32_t width, int32_t height);
    ConvertConfig SetCrop(const Rect& cropRect);
    ConvertConfig ResetCrop();
    ConvertConfig SetOrientation(const OrientationMode orientation);
    ConvertConfig SetOutputScale(double scaleFactor);
    ConvertConfig SetOutputWidth(int32_t destinationWidth);
    ConvertConfig SetOutputHeight(int32_t destinationHeight);
    ConvertConfig SetOutputFormat(BitmapFormat format);
    ConvertConfig SetOutputColorSpace(ColorSpace colorSpace);
    ConvertConfig SetDualExposureOutput(DualExposureOutput mode);
    float GetContrast() const;
    ConvertConfig SetContrast(const float contrast);
    float GetBrightness() const;
    ConvertConfig SetBrightness(const float brightness);

    ConvertConfig SetPolynomialTransformation(
        const float ax,
        const float bx,
        const float cx,
        const float ay,
        const float by,
        const float cy
        );

    ConvertConfig SetPolynomialTransformationNormalized(
        const float ax,
        const float bx,
        const float cx,
        const float ay,
        const float by,
        const float cy
        );

    ConvertConfig SetPolynomialTransformationNormalized_EndPipeline(
        const float ax,
        const float bx,
        const float cx,
        const float ay,
        const float by,
        const float cy
        );

    std::vector<float> GetPolynomialTransformation();
    float GetSaturation() const;
    ConvertConfig SetSaturation(const float saturation);
    float GetExposure() const;
    ConvertConfig SetExposure(const float exposure);
    float GetAerialDehazingAmount();
    int GetAerialDehazingLocalLevel();
    ConvertConfig SetAerialDehazing(const float amount, const int localLevel = 2);
    float GetGain() const;
    ConvertConfig SetGain(const float gain);
    Color GetBlackLevel() const;
    ConvertConfig SetBlackLevel(float r, float g, float b);
    ConvertConfig SetBlackLevel(Color color);
    Color GetMidtoneLevel() const;
    ConvertConfig SetMidtoneLevel(float r, float g, float b);
    ConvertConfig SetMidtoneLevel(Color color);
    Color GetWhiteLevel() const;
    ConvertConfig SetWhiteLevel(float r, float g, float b);
    ConvertConfig SetWhiteLevel(Color color);
    Color GetBlackLevelTarget();
    ConvertConfig SetBlackLevelTarget(float r, float g, float b);
    ConvertConfig SetBlackLevelTarget(Color c);
    Color GetWhiteLevelTarget();
    ConvertConfig SetWhiteLevelTarget(float r, float g, float b);
    ConvertConfig SetWhiteLevelTarget(Color c);
    float GetSharpeningAmount() const;
    float GetSharpeningRadius() const;
    float GetSharpeningThreshold() const;
    float GetHaloSuppressionAmount();

    ConvertConfig SetSharpening(
        float sharpeningAmount,
        float radius,
        float threshold,
        float haloSuppressionAmount = 0.0f
        );

    float GetLuminanceNoiseReductionAmount() const;
    ConvertConfig SetLuminanceNoiseReductionAmount(const float luminanceNoiseReductionAmount);
    bool GetNoiseReductionSinglePixelEnabled() const;
    ConvertConfig SetNoiseReductionSinglePixelEnabled(const bool noiseReductionSinglePixelEnabled);
    float GetColorNoiseReductionAmount() const;
    ConvertConfig SetColorNoiseReductionAmount(const float colorNoiseReductionAmount);
    bool GetNoiseReductionPerformanceOptimized() const;
    ConvertConfig SetNoiseReductionPerformanceOptimized(const bool noiseReductionPerformanceOptimized);
    Clarity GetClarity() const;
    ConvertConfig SetClarity(int clarityMethod, float clarityFactor);
    ConvertConfig SetClarity(Clarity clarity);
    float GetShadowRecovery() const;
    ConvertConfig SetShadowRecovery(const float shadowRecovery);
    float GetHighlightRecovery() const;
    ConvertConfig SetHighlightRecovery(const float highlightRecovery);
    const std::vector<Point2D> GetRedCurve() const;

    const Curve GetDiscretizedRedCurve(
        int numDiscretizedPoint,
        bool* success = nullptr
        );

    ConvertConfig SetRedCurve(const std::vector<Point2D>& points);
    const std::vector<Point2D> GetGreenCurve() const;
    ConvertConfig SetGreenCurve(const std::vector<Point2D>& points);

    const Curve GetDiscretizedGreenCurve(
        int numDiscretizedPoint,
        bool* success = nullptr
        );

    const std::vector<Point2D> GetBlueCurve() const;
    ConvertConfig SetBlueCurve(const std::vector<Point2D>& points);

    const Curve GetDiscretizedBlueCurve(
        int numDiscretizedPoint,
        bool* success = nullptr
        );

    const std::vector<Point2D> GetLumaCurve() const;
    ConvertConfig SetLumaCurve(const std::vector<Point2D>& points);

    const Curve GetDiscretizedLumaCurve(
        int numDiscretizedPoint,
        bool* success = nullptr
        );

    const std::vector<Point2D> GetRgbCurve() const;
    ConvertConfig SetRgbCurve(const std::vector<Point2D>& points);

    const Curve GetDiscretizedRgbCurve(
        int numDiscretizedPoint,
        bool* success = nullptr
        );

    const Color GetWhiteBalanceGain() const;
    ConvertConfig SetWhiteBalanceGain(const Color whiteBalanceGain);
    const WhiteBalanceMode GetWhiteBalanceMode() const;
    ConvertConfig SetWhiteBalanceMode(const WhiteBalanceMode mode);
    bool GetGeometricCorrectionEnabled() const;
    ConvertConfig SetGeometricCorrectionEnabled(const bool enable);
    GeometricCorrectionMethod GetGeometricCorrectionMethod() const;
    ConvertConfig SetGeometricCorrectionMethod(GeometricCorrectionMethod method);
    const GeometricCorrection GetGeometricCorrection() const;
    ConvertConfig SetGeometricCorrection(const GeometricCorrection geometricCorrection);
    ConvertConfig SetGeometricCorrectionCompensationEnabled(const bool enable);
    ConvertConfig SetGeometricCompensationPressure(const float pressure);
    bool GetLightFalloffCorrectionEnabled() const;
    ConvertConfig SetLightFalloffCorrectionEnabled(const bool enable);
    bool GetChromaticAberrationCorrectionEnabled() const;
    ConvertConfig SetChromaticAberrationCorrectionEnabled(const bool enable);
    bool GetExposureWarningMaskEnabled() const;
    ConvertConfig SetExposureWarningMaskEnabled(const bool enable);
    float GetMaskThresholdOverExposure() const;
    float GetMaskThresholdUnderExposure() const;

    ConvertConfig SetExposureMaskThreshold(
        float underExposeThreshold,
        float overExposeThreshold
        );

    bool GetClipWarningMaskEnabled() const;
    ConvertConfig SetClipWarningMaskEnabled(bool enable);
    int GetMaskThresholdClipWarningCount() const;
    ConvertConfig SetMaskThresholdClipWarningCount(int thresholdCount);
    bool GetColorAntiAliasingEnabled() const;
    ConvertConfig SetColorAntiAliasingEnabled(const bool enable);
    bool GetEnableLinearPath() const;
    ConvertConfig SetEnableLinearPath(const bool enable);
    ConvertConfig SetLinearPathType(const LinearPathType type);
    LinearPathType GetLinearPathType() const;
    ConvertConfig SetFilmCurve(char* filename);
    std::string GetFilmCurve();
    ConvertConfig SetIccProfile(char* filename);
    std::string GetIccProfile();
    ConvertConfig SetAutoExposureEnabled(bool state);
    bool GetAutoExposureEnabled();

    BitmapImage ApplyTo(
        const RawImage& image,
        double& outputFocalLength,
        BitmapImage* mask = nullptr,
        bool waitForBusySDK = false
        );

    BitmapImage ApplyTo(
        const RawImage& image,
        BitmapImage* mask = nullptr,
        bool waitForBusySDK = false
        );

    void SaveToFile(const char* filename) const;
    std::string Serialize() const;
    static ConvertConfig LoadFromFile(const char* filename);
    static ConvertConfig Deserialize(const std::string serializedData);

    static std::vector<float> DiscretizeCurve(
        const std::vector<Point2D>& points,
        unsigned int bits
        );
};

Detailed Documentation

Class that configures the Convert pipeline stages.

The convert config is where convertion from Bayer domain into the Rgb domain happens, you can configure cropping and scaling. The order is fixed. Also you can enable and setup different kinds of image enhancements algorithms, known from other image editing tools. Also it is possible to enable image corrections like lens distortion and light falloff.

Fields

static const ValueRange<float> ExposureRange

The ValueRange of the Exposure value.

  • Minimum: -4.0

  • Maximum: 4.0

  • Default: 0.0

static const ValueRange<float> ContrastRange

The ValueRange of the Contrast value.

  • Minimum: -1.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> BrightnessRange

The ValueRange of the Brightness value.

  • Minimum: -1.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> SaturationRange

The ValueRange of the Saturation value.

  • Minimum: -1.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> HighlightRecoveryRange

The ValueRange of the HighlightRecovery value.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> ShadowRecoveryRange

The ValueRange of the ShadowRecovery value.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> BlackLevelRange

The ValueRange of the BlackLevel value.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> WhiteLevelRange

The ValueRange of the WhiteLevel value.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 1.0

static const ValueRange<float> MidtoneLevelRange

The ValueRange of the MidtoneLevel value.

  • Minimum: -1.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<double> CurveInOutRange

The ValueRange of the X and Y field of each element of the curve type properties.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 0.0

The properties this applies to are the following

  • RedCurve

  • BlueCurve

  • GreenCurve

  • LumaCurve

  • RGBCurve

static const ValueRange<int> ClarityMethodRange

The ValueRange of the Method field of the Clarity value.

  • Minimum: clarityMethodNeutral = 0

  • Maximum: clarityMethodNatural = 2

  • Default: clarityMethodNeutral = 0

static const ValueRange<float> ClarityAmountRange

The ValueRange of the Factor field of the Clarity property.

  • Minimum: -1.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> LuminanceNoiseReductionAmountRange

The ValueRange of the LuminanceNoiseReductionAmount property.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> ColorNoiseReductionAmountRange

The ValueRange of the ColorNoiseReductionAmount property.

  • Minimum: 0.0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> WhiteBalanceGainRange

The ValueRange of the RGB channels of the White Balance Gain property.

  • Minimum: 0

  • Maximum: 10.0

  • Default: 0.0, meaning to use the metadata embedded into the IIQ file.

static const ValueRange<float> SharpeningGain

The ValueRange of the sharpening amount.

  • Minimum: 0

  • Maximum: 10.0

  • Default: 0.0, meaning no sharpening applied

static const ValueRange<float> SharpeningRadius

The ValueRange of the sharpening radius.

  • Minimum: 0

  • Maximum: 3.0

  • Default: 1.0

static const ValueRange<float> SharpeningThreshold

The ValueRange of the sharpening threshold used to reduce noise.

  • Minimum: 0

  • Maximum: 10.0

  • Default: 1.0

static const ValueRange<float> SharpeningHaloSuppression

The ValueRange for suppressing halo caused by sharpening. Recommended to 0.0 (disable halo suppression) because image generally does not have hallo.

  • Minimum: 0

  • Maximum: 1.0

  • Default: 0.0

static const ValueRange<float> AerialDehazingAmount

The ValueRange of the aerial dehazing amount.

  • Minimum: 0

  • Maximum: 1.0

  • Default: 0.0, meaning no dehazing applied

static const ValueRange<int> AerialDehazingAdaptivity

The ValueRange of the aerial dehazing local adaptivity.

  • Minimum: 0

  • Maximum: 5

  • Default: 2

static const ValueRange<float> GeometricCorrectionFocalLengthRange

The ValueRange of the focalLength field of the GeometricCorrection value.

  • Minimum: 23.0

  • Maximum: 1000.0

static const ValueRange<float> GeometricCorrectionPixelPitchRange

The ValueRange of the pixelSize field of the GeometricCorrection value.

  • Minimum: 0.001

  • Maximum: 0.05317

  • Default: -1.0, indicating that the GeometricCorrection is unset, and is not to be used.

static const ValueRange<float> GeometricCorrectionShiftRange

The ValueRange of the xP and yP fields of the GeometricCorrection value. It is measured in mm.

  • Minimum: -30.0

  • Maximum: 30.0

  • Default: 0.0

static const ValueRange<float> GeometricCorrectionPolinomRange

The ValueRange of the k1, k2, k3, p1, p2 fields of the GeometricCorrection value.

  • Minimum: -1.0e-4

  • Maximum: 1.0e-4

  • Default: 0.0

static const ValueRange<float> GeometricCorrectionAffinityRange

The ValueRange of the b1, b2 fields of the GeometricCorrection value.

  • Minimum: -1.0

  • Maximum: 1.0

  • Default: 0.0

Methods

CanvasClip GetCanvasClip() const

Returns the current CanvasClip setting.

ConvertConfig SetCanvasClip(CanvasClip canvasClip)

Configure the output image canvas edge handling.

Parameters:

canvasClip

The new CanvasClip setting.

Returns:

This object itself (this), to allow chaining

Rect GetCrop() const

Get any configured crop.

int GetVersion() const

Get ConvertConfig version. <= 0 means unknown / wrong file format.

double GetOutputScale() const

Get any configured scaling factor, or a negative number, if none if set.

int32_t GetOutputWidth() const

Get any configured scaling by fixed output width, or a negative number, if none if set.

int32_t GetOutputHeight() const

Get any configured scaling by fixed output height, or a negative number, if none if set.

BitmapFormat GetOutputFormat() const

The data format of the pixels.

ColorSpace GetOutputColorSpace() const

The color space of the output image.

OrientationMode GetOrientation() const

The orientation mode of the convert.

ConvertConfig SetCrop(int32_t x, int32_t y, int32_t width, int32_t height)

Crop image to a given rectangle, in coordinates of the input image.

ConvertConfig SetCrop(const Rect& cropRect)

Crop image to a given rectangle, in coordinates of the input image.

ConvertConfig ResetCrop()

Reset crop.

ConvertConfig SetOrientation(const OrientationMode orientation)

Set orientation mode of the convert.

ConvertConfig SetOutputScale(double scaleFactor)

Scale image relative to the full image size, with aspect ratio enforced.

ConvertConfig SetOutputWidth(int32_t destinationWidth)

Set the scaling to match a given destination width, aspect ratio is still enforced.

ConvertConfig SetOutputHeight(int32_t destinationHeight)

Set the scaling to match a given destination height, aspect ratio is still enforced.

ConvertConfig SetOutputFormat(BitmapFormat format)

Set the pixel data format of the output image.

ConvertConfig SetOutputColorSpace(ColorSpace colorSpace)

Set the color space of the output image.

ConvertConfig SetDualExposureOutput(DualExposureOutput mode)

Specify how dual exposures are processed.

float GetContrast() const

Get the value of the contrast setting in the convert config. See also SetContrast function.

ConvertConfig SetContrast(const float contrast)

Adjust the contrast of the image.

Parameters:

contrast

is a value between -1.0 and 1.0. Default is 0.0

float GetBrightness() const

Get the value of the brightness setting in the convert config. See also SetBrightness function.

ConvertConfig SetBrightness(const float brightness)

Adjust the brightness of the image.

Parameters:

brightness

is a value between -1.0 and 1.0. Default is 0.0

ConvertConfig SetPolynomialTransformation(
    const float ax,
    const float bx,
    const float cx,
    const float ay,
    const float by,
    const float cy
    )

**

Set polynomial gain on either bayer or RGB * / ** Get polynomial gain (either bayer or RGB) * /

Set gain the bayer image polynomially: I = Y * (ax * x * x + bx * x + cx) * (ay * y * y + by * y + cy). This is done after demosaicing

ConvertConfig SetPolynomialTransformationNormalized(
    const float ax,
    const float bx,
    const float cx,
    const float ay,
    const float by,
    const float cy
    )

Set gain the bayer image polynomially: I = Y * (ax * x * x + bx * x + cx) * (ay * y * y + by * y + cy), where x and y have range of [0, 1]. This is done after demosaicing.

ConvertConfig SetPolynomialTransformationNormalized_EndPipeline(
    const float ax,
    const float bx,
    const float cx,
    const float ay,
    const float by,
    const float cy
    )

Set gain the bayer image polynomially: I = Y * (ax * x * x + bx * x + cx) * (ay * y * y + by * y + cy), where x and y have range of [0, 1]. This is done at the end of the processing pipeline.

std::vector<float> GetPolynomialTransformation()

Get gain the bayer image polynomially: I = Y * (ax * x * x + bx * x + cx) * (ay * y * y + by * y + cy)

Parameters:

Return

{ax, bx, cx, ay, by, cy}

float GetSaturation() const

Get the value of the saturation setting in the convert config. See also SetSaturation function.

ConvertConfig SetSaturation(const float saturation)

Adjust the saturation of the image.

Parameters:

saturation

is a value between -1.0 and 1.0. Default is 0.0

float GetExposure() const

Get the value of the exposure setting in the convert config. See also SetExposure function.

ConvertConfig SetExposure(const float exposure)

Adjust the exposure of the image.

Parameters:

exposure

is a value between -4.0 and 4.0. Default is 0.0

float GetAerialDehazingAmount()

See SetAerialDehazing()

int GetAerialDehazingLocalLevel()

See SetAerialDehazing()

ConvertConfig SetAerialDehazing(const float amount, const int localLevel = 2)

Reduce effect of haze, fog or cloud and increase image visibility.

Parameters:

amount

is a value between 0.0 and 1.0. Default is 0.0.

localLevel

is a value between 0 and 10. It adapt dehazing to local region. Value 0 means it performs dehazing on the whole image. Higher value means it performs dehazing on smaller regions, independantly.

float GetGain() const

Get the value of the gain setting in the convert config. See also SetGain function.

ConvertConfig SetGain(const float gain)

Adjust the gain of the image - this is a variant of the exposure setting.

Parameters:

gain

is a floating point value. Default is 1.0

Color GetBlackLevel() const

Get the black level setting in the convert config. See also SetBlackLevel functions.

ConvertConfig SetBlackLevel(float r, float g, float b)

Set the black level. This is a color that is regarded as black

Parameters:

r

g

b

are values between 0.0 and 1.0. Default is 0.0

ConvertConfig SetBlackLevel(Color color)

Set the black level. This is a color that is regarded as black.

Parameters:

color

where the r,g,b color is set as a struct.

Color GetMidtoneLevel() const

Get the midtone level setting in the convert config. See also SetMidtoneLevel functions.

ConvertConfig SetMidtoneLevel(float r, float g, float b)

Set the midtone level. This is a color that is used as 50% level of the color values.

Parameters:

r

g

b

are values between -1.0 and 1.0. Default is 0.0

ConvertConfig SetMidtoneLevel(Color color)

Set the midtone level. This is a color that is used as 50% level of the color values.

Parameters:

color

where the r,g,b color is set as a struct.

Color GetWhiteLevel() const

Get the white level setting in the convert config. See also SetWhiteLevel functions.

ConvertConfig SetWhiteLevel(float r, float g, float b)

Set the white level. This is a color that is regarded as white.

Parameters:

r

g

b

are values between 0.0 and 1.0. Default is 1.0

ConvertConfig SetWhiteLevel(Color color)

Set the white level. This is a color that is regarded as white.

Parameters:

color

where the r,g,b color is set as a struct.

Color GetBlackLevelTarget()

Get the level target used for black. This is a color that black color is mapped into (as in a level tool)

ConvertConfig SetBlackLevelTarget(float r, float g, float b)

Set the level used for black. This is a color that black color is mapped into (as in a level tool)

Parameters:

r

g

b

are values between 0.0 and 1.0. Default is 0.0

ConvertConfig SetBlackLevelTarget(Color c)

Set the level used for black. This is a color that black color is mapped into (as in a level tool)

Parameters:

c

are (red, green, blue) values between 0.0 and 1.0. Default is 0.0

Color GetWhiteLevelTarget()

Get the level target used for white. This is a color that white color is mapped into (as in a level tool)

ConvertConfig SetWhiteLevelTarget(float r, float g, float b)

Set the level used for white. This is a color that white color is mapped into (as in a level tool)

Parameters:

r

g

b

are values between 0.0 and 1.0. Default is 1.0

ConvertConfig SetWhiteLevelTarget(Color c)

Set the level used for white. This is a color that white color is mapped into (as in a level tool)

Parameters:

c

is (red, green, blue) values between 0.0 and 1.0. Default is 1.0

float GetSharpeningAmount() const

See SetSharpening function.

float GetSharpeningRadius() const

See SetSharpening function.

float GetSharpeningThreshold() const

See SetSharpening function.

float GetHaloSuppressionAmount()

See SetSharpening function.

ConvertConfig SetSharpening(
    float sharpeningAmount,
    float radius,
    float threshold,
    float haloSuppressionAmount = 0.0f
    )

Adjust the amount of sharpening of the image.

Parameters:

sharpeningAmount

is the strength of sharpening, value between 0 and 10. Default is 0.0

radius

is patch size for detecting detail, value between 0 and 3. Default is 1.0

threshold

defines noise level or weak detail, which will be ignored. Value between 0 and 10. Default is 1.0

haloSuppressionAmount

is amount of halo suppression, value between 0 and 1. Default is 0.0. Recommended to 0.0 (disable halo suppression) because image generally does not have hallo.

float GetLuminanceNoiseReductionAmount() const

Gets the current the strength the Luminance Noise Reduction algorithm is applied.

ConvertConfig SetLuminanceNoiseReductionAmount(const float luminanceNoiseReductionAmount)

Sets the strength the Luminance Noise Reduction algorithm is applied.

Parameters:

luminanceNoiseReductionAmount

is a value between 0.0 and 1.0. Default is 0.

bool GetNoiseReductionSinglePixelEnabled() const

Returns if hot pixel removal (useful for high ISO images) is enabled.

ConvertConfig SetNoiseReductionSinglePixelEnabled(const bool noiseReductionSinglePixelEnabled)

Enables hot pixel removal (useful for high ISO images)

Parameters:

noiseReductionSinglePixelEnabled

toggles this operation

float GetColorNoiseReductionAmount() const

Gets the current the strength the Color Noise Reduction algorithm is applied.

ConvertConfig SetColorNoiseReductionAmount(const float colorNoiseReductionAmount)

Sets the strength the Color Noise Reduction algorithm is applied.

Parameters:

colorNoiseReductionAmount

is a value between 0.0 and 1.0. Default is 0.

bool GetNoiseReductionPerformanceOptimized() const

Returns if the noise reduction algorithms are optimized for performance.

ConvertConfig SetNoiseReductionPerformanceOptimized(const bool noiseReductionPerformanceOptimized)

Toggles between performance optimized and quality optimized noise reduction algorithm.

Clarity GetClarity() const

Get the setup of the clarity tool. See also SetClarity function for further explanation.

ConvertConfig SetClarity(int clarityMethod, float clarityFactor)

Setup the clarity tool. Its used as a tool to help control the local contrast in the image. A negative value will decrease local contrast and and positive increase it. Its a combination of selecting a method and a factor (amount)

Parameters:

clarityMethod

is the method used for clarity tool. It can be set to: clarityMethodNeutral = 0, clarityMethodPunch=1, clarityMethodNatural=2. Default is clarityMethodNeutral=0

clarityFactor

is the value defining the factor used for the clarity tool. It is a value between -1.0 and 1.0. Default is 0.0 for disabled

ConvertConfig SetClarity(Clarity clarity)

Setup the clarity tool. It’s used as a tool to help control the local contrast in the image. A negative value will decrease local contrast and and positive increase it. Its a combination of selecting a method and a factor (amount)

Parameters:

clarity

is a struct with two members: the method and the factor. See SetClarity(int clarityMethod, float clarityFactor)

float GetShadowRecovery() const

Get the value of the shadow recovery setting in the convert config. See also SetShadowRecovery function.

ConvertConfig SetShadowRecovery(const float shadowRecovery)

Set shadow recovery. Used to extract details only in the shadows of the image by making them brighter.

Parameters:

shadowRecovery

is a value to control how much effect is wanted. The value can be between 0.0 and 1.0. Default is 0.0 (=disabled)

float GetHighlightRecovery() const

Get the value of the highight recovery setting in the convert config. See also SetHighlightRecovery function.

ConvertConfig SetHighlightRecovery(const float highlightRecovery)

Set highlight recovery. Used to extract details only in the highlights of the image by reducing the brightness of highlight pixels.

Parameters:

highlightRecovery

is a value to control how much effect is wanted. The value can be between 0.0 and 1.0. Default is 0.0 (=disabled)

const std::vector<Point2D> GetRedCurve() const

Get a vector of discreete coordinate pairs (x,y) describing the red curve used. See also SetRedCurve.

const Curve GetDiscretizedRedCurve(
    int numDiscretizedPoint,
    bool* success = nullptr
    )

Get real curve used inside ImageSDK.

ConvertConfig SetRedCurve(const std::vector<Point2D>& points)

Set the curve for red values as known from the curves tool in most image editors. The curve is defined as a vector of discreete coordinate pairs (x,y) that is interpolated. Default is a linear mapping: (0.0,0.0)-(1.0,1.0).

Parameters:

points

is a vector of discreete coordinate pairs (x,y) in the range (0.0,0.0)-(1.0,1.0).

const std::vector<Point2D> GetGreenCurve() const

Get a vector of discreete coordinate pairs (x,y) describing the green curve used. See also SetGreenCurve.

ConvertConfig SetGreenCurve(const std::vector<Point2D>& points)

Set the curve for green values as known from the curves tool in most image editors. The curve is defined as a vector of discreete coordinate pairs (x,y) that is interpolated. Default is a linear mapping: (0.0,0.0)-(1.0,1.0). It is similar to the curves tool known from most image editors.

Parameters:

points

is a vector of discreete coordinate pairs (x,y) in the range (0.0,0.0)-(1.0,1.0).

const Curve GetDiscretizedGreenCurve(
    int numDiscretizedPoint,
    bool* success = nullptr
    )

Get real curve used inside ImageSDK.

const std::vector<Point2D> GetBlueCurve() const

Get a vector of discreete coordinate pairs (x,y) describing the blue curve used. See also SetBlueCurve.

ConvertConfig SetBlueCurve(const std::vector<Point2D>& points)

Set the curve for blue values as known from the curves tool in most image editors. The curve is defined as a vector of discreete coordinate pairs (x,y) that is interpolated. Default is a linear mapping: (0.0,0.0)-(1.0,1.0). It is similar to the curves tool known from most image editors.

Parameters:

points

is a vector of discreete coordinate pairs (x,y) in the range (0.0,0.0)-(1.0,1.0).

const Curve GetDiscretizedBlueCurve(
    int numDiscretizedPoint,
    bool* success = nullptr
    )

Get real curve used inside ImageSDK.

const std::vector<Point2D> GetLumaCurve() const

Get a vector of discreete coordinate pairs (x,y) describing the luma curve used. See also SetLumaCurve.

ConvertConfig SetLumaCurve(const std::vector<Point2D>& points)

Set the curve for luma values as known from the curves tool in most image editors. The curve is defined as a vector of discreete coordinate pairs (x,y) that is interpolated. Default is a linear mapping: (0.0,0.0)-(1.0,1.0). It is similar to the curves tool known from most image editors.

Parameters:

points

is a vector of discreete coordinate pairs (x,y) in the range (0.0,0.0)-(1.0,1.0).

const Curve GetDiscretizedLumaCurve(
    int numDiscretizedPoint,
    bool* success = nullptr
    )

Get real curve used inside ImageSDK.

const std::vector<Point2D> GetRgbCurve() const

Get a vector of discreete coordinate pairs (x,y) describing the rgb curve used. See also SetLumaCurve.

ConvertConfig SetRgbCurve(const std::vector<Point2D>& points)

Set the curve for rgb values as known from the curves tool in most image editors. The curve is defined as a vector of discreete coordinate pairs (x,y) that is interpolated. Default is a linear mapping: (0.0,0.0)-(1.0,1.0). It is similar to the curves tool known from most image editors.

Parameters:

points

is a vector of discreete coordinate pairs (x,y) in the range (0.0,0.0)-(1.0,1.0).

const Curve GetDiscretizedRgbCurve(
    int numDiscretizedPoint,
    bool* success = nullptr
    )

Get real curve used inside ImageSDK.

const Color GetWhiteBalanceGain() const

Returns the White Balance as gain for each channels (RGB)

ConvertConfig SetWhiteBalanceGain(const Color whiteBalanceGain)

Sets the White Balance as gain for each channels (RGB)

Parameters:

whiteBalanceGain

is a Color with each field between 0.0f and 10.0f.

const WhiteBalanceMode GetWhiteBalanceMode() const

Returns the White Balance mode.

ConvertConfig SetWhiteBalanceMode(const WhiteBalanceMode mode)

Sets the White Balance mode.

Parameters:

mode

see WhiteBalanceMode for available modes.

bool GetGeometricCorrectionEnabled() const

Returns a Boolean value indicating if the conversion will include Geometric Crrection.

ConvertConfig SetGeometricCorrectionEnabled(const bool enable)

Sets the Enabled state of the Geometric Correction.

Parameters:

enable

true will enable Geometric Correction, false will disable it.

GeometricCorrectionMethod GetGeometricCorrectionMethod() const

Returns the Geometric Correction Method being used if the GeometricCorrectionEnabled flag is set.

ConvertConfig SetGeometricCorrectionMethod(GeometricCorrectionMethod method)

Sets the Geometric Correction Method to be used.

Parameters:

method

The GeometricCorrectionMethod to be used in the conversion.

const GeometricCorrection GetGeometricCorrection() const

Custom Geometric Correction parameters.

ConvertConfig SetGeometricCorrection(const GeometricCorrection geometricCorrection)

Sets Geometric Correction parameters to be applied.

If geometricCorrection is set to an invalid value, the the conversion will try to load the geometric correction data embedded in the source IIQ file

Parameters:

geometricCorrection

the geometric correction to be used for the algorithm.

bool GetLightFalloffCorrectionEnabled() const

Returns a Boolean value indicating if the conversion will include Lens Light falloff correction for recognized lenses.

ConvertConfig SetLightFalloffCorrectionEnabled(const bool enable)

Sets the Enabled state of the Lens Light falloff correction.

Parameters:

enable

true will enable Lens Light falloff correction, false will disable it.

bool GetChromaticAberrationCorrectionEnabled() const

Returns a Boolean value indicating if the conversion will include Chromatic Aberration (CA) correction.

ConvertConfig SetChromaticAberrationCorrectionEnabled(const bool enable)

Sets the Enabled state of the Chromatic Aberration correction.

Parameters:

enable

true will enable Chromatic Aberration correction, false will disable it.

bool GetExposureWarningMaskEnabled() const

Threshold for under and over exposure mask.

ConvertConfig SetExposureWarningMaskEnabled(const bool enable)

Control generation of exposure mask in the mask image. True means enable. Default is disabled. When doing the actual convertion of an image - a mask buffer must be provided. If enabled the underexposed threshold and overexposed threshold should also be set (See SetExposureMaskThreshold function)

float GetMaskThresholdOverExposure() const

Get the value of the overexposed setting used when exposure mask generation is enabled.

float GetMaskThresholdUnderExposure() const

Get the value of the underexposed setting used when exposure mask generation is enabled.

ConvertConfig SetExposureMaskThreshold(
    float underExposeThreshold,
    float overExposeThreshold
    )

Set the value of the overexposed and underexposed settings used when exposure mask generation is enabled.

Parameters:

underExposeThreshold

is a value between 0.0 and 1.0. Default is 0.0.

overExposeThreshold

is a value between 0.0 and 1.0. Default is 1.0.

bool GetClipWarningMaskEnabled() const

Get the setting for clip warning mask enabled. See also SetClipWarningMaskEnabled and SetMaskThresholdClipWarningCount functions.

ConvertConfig SetClipWarningMaskEnabled(bool enable)

enable the clip warning mask. For this setting to be used the mask image must be enabled and provided when processing the image

Parameters:

enable

can be true of false. false is the default value

int GetMaskThresholdClipWarningCount() const

Get the count of neighbour pixels that must be outside the threshold limits to be set in the clip warning mask.

ConvertConfig SetMaskThresholdClipWarningCount(int thresholdCount)

Set the minimum required count of neighbour pixels that must be outside the threshold limits to be set in the clip warning mask. For this to take effect the mask image must be enabled .

Parameters:

thresholdCount

is a value between 1 and 8.

bool GetColorAntiAliasingEnabled() const

Returns a Boolean value indicating if the conversion will include Color Anti-Aliasing operation

This operation will eliminate the color noise in thin straight lines (for example power lines or road lane markings) but will increase the process time

ConvertConfig SetColorAntiAliasingEnabled(const bool enable)

Sets the Enabled state of Color Anti-Aliasing operation.

Parameters:

enable

true will enable Color Anti-Aliasing operation, false will disable it.

bool GetEnableLinearPath() const

Get EnableLinearPath setting. See also description of SetEnableLinearPath.

ConvertConfig SetEnableLinearPath(const bool enable)

Set EnableLinearPath setting. This setting is used to disable most of the processing steps to make sure that the debayering of the image into rgb domain is done only using a simple linear mapping enabling only the minimum needed processing.

Parameters:

enable

it can be set to true or false. False is the default value.

ConvertConfig SetLinearPathType(const LinearPathType type)

Set LinearPathType setting. This setting is used in combination with SetEnableLinearPath(bool enable). It defines the type of linear path.

Parameters:

type

is the type of the linear path. The user can select between two types. a normal linear path, or a special version where gamma curve is still used.

LinearPathType GetLinearPathType() const

Get the type of linear path used if lienar path is selected. See also SetLinearPathType and SetEnableLinearPath.

ConvertConfig SetFilmCurve(char* filename)

Set the filename that must be the full path to a file containing a filmcurve to be used for the processing. It will disable the default filmcurve if the file is valid it can be used to enhance the colors to different purposes. The filmcurve files are similar to the ones used by Capture One.

Parameters:

filename

is a fullpath to the requested filmcurve.

std::string GetFilmCurve()

Get the filename to a requested filmcurve. if it is not set an empty string is returned.

ConvertConfig SetIccProfile(char* filename)

Set the filename that must be the full path to a file containing an icc profile to be used for the processing. It will disable the default sensor profile if the file is valid it can be used to enhance the colors. The icc profiles files are similar to the ones used by Capture One. But it should also be possible to create user defined profiles. NB! only a subset of the icc profile standard is implemented.

Parameters:

filename

is a fullpath to the requested icc profile.

std::string GetIccProfile()

Get the filename to a requested icc profile. if it is not set an empty string is returned.

ConvertConfig SetAutoExposureEnabled(bool state)

Set if autoexposure should be enabled or disabled (default). If autoexposure is enabled the processing will try to control the exposure to be neutral exposed. this function does not work well together with usergain and exposure control in convert config. The function does not take additional time in the processing, so it can be good to use if the user in a simple way wants to get well exposed images.

Parameters:

enable

true will enable Autoexposure operation, false will disable it.

bool GetAutoExposureEnabled()

Get the value of autoexposure enable state.

BitmapImage ApplyTo(
    const RawImage& image,
    double& outputFocalLength,
    BitmapImage* mask = nullptr,
    bool waitForBusySDK = false
    )

Apply your current configuration to a RawImage.

BitmapImage ApplyTo(
    const RawImage& image,
    BitmapImage* mask = nullptr,
    bool waitForBusySDK = false
    )

Apply your current configuration to a RawImage.

void SaveToFile(const char* filename) const

Store the configuration into a formatted file.

Parameters:

filename

the full path of the output

Throws

an SDKException in case of failure (eg. failed to write to file)

std::string Serialize() const

Converts the object into a JSON formatted string.

Parameters:

Throws

an SDKException in case of failure (eg. failed to write to file)

Returns:

A string which contains the JSON representation of the object

static ConvertConfig LoadFromFile(const char* filename)

Creates a configuration from a formatted file.

Parameters:

filename

the full path of the input

Throws

an SDKException in case of failure (eg. failed to read from file, the file was malformed)

Returns:

A smart pointer to a newly created ConvertConfig object

static ConvertConfig Deserialize(const std::string serializedData)

Creates a configuration from a formatted JSON string.

Parameters:

serializedData

a formatted JSON string

Throws

an SDKException in case of failure (eg. the JSON string was malformed)

Returns:

A smart pointer to a newly created ConvertConfig object

static std::vector<float> DiscretizeCurve(
    const std::vector<Point2D>& points,
    unsigned int bits
    )

Returns a list of ‘Y’ values of the Curve defined by the input Points. This is applicable for the RGB/LumaCurve)

Parameters:

points

the list of points defining the Curve, X and Y value must be in between 0 and 1

bits

The resolution of the return value. Valid range: [0,12]

Throws

an SDKException in case of failure (eg. input point list has less than two points)

Returns:

A vector of the Y values of the evenly distributed between the two end points of the range [0, 1)