3 #include "reader_2d_config_base.hpp" 11 using namespace Internal;
46 if(formats_ != formats)
70 if(minSize < MinSizeLimit_ ||
73 if(minSize_ != minSize)
75 minSize_ = static_cast<short>(minSize);
86 return static_cast<int>(minSize_);
98 if(maxSize < minSize_ ||
99 maxSize > MaxSizeLimit_)
101 if(maxSize_ != maxSize)
103 maxSize_ = static_cast<short>(maxSize);
114 return static_cast<int>(maxSize_);
126 rectangular_ = rectangular;
153 distorted_ = distorted;
176 if(subType_ != subType)
201 if(pharmaCode2DBar1_ != pharmaCode2DBar1)
203 pharmaCode2DBar1_ = pharmaCode2DBar1;
214 return pharmaCode2DBar1_;
226 if(pharmaCode2DBar2_ != pharmaCode2DBar2)
228 pharmaCode2DBar2_ = pharmaCode2DBar2;
239 return pharmaCode2DBar2_;
251 if(pharmaCode2DBar3_ != pharmaCode2DBar3)
253 pharmaCode2DBar3_ = pharmaCode2DBar3;
264 return pharmaCode2DBar3_;
276 if(pharmaCode2DBar4_ != pharmaCode2DBar4)
278 pharmaCode2DBar4_ = pharmaCode2DBar4;
289 return pharmaCode2DBar4_;
301 if(pharmaCode2DBar5_ != pharmaCode2DBar5)
303 pharmaCode2DBar5_ = pharmaCode2DBar5;
314 return pharmaCode2DBar5_;
326 if(pharmaCode2DBar6_ != pharmaCode2DBar6)
328 pharmaCode2DBar6_ = pharmaCode2DBar6;
339 return pharmaCode2DBar6_;
351 if(pharmaCode2DBar7_ != pharmaCode2DBar7)
353 pharmaCode2DBar7_ = pharmaCode2DBar7;
364 return pharmaCode2DBar7_;
376 if(pharmaCode2DBar8_ != pharmaCode2DBar8)
378 pharmaCode2DBar8_ = pharmaCode2DBar8;
389 return pharmaCode2DBar8_;
404 if(threshold_ != threshold)
406 threshold_ = static_cast<short>(threshold);
417 return static_cast<int>(threshold_);
430 expanded_ = expanded;
453 if(contrast < MinDottedContrastLimit_ ||
454 contrast > MaxDottedContrastLimit_)
456 if(contrast_ != contrast)
458 contrast_ = static_cast<short>(contrast);
469 return static_cast<int>(contrast_);
481 if(moduleWidth < MinDottedModuleWidthLimit_ ||
482 moduleWidth > MaxDottedModuleWidthLimit_)
484 if(moduleWidth_ != moduleWidth)
486 moduleWidth_ = static_cast<short>(moduleWidth);
497 return static_cast<int>(moduleWidth_);
509 if(quietzone < MinDottedQuietZoneWidthLimit_ ||
510 quietzone > MaxDottedQuietZoneWidthLimit_)
512 if(quietzone_ != quietzone)
514 quietzone_ = static_cast<short>(quietzone);
525 return static_cast<int>(quietzone_);
533 SmartBool rectangular_;
534 SmartBool distorted_;
554 const short MinSizeLimit_ = 7;
557 const short MaxSizeLimit_ = 144;
560 const short MinDottedContrastLimit_ = 10;
563 const short MaxDottedContrastLimit_ = 100;
566 const short MinDottedModuleWidthLimit_ = 30;
569 const short MaxDottedModuleWidthLimit_ = 150;
572 const short MinDottedQuietZoneWidthLimit_ = 3;
575 const short MaxDottedQuietZoneWidthLimit_ = 5;
591 isActiveOut = pConfig->ReadFromHandle(guard);
596 virtual bool ReadFromHandle_(
const HandleGuard<ReaderConfig>& guard)
override 598 unsigned short tmpLevels;
599 unsigned short tmpFormats;
610 CVB_CALL_CAPI(CvcBcGetDataMatrixEx(reinterpret_cast<std::intptr_t>(guard.Handle()),
634 levels_ = static_cast<DataMatrixLevels>(tmpLevels);
635 formats_ = static_cast<DataMatrixFormats>(tmpFormats);
636 subType_ = static_cast<DataMatrixSubType>(tmpSubType);
637 pharmaCode2DBar1_ = static_cast<PharmaCode2DDisposition>(tmpBar1);
638 pharmaCode2DBar2_ = static_cast<PharmaCode2DDisposition>(tmpBar2);
639 pharmaCode2DBar3_ = static_cast<PharmaCode2DDisposition>(tmpBar3);
640 pharmaCode2DBar4_ = static_cast<PharmaCode2DDisposition>(tmpBar4);
641 pharmaCode2DBar5_ = static_cast<PharmaCode2DDisposition>(tmpBar5);
642 pharmaCode2DBar6_ = static_cast<PharmaCode2DDisposition>(tmpBar6);
643 pharmaCode2DBar7_ = static_cast<PharmaCode2DDisposition>(tmpBar7);
644 pharmaCode2DBar8_ = static_cast<PharmaCode2DDisposition>(tmpBar8);
645 return tmpLevels != 0;
648 virtual void WriteToHandle_(
bool active, HandleGuard<ReaderConfig>& guard)
override 651 levels_ = static_cast<DataMatrixLevels>(0);
652 Internal::DoResCall([&]()
654 return CVB_CALL_CAPI(CvcBcSetDataMatrixEx(reinterpret_cast<std::intptr_t>(guard.Handle()),
655 static_cast<unsigned short>(levels_),
656 static_cast<unsigned short>(formats_),
663 static_cast<short>(subType_),
664 static_cast<short>(pharmaCode2DBar1_),
665 static_cast<short>(pharmaCode2DBar2_),
666 static_cast<short>(pharmaCode2DBar3_),
667 static_cast<short>(pharmaCode2DBar4_),
668 static_cast<short>(pharmaCode2DBar5_),
669 static_cast<short>(pharmaCode2DBar6_),
670 static_cast<short>(pharmaCode2DBar7_),
671 static_cast<short>(pharmaCode2DBar8_),
682 : Reader2DConfigBase()
void SetDottedModuleWidth(int moduleWidth)
The module width of the code (only dotted Data Matrix).
Definition: data_matrix.hpp:479
PharmaCode2DDisposition PharmaCode2DBar2() const
Returns the proofing of the color bar of field 2 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:237
int DottedContrast() const
Returns the minimal contrast value of the code (only dotted Data Matrix).
Definition: data_matrix.hpp:467
void SetPharmaCode2DBar8(PharmaCode2DDisposition pharmaCode2DBar8)
Proofing of the color bar of field 8 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:374
int DottedModuleWidth() const
Returns the module width of the code (only dotted Data Matrix).
Definition: data_matrix.hpp:495
Configuration to access parameters of Reader2DConfigBase.
Definition: reader_2d_config_base.hpp:18
void SetPharmaCode2DBar1(PharmaCode2DDisposition pharmaCode2DBar1)
Proofing of the color bar of field 1 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:199
void SetPharmaCode2DBar2(PharmaCode2DDisposition pharmaCode2DBar2)
Proofing of the color bar of field 2 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:224
int MinSize() const
Returns the minimum number of lines and columns.
Definition: data_matrix.hpp:84
void SetMinSize(int minSize)
Minimum number of lines and columns.
Definition: data_matrix.hpp:68
void SetPharmaCode2DBar7(PharmaCode2DDisposition pharmaCode2DBar7)
Proofing of the color bar of field 7 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:349
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:96
virtual Symbology Type() const override
Symbology of configuration object.
Definition: data_matrix.hpp:579
void SetPharmaCode2DBar6(PharmaCode2DDisposition pharmaCode2DBar6)
Proofing of the color bar of field 6 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:324
PharmaCode2DDisposition PharmaCode2DBar6() const
Returns the proofing of the color bar of field 6 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:337
bool PharmaCode2DExpanded() const
Returns whether the code is expanded or not(only for 2D Pharmacode).
Definition: data_matrix.hpp:439
void SetLevels(DataMatrixLevels levels)
Bit field which specifies the permitted error correction level (ECCs).
Definition: data_matrix.hpp:26
void SetFormats(DataMatrixFormats formats)
Bit field which specifies the permitted coding schemes (also known as format IDs) (only for ECC 000 t...
Definition: data_matrix.hpp:44
Root namespace for the Image Manager interface.
Definition: version.hpp:11
PharmaCode2DDisposition PharmaCode2DBar8() const
Returns the proofing of the color bar of field 8 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:387
void SetPharmaCode2DExpanded(bool expanded)
Specifies whether the code is expanded or not(only for 2D Pharmacode).
Definition: data_matrix.hpp:427
bool AllowDistorted() const
Returns whether the code is distorted (no effect with dotted Data Matrix).
Definition: data_matrix.hpp:162
DataMatrixSubType
Sub types of data matrix codes to read.
Definition: barcode.hpp:333
Configuration to access parameters of DataMatrix.
Definition: data_matrix.hpp:17
PharmaCode2DDisposition PharmaCode2DBar7() const
Returns the proofing of the color bar of field 7 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:362
void SetAllowRectangular(bool rectangular)
Permit/do not permit rectangular Data Matrix.
Definition: data_matrix.hpp:123
void SetAllowDistorted(bool distorted)
Code is distorted (no effect with dotted Data Matrix).
Definition: data_matrix.hpp:150
DataMatrixFormats Formats() const
Bit field which specifies the permitted coding schemes (also known as format IDs) (only for ECC 000 t...
Definition: data_matrix.hpp:57
bool AllowRectangular() const
Returns whether to permit/not permit rectangular Data Matrix.
Definition: data_matrix.hpp:135
PharmaCode2DDisposition PharmaCode2DBar4() const
Returns the proofing of the color bar of field 4 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:287
DataMatrixSubType SubType() const
Returns the evaluate characteristics of the Data Matrix code (DataMatrixSubType::DataMatrix,...
Definition: data_matrix.hpp:187
void SetPharmaCode2DBar3(PharmaCode2DDisposition pharmaCode2DBar3)
Proofing of the color bar of field 3 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:249
static std::unique_ptr< DataMatrix > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: data_matrix.hpp:588
PharmaCode2DDisposition PharmaCode2DBar1() const
Returns the proofing of the color bar of field 1 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:212
int MaxSize() const
Returns the maximum number of lines and columns.
Definition: data_matrix.hpp:112
DataMatrixLevels
Levels of DataMatrix codes to recognize. Different levels may be combined using '|'.
Definition: barcode.hpp:294
void SetPharmaCode2DThreshold(int threshold)
Minimum digitalisation threshold of the colour bars in percent (only for 2D Pharmacode) ranging from ...
Definition: data_matrix.hpp:399
void SetDottedQuietzoneWidth(int quietzone)
Quiet zone around the code (only dotted Data Matrix).
Definition: data_matrix.hpp:507
void SetMaxSize(int maxSize)
Maximum number of lines and columns.
Definition: data_matrix.hpp:96
PharmaCode2DDisposition PharmaCode2DBar5() const
Returns the proofing of the color bar of field 5 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:312
PharmaCode2DDisposition
Expectation setting for Pharma Code 2D elements.
Definition: barcode.hpp:359
int DottedQuietzoneWidth() const
Returns the quiet zone around the code (only dotted Data Matrix).
Definition: data_matrix.hpp:523
void SetSubType(DataMatrixSubType subType)
Distinguish between evaluate characteristics of the Data Matrix code (DataMatrixSubType::DataMatrix,...
Definition: data_matrix.hpp:174
int PharmaCode2DThreshold() const
Returns the minimum digitalisation threshold of the colour bars in percent (only for 2D Pharmacode) r...
Definition: data_matrix.hpp:415
DataMatrixFormats
Formats of DataMatrix codes to recognize. Different formats may be combined using '|'.
Definition: barcode.hpp:314
void SetDottedContrast(int contrast)
Minimal contrast value of the code (only dotted Data Matrix).
Definition: data_matrix.hpp:451
void SetPharmaCode2DBar5(PharmaCode2DDisposition pharmaCode2DBar5)
Proofing of the color bar of field 5 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:299
void SetPharmaCode2DBar4(PharmaCode2DDisposition pharmaCode2DBar4)
Proofing of the color bar of field 4 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:274
PharmaCode2DDisposition PharmaCode2DBar3() const
Returns the proofing of the color bar of field 3 on square or rectangular (2D Pharma Codes only)
Definition: data_matrix.hpp:262