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<int> NoiseReductionRadiusRange;
    static const ValueRange<float> WhiteBalanceGainRange;
    static const ValueRange<float> GeometricCorrectionFocalLengthRange;
    static const ValueRange<float> GeometricCorrectionPixelPitchRange;
    static const ValueRange<float> GeometricCorrectionShiftRange;
    static const ValueRange<float> GeometricCorrectionPolinomRange;

    // 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;
    double GetOutputScale() const;
    int32_t GetOutputWidth() const;
    int32_t GetOutputHeight() const;
    BitmapFormat GetOutputFormat() const;
    ConvertConfig SetCrop(int32_t x, int32_t y, int32_t width, int32_t height);
    ConvertConfig SetCrop(const Rect& cropRect);
    ConvertConfig SetOutputScale(double scaleFactor);
    ConvertConfig SetOutputWidth(int32_t destinationWidth);
    ConvertConfig SetOutputHeight(int32_t destinationHeight);
    ConvertConfig SetOutputFormat(BitmapFormat format);
    ConvertConfig SetNoiseModel(float param1, float param2);
    float GetContrast() const;
    ConvertConfig SetContrast(const float contrast);
    float GetBrightness() const;
    ConvertConfig SetBrightness(const float brightness);
    float GetSaturation() const;
    ConvertConfig SetSaturation(const float saturation);
    float GetExposure() const;
    ConvertConfig SetExposure(const float exposure);
    float GetGain() const;
    ConvertConfig SetGain(const float gain);
    Color GetBlackLevel();
    ConvertConfig SetBlackLevel(float r, float g, float b);
    ConvertConfig SetBlackLevel(Color color);
    Color GetMidtoneLevel();
    ConvertConfig SetMidtoneLevel(float r, float g, float b);
    ConvertConfig SetMidtoneLevel(Color color);
    Color GetWhiteLevel();
    ConvertConfig SetWhiteLevel(float r, float g, float b);
    ConvertConfig SetWhiteLevel(Color color);
    ConvertConfig SetBlackLevelTarget(float r, float g, float b);
    ConvertConfig SetWhiteLevelTarget(float r, float g, float b);
    float GetSharpeningAmount();
    ConvertConfig SetSharpeningAmount(float sharpeningAmount);
    int GetNoiseReductionRadiusAmount();
    ConvertConfig SetNoiseReductionRadiusAmount(int noiseReductionRadius);
    Clarity GetClarity();
    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);
    ConvertConfig SetHistogramStage(const int stage);
    const std::vector<Point2D> GetRedCurve();
    ConvertConfig SetRedCurve(const std::vector<Point2D>& points);
    const std::vector<Point2D> GetGreenCurve();
    ConvertConfig SetGreenCurve(const std::vector<Point2D>& points);
    const std::vector<Point2D> GetBlueCurve();
    ConvertConfig SetBlueCurve(const std::vector<Point2D>& points);
    const std::vector<Point2D> GetLumaCurve();
    ConvertConfig SetLumaCurve(const std::vector<Point2D>& points);
    const std::vector<Point2D> GetRgbCurve();
    ConvertConfig SetRgbCurve(const std::vector<Point2D>& points);
    const Color GetWhiteBalanceGain() const;
    ConvertConfig SetWhiteBalanceGain(const Color whiteBalanceGain);
    bool GetGeomerticCorrectionEnabled() const;
    ConvertConfig SetGeomerticCorrectionEnabled(const bool enable);
    const GeometricCorrection GetGeometricCorrection() const;
    ConvertConfig SetGeometricCorrection(const GeometricCorrection geometricCorrection);
    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();
    float GetMaskThresholdUnderExposure();

    ConvertConfig SetExposureMaskThreadhold(
        float underExposeThreshold,
        float overExposeThreadhold
        );

    bool GetClipWarningMaskEnabled() const;
    ConvertConfig SetClipWarningMaskEnabled(bool enable);
    int GetMaskThresholdClipWarningCount();
    ConvertConfig SetMaskThresholdClipWarningCount(int thresholdCount);
    bool GetEnableLinearPath() const;
    ConvertConfig SetEnableLinearPath(const bool enable);

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

    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<int> NoiseReductionRadiusRange

The ValueRange of the NoiseReductionRadius property.

  • Minimum: 0

  • Maximum: 32

  • Default: 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> 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.

  • Minimum: -30.0

  • Maximum: 30.0

  • Default: 0.0

static const ValueRange<float> GeometricCorrectionPolinomRange

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

  • Minimum: -1.0e-4

  • Maximum: 1.0e-4

  • 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.

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.

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 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.

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

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 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()

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()

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 0.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()

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 0.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.

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 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 0.0

float GetSharpeningAmount()

Get the value of the sharpening amount in the convert config. See also SetSharpening function.

ConvertConfig SetSharpeningAmount(float sharpeningAmount)

Adjust the amount of sharpening of the image.

Parameters:

sharpeningAmount

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

int GetNoiseReductionRadiusAmount()

Get the pixel radius used for the Noise Reduction algorithm to sample neighbouring pixels to reduce noise.

ConvertConfig SetNoiseReductionRadiusAmount(int noiseReductionRadius)

Sets the pixel radius used for the Noise Reduction algorithm to reduce noise.

Parameters:

noiseReductionRadius

is a value between 0 and 32. Default is 0.

Clarity GetClarity()

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:

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)

ConvertConfig SetHistogramStage(const int stage)

Request in which stage of the processing pipeline a histogram must be sampled (its mainly used for debugging). Default is to not sample a histogram.

Parameters:

stage

is a value defining the stage in processing where histogram is sampled

const std::vector<Point2D> GetRedCurve()

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

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()

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 std::vector<Point2D> GetBlueCurve()

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 std::vector<Point2D> GetLumaCurve()

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 std::vector<Point2D> GetRgbCurve()

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 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.

bool GetGeomerticCorrectionEnabled() const

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

ConvertConfig SetGeomerticCorrectionEnabled(const bool enable)

Sets the Enabled state of the Geometric Aberration correction.

Parameters:

enable

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

const GeometricCorrection GetGeometricCorrection() const

Custom Geometric Aberration correction parameters.

ConvertConfig SetGeometricCorrection(const GeometricCorrection geometricCorrection)

Sets Geometric Aberration 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 SetExposureMaskThreadhold function)

float GetMaskThresholdOverExposure()

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

float GetMaskThresholdUnderExposure()

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

ConvertConfig SetExposureMaskThreadhold(
    float underExposeThreshold,
    float overExposeThreadhold
    )

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 so it is independend of the bitdepth of the image

overExposeThreshold

is a value between 0.0 and 1.0 so it is independend of the bitdepth of the image

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()

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 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.

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

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)