SignDoc SDK (C++)  5.0.0
SignDocCleanParameters Class Reference

Actions and parameters for SignDocImage::clean(). More...

#include <SignDocSDK-cpp.h>

Public Types

enum  Type {
  t_undefined = 0, t_boolean = 1, t_integer = 2, t_number = 3,
  t_void = 7
}
 Return values of getType() and getTypeAt(). More...
 

Public Member Functions

 SignDocCleanParameters ()
 Constructor. More...
 
 SignDocCleanParameters (const SignDocCleanParameters &aSource)
 Copy constructor. More...
 
 ~SignDocCleanParameters ()
 Destructor. More...
 
SignDocCleanParametersoperator= (const SignDocCleanParameters &aSource)
 Assignment operator. More...
 
void swap (SignDocCleanParameters &aOther)
 Efficiently swap this object with another one. More...
 
void clear ()
 Remove all actions. More...
 
ReturnCode add (const std::string &aName)
 Add an action without parameter. More...
 
ReturnCode addBoolean (const std::string &aName, bool aValue)
 Add an action with a boolean parameter. More...
 
ReturnCode addInteger (const std::string &aName, int aValue)
 Add an action with an integer parameter. More...
 
ReturnCode addNumber (const std::string &aName, double aValue)
 Add an action with a floating-point number parameter. More...
 
int getNumberOfActions () const
 Get the number of actions. More...
 
Type getTypeAt (int aIndex) const
 Get the type of the parameter of an action. More...
 
const char * getNameAt (int aIndex) const
 Get the name of an action. More...
 
const int * getBooleanAt (int aIndex) const
 Get the value of a boolean parameter. More...
 
const int * getIntegerAt (int aIndex) const
 Get the value of an integer parameter. More...
 
const double * getNumberAt (int aIndex) const
 Get the value of a floating-point number parameter. More...
 
const char * getErrorMessage (Encoding aEncoding) const
 Get an error message for the last function call. More...
 
const wchar_t * getErrorMessageW () const
 Get an error message for the last function call. More...
 
 SignDocCleanParameters (SIGNDOC_CleanParameters *aP)
 Internal function. More...
 
SIGNDOC_CleanParameters * getImpl ()
 Internal function. More...
 
const SIGNDOC_CleanParameters * getImpl () const
 Internal function. More...
 
void setImpl (SIGNDOC_CleanParameters *aP)
 Internal function. More...
 

Static Public Member Functions

static Type getType (const std::string &aName)
 Get the type of the parameter of an action. More...
 

Detailed Description

Actions and parameters for SignDocImage::clean().

Member Enumeration Documentation

enum Type

Return values of getType() and getTypeAt().

Enumerator
t_undefined 

The specified action is not defined.

t_boolean 

Boolean.

See also
addBoolean()
t_integer 

Integer.

See also
addInteger().
t_number 

Floating-point number.

See also
addNumber()
t_void 

No value.

See also
add()

Constructor & Destructor Documentation

Constructor.

No actions will be set.

SignDocCleanParameters ( const SignDocCleanParameters aSource)
inline

Copy constructor.

Parameters
[in]aSourceThe object to be copied.

Destructor.

SignDocCleanParameters ( SIGNDOC_CleanParameters *  aP)
inline

Internal function.

Member Function Documentation

ReturnCode add ( const std::string &  aName)
inline

Add an action without parameter.

The following actions without parameter are available:

  • cleanDate: Remove handwritten text from the signature image and crop, see SignDocImage::cleanDate(). (Equivalent SPCleanDateEnable parameter: SPCleanDateEnable.)
  • cleanLines: Remove horizontal and vertical lines, see SignDocImage::cleanLines(). (Equivalent SPCleanDateEnable parameter: SPCleanLineEnable.)
  • cleanSignature: Clean signature image and crop, see SignDocImage::cleanSignature(). (Equivalent SPCleanDateEnable parameter: SPCleanSignatureEnable.)
  • convertToBiLevel: Convert the image to bi-level black and white, see SignDocImage::convertToBiLevel(). (Equivalent SPCleanDateEnable parameter: SPBinarizeEnable.)
  • convertToGrayscale: Convert the image to 8-bit grayscale, see SignDocImage::convertToGrayscale().
  • convertToTrueColor: Convert the image to 24-bit RGB, see SignDocImage::convertToTrueColor().
  • crop: Crop the image to the rectangle specified by these actions with integer parameter: "cropLeft", "cropHeight", "cropTop", "cropWidth". Default values will be used for missing parameters. After performing this action, those four parameters will be unset. See SignDocImage::crop(). Example: to remove the top 100 rows of pixels, call addInteger("cropTop",100) followed by add("crop"). (Equivalent SignWare SPCleanParameter parameter: SPCutRegionEnable.)
  • mirrorX: Mirror along the vertical axis (flip horizontally), see SignDocImage::mirrorX(). (Equivalent SPCleanDateEnable parameters: SPMirrorAxes, SPMirrorEnable.)
  • mirrorY: Mirror along the horizontal axis (flip vertically), see SignDocImage::mirrorY(). (Equivalent SPCleanDateEnable parameters: SPMirrorAxes, SPMirrorEnable.)
  • removeMargins: Remove white margins ignoring single black pixels, see SignDocImage::removeMargins(). (Equivalent SPCleanDateEnable parameter: SPCutSignatureRegionEnable.)
Parameters
[in]aNameThe name of the action (case-sensitive).
Returns
ReturnCode::rc_ok iff successful.
See also
addBoolean(), addInteger(), addNumber(), getBooleanAt()
ReturnCode addBoolean ( const std::string &  aName,
bool  aValue 
)
inline

Add an action with a boolean parameter.

The following action with boolean parameter is available:

  • invert: invert the image, see SignDocImage::invert(). The value is false to invert the image unconditionally, true to invert the image only if more than half the pixels have brightness (0 through 255) less than 128. (Equivalent SPCleanDateEnable parameters: SPInvertEnable, SPInvertFlags.)
Parameters
[in]aNameThe name of the action (case-sensitive).
[in]aValueThe value of the parameter.
Returns
ReturnCode::rc_ok iff successful.
See also
add(), addInteger(), addNumber(), getBooleanAt()
ReturnCode addInteger ( const std::string &  aName,
int  aValue 
)
inline

Add an action with an integer parameter.

The following actions with integer parameter are available:

  • cropHeight: set the height of the rectangle that will be preserved by the next "crop" action. The default value is the image height minus the value set by the "cropTop" action (or 0 if not set). (Equivalent SignWare SPCleanParameter parameters: SPCutRegionBottom, SPCutRegionTop.)
  • cropLeft: set the X coordinate of the upper left corner of the rectangle that will be preserved by the next "crop" action. The default value is 0. See Coordinate Systems. (Equivalent SignWare SPCleanParameter parameter: SPCutRegionLeft.)
  • cropTop: set the Y coordinate of the upper left corner of the rectangle that will be preserved by the next "crop" action. The default value is 0. See Coordinate Systems. (Equivalent SignWare SPCleanParameter parameter: SPCutRegionTop.)
  • cropWidth: Set the width of the rectangle that will be preserved by the next "crop" action. The default value is the image width minus the value set by the "cropLeft" action (or 0 if not set). (Equivalent SignWare SPCleanParameter parameters: SPCutRegionLeft, SPCutRegionRight.)
  • rotate: Rotate the image; the value of this action specifies the rotation angle in degreees, positive for counter-clockwise negative for clockwise rotation, see SignDocImage::rotate(). White (or the brightest color in the palette for indexed images) is used as background color. (Equivalent SignWare SPCleanParameter parameters: SPRotateAngle, SPRotateEnable.)
Parameters
[in]aNameThe name of the action (case-sensitive).
[in]aValueThe value of the parameter.
Returns
ReturnCode::rc_ok iff successful.
See also
add(), addBoolean(), addNumber(), getIntegerAt()
ReturnCode addNumber ( const std::string &  aName,
double  aValue 
)
inline

