DataMatrixCodeParams
Description
Specifies range of possible data matrix codes.
Structure fields and default values (if defined) are described below:
- Polarity Polarity = Any - Specifies whether code is darker or brighter than the background
- int MinRowCount = 8 - Minimal number of module rows
- int MaxRowCount = 32 - Maximal number of module rows
- int MinColumnCount = 8 - Minimal number of module columns
- int MaxColumnCount = 32 - Maximal number of module columns
- real MinModuleSize = 4 - Minimal size of a module in pixels
- real MaxModuleSize = 40 - Maximal size of a module in pixels
- DataMatrixGapSize ExpectedGapSize = Small - Highest distance between neighboring marks in the Finder Pattern
- real MaxRectangleRatio = 4.0f - Length ratio between the longer and the shorter side of the code's bounding rectangle
- real MaxSlant = 20.0f - Maximal deviation from the right angle in the corner of the Finder Pattern
- bool AllowPerspective = true - Allows codes with perspective distortion (up to a certain level)
- bool AllowOversizedModules = true - Allows codes with foreground modules overlapping background modules
struct DataMatrixCodeParams
{
Polarity Polarity;
int MinRowCount;
int MaxRowCount;
int MinColumnCount;
int MaxColumnCount;
real MinModuleSize;
real MaxModuleSize;
DataMatrixGapSize ExpectedGapSize;
real MaxRectangleRatio;
real MaxSlant;
bool AllowPerspective;
bool AllowOversizedModules;
explicit DataMatrixCodeParams
(
Polarity Polarity_ = Any,
int MinRowCount_ = 8,
int MaxRowCount_ = 32,
int MinColumnCount_ = 8,
int MaxColumnCount_ = 32,
real MinModuleSize_ = 4,
real MaxModuleSize_ = 40,
DataMatrixGapSize ExpectedGapSize_ = Small,
real MaxRectangleRatio_ = 4.0f,
real MaxSlant_ = 20.0f,
bool AllowPerspective_ = true,
bool AllowOversizedModules_ = true
) :
Polarity(Polarity_),
MinRowCount(MinRowCount_),
MaxRowCount(MaxRowCount_),
MinColumnCount(MinColumnCount_),
MaxColumnCount(MaxColumnCount_),
MinModuleSize(MinModuleSize_),
MaxModuleSize(MaxModuleSize_),
ExpectedGapSize(ExpectedGapSize_),
MaxRectangleRatio(MaxRectangleRatio_),
MaxSlant(MaxSlant_),
AllowPerspective(AllowPerspective_),
AllowOversizedModules(AllowOversizedModules_)
{}
Polarity Polarity( void ) const { return Polarity; };
int MinRowCount( void ) const { return MinRowCount; };
int MaxRowCount( void ) const { return MaxRowCount; };
int MinColumnCount( void ) const { return MinColumnCount; };
int MaxColumnCount( void ) const { return MaxColumnCount; };
real MinModuleSize( void ) const { return MinModuleSize; };
real MaxModuleSize( void ) const { return MaxModuleSize; };
DataMatrixGapSize ExpectedGapSize( void ) const { return ExpectedGapSize; };
real MaxRectangleRatio( void ) const { return MaxRectangleRatio; };
real MaxSlant( void ) const { return MaxSlant; };
bool AllowPerspective( void ) const { return AllowPerspective; };
bool AllowOversizedModules( void ) const { return AllowOversizedModules; };
bool operator == ( const avl::DataMatrixCodeParams& rhs ) const
{
return Polarity == rhs.Polarity &&
MinRowCount == rhs.MinRowCount && MaxRowCount == rhs.MaxRowCount &&
MinColumnCount == rhs.MinColumnCount && MaxColumnCount == rhs.MaxColumnCount &&
MinModuleSize == rhs.MinModuleSize && MaxModuleSize == rhs.MaxModuleSize &&
ExpectedGapSize == rhs.ExpectedGapSize && MaxRectangleRatio == rhs.MaxRectangleRatio &&
MaxSlant == rhs.MaxSlant && AllowPerspective == rhs.AllowPerspective &&
AllowOversizedModules == rhs.AllowOversizedModules;
}
bool operator != ( const avl::DataMatrixCodeParams& rhs ) const
{
return !(operator==(rhs));
}
};
