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> 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; 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 ); std::vector<float> GetPolynomialTransformation(); 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() 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 amount, float radius, float threshold, float haloSuppressionAmount ); float GetLuminanceNoiseReductionAmount() const; ConvertConfig SetLuminanceNoiseReductionAmount(const float luminanceNoiseReductionAmount); bool GetNoiseReductionSinglePixelEnabled() const; ConvertConfig SetNoiseReductionSinglePixelEnabled(const bool noiseReductionSinglePixelEnabled); float GetColorNoiseReductionAmount() const; ConvertConfig SetColorNoiseReductionAmount(const float colorNoiseReductionAmount); 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); 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 SetExposureMaskThreadhold( float underExposeThreshold, float overExposeThreadhold ); bool GetClipWarningMaskEnabled() const; ConvertConfig SetClipWarningMaskEnabled(bool enable); int GetMaskThresholdClipWarningCount() const; ConvertConfig SetMaskThresholdClipWarningCount(int thresholdCount); bool GetEnableLinearPath() const; ConvertConfig SetEnableLinearPath(const bool enable); 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.
Minimum: 0
Maximum: 1.0
Default: 0.0
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.
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)
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].
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 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 amount, float radius, float threshold, float haloSuppressionAmount )
Adjust the amount of sharpening of the image.
Parameters:
sharpeningAmount |
is a value between 0.0 and 10.0. Default is 0.0 |
amount |
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 |
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
Sets 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. |
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:
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) |
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:
see |
WhiteBalanceMode for available modes. |
bool GetGeometricCorrectionEnabled() const
Returns a Boolean value indicating if the conversion will include Geometric Aberration correction.
ConvertConfig SetGeometricCorrectionEnabled(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() 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 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. 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 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 = 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)