Add an action with a floating-point number parameter.

The following action with a floating-point number parameter is available:

  • cleanFrames: removes all frames that have a weight smaller than aValue (0.0 through 1.0), see SignDocImage::cleanFrames(). (Equivalent SignWare SPCleanParameter parameters: SPCleanFrameEnable, SPCleanFrameTrust.)
Parameters
[in]aNameThe name of the action (case-sensitive).
[in]aValueThe value of the parameter.
Returns
ReturnCode::rc_ok iff successful.
See also
add(), addBoolean(), addInteger(), getNumberAt()
void clear ( )
inline

Remove all actions.

const int * getBooleanAt ( int  aIndex) const
inline

Get the value of a boolean parameter.

This function does not set an error message.

Parameters
[in]aIndexThe zero-based index of the action.
Returns
A pointer to the value of the specified parameter or nullptr if aIndex is out of range or if the specified action does not have a boolean parameter.
See also
addBoolean()
const char * getErrorMessage ( Encoding  aEncoding) const
inline

Get an error message for the last function call.

Parameters
[in]aEncodingThe encoding to be used for the error message.
Returns
A pointer to a string describing the reason for the failure of the last function call. The string is empty if the last call succeeded. The pointer is valid until this object is destroyed or a member function of this object is called.
See also
getErrorMessageW()
const wchar_t * getErrorMessageW ( ) const
inline

Get an error message for the last function call.

Returns
A pointer to a string describing the reason for the failure of the last function call. The string is empty if the last call succeeded. The pointer is valid until this object is destroyed or a member function of this object is called.
See also
getErrorMessage()
SIGNDOC_CleanParameters* getImpl ( )
inline

Internal function.

const SIGNDOC_CleanParameters* getImpl ( ) const
inline

Internal function.

const int * getIntegerAt ( int  aIndex) const
inline

Get the value of an integer parameter.

This function does not set an error message.

Parameters
[in]aIndexThe zero-based index of the action.
Returns
A pointer to the value of the specified parameter or nullptr if aIndex is out of range or if the specified action does not have an integer parameter.
See also
addInteger()
const char * getNameAt ( int  aIndex) const
inline

Get the name of an action.

Parameters
[in]aIndexThe zero-based index of the action.
Returns
The name of the action or nullptr if aIndex is out of range.
See also
getNumberOfActions(), getTypeAt()
const double * getNumberAt ( int  aIndex) const
inline

Get the value of a floating-point number parameter.

This function does not set an error message.

Parameters
[in]aIndexThe zero-based index of the action.
Returns
A pointer to the value of the specified parameter or nullptr if aIndex is out of range or if the specified action does not have a floating-point number parameter.
See also
addNumber()
int getNumberOfActions ( ) const
inline

Get the number of actions.

Returns
The number of actions that have been successfully added.
See also
getBooleanAt(), getIntegerAt(), getNameAt(), getNumberAt(), getTypeAt()
SignDocCleanParameters::Type getType ( const std::string &  aName)
inlinestatic

Get the type of the parameter of an action.

Parameters
[in]aNameThe name of the action (case-sensitive).
Returns
The type of the parameter, see enum Type.
SignDocCleanParameters::Type getTypeAt ( int  aIndex) const
inline

Get the type of the parameter of an action.

Parameters
[in]aIndexThe zero-based index of the action.
Returns
The type of the parameter, see enum Type.
See also
getNumberOfActions(), getType()
SignDocCleanParameters & operator= ( const SignDocCleanParameters aSource)
inline

Assignment operator.

Parameters
[in]aSourceThe source object.
Returns
This object.
void setImpl ( SIGNDOC_CleanParameters *  aP)
inline

Internal function.

void swap ( SignDocCleanParameters aOther)
inline

Efficiently swap this object with another one.

Parameters
[in]aOtherThe other object.

The documentation for this class was generated from the following file: