mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 13:04:05 -08:00
Issue 488
git-svn-id: https://zxing.googlecode.com/svn/trunk@1503 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
4f4aea47ca
commit
249d75b2e8
|
@ -39,17 +39,17 @@ public:
|
|||
ClosestToAverageComparator(float averageModuleSize) :
|
||||
averageModuleSize_(averageModuleSize) {
|
||||
}
|
||||
int operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
||||
bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
||||
float dA = abs(a->getEstimatedModuleSize() - averageModuleSize_);
|
||||
float dB = abs(b->getEstimatedModuleSize() - averageModuleSize_);
|
||||
return dA < dB ? -1 : dA > dB ? 1 : 0;
|
||||
return dA < dB;
|
||||
}
|
||||
};
|
||||
|
||||
class CenterComparator {
|
||||
public:
|
||||
int operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
||||
return b->getCount() - a->getCount();
|
||||
bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
|
||||
return a->getCount() < b->getCount();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue