Issue 488

git-svn-id: https://zxing.googlecode.com/svn/trunk@1503 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2010-08-02 10:57:11 +00:00
parent 4f4aea47ca
commit 249d75b2e8

View file

@ -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();
}
};