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
- float MinModuleSize = 4 - Minimal size of a module in pixels
- float MaxModuleSize = 40 - Maximal size of a module in pixels
- DataMatrixGapSize ExpectedGapSize = Small - Highest distance between neighboring marks in the Finder Pattern
- float MaxRectangleRatio = 4.0f - Length ratio between the longer and the shorter side of the code's bounding rectangle
- float 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;
float MinModuleSize;
float MaxModuleSize;
DataMatrixGapSize ExpectedGapSize;
float MaxRectangleRatio;
float MaxSlant;
bool AllowPerspective;
bool AllowOversizedModules;
explicit DataMatrixCodeParams
(
Polarity Polarity_ = Any,
int MinRowCount_ = 8,
int MaxRowCount_ = 32,
int MinColumnCount_ = 8,
int MaxColumnCount_ = 32,
float MinModuleSize_ = 4,
float MaxModuleSize_ = 40,
DataMatrixGapSize ExpectedGapSize_ = Small,
float MaxRectangleRatio_ = 4.0f,
float 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() const { return Polarity; };
int MinRowCount() const { return MinRowCount; };
int MaxRowCount() const { return MaxRowCount; };
int MinColumnCount() const { return MinColumnCount; };
int MaxColumnCount() const { return MaxColumnCount; };
float MinModuleSize() const { return MinModuleSize; };
float MaxModuleSize() const { return MaxModuleSize; };
DataMatrixGapSize ExpectedGapSize() const { return ExpectedGapSize; };
float MaxRectangleRatio() const { return MaxRectangleRatio; };
float MaxSlant() const { return MaxSlant; };
bool AllowPerspective() const { return AllowPerspective; };
bool AllowOversizedModules() 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));
}
};
