fix wrong abs() call and modernize formatting

git-svn-id: https://zxing.googlecode.com/svn/trunk@2674 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
smparkes@smparkes.net 2013-04-21 20:01:44 +00:00
parent b549267e6f
commit 64a5f4a664

View file

@ -1,3 +1,4 @@
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
/* /*
* Copyright 2011 ZXing authors * Copyright 2011 ZXing authors
* *
@ -14,31 +15,40 @@
* limitations under the License. * limitations under the License.
*/ */
#include <algorithm>
#include <cmath> #include <cmath>
#include <stdlib.h>
#include <zxing/multi/qrcode/detector/MultiFinderPatternFinder.h> #include <zxing/multi/qrcode/detector/MultiFinderPatternFinder.h>
#include <zxing/DecodeHints.h> #include <zxing/DecodeHints.h>
#include <zxing/ReaderException.h> #include <zxing/ReaderException.h>
namespace zxing{ /*
namespace multi { #include <algorithm>
using namespace zxing::qrcode; #include <stdlib.h>
*/
using std::abs;
using zxing::multi::MultiFinderPatternFinder;
using zxing::Ref;
using zxing::qrcode::FinderPattern;
using zxing::qrcode::FinderPatternInfo;
using zxing::ReaderException;
const float MultiFinderPatternFinder::MAX_MODULE_COUNT_PER_EDGE = 180; const float MultiFinderPatternFinder::MAX_MODULE_COUNT_PER_EDGE = 180;
const float MultiFinderPatternFinder::MIN_MODULE_COUNT_PER_EDGE = 9; const float MultiFinderPatternFinder::MIN_MODULE_COUNT_PER_EDGE = 9;
const float MultiFinderPatternFinder::DIFF_MODSIZE_CUTOFF_PERCENT = 0.05f; const float MultiFinderPatternFinder::DIFF_MODSIZE_CUTOFF_PERCENT = 0.05f;
const float MultiFinderPatternFinder::DIFF_MODSIZE_CUTOFF = 0.5f; const float MultiFinderPatternFinder::DIFF_MODSIZE_CUTOFF = 0.5f;
namespace {
bool compareModuleSize(Ref<FinderPattern> a, Ref<FinderPattern> b){ bool compareModuleSize(Ref<FinderPattern> a, Ref<FinderPattern> b){
float value = a->getEstimatedModuleSize() - b->getEstimatedModuleSize(); float value = a->getEstimatedModuleSize() - b->getEstimatedModuleSize();
return value < 0.0; return value < 0.0;
} }
}
MultiFinderPatternFinder::MultiFinderPatternFinder(Ref<BitMatrix> image, MultiFinderPatternFinder::MultiFinderPatternFinder(Ref<BitMatrix> image,
Ref<ResultPointCallback> resultPointCallback) : Ref<ResultPointCallback> resultPointCallback)
FinderPatternFinder(image, resultPointCallback) : FinderPatternFinder(image, resultPointCallback)
{ {
} }
@ -218,6 +228,3 @@ std::vector<std::vector<Ref<FinderPattern> > > MultiFinderPatternFinder::selectB
} }
return results; return results;
} }
} // End zxing::multi namespace
} // End zxing namespace