mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
C++ port: fixed warnings for Symbian build
git-svn-id: https://zxing.googlecode.com/svn/trunk@1145 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
5472325ffe
commit
a1083bebd4
|
@ -37,6 +37,10 @@ Detector::Detector(Ref<BitMatrix> image) :
|
|||
image_(image) {
|
||||
}
|
||||
|
||||
Ref<BitMatrix> Detector::getImage() {
|
||||
return image_;
|
||||
}
|
||||
|
||||
Ref<DetectorResult> Detector::detect() {
|
||||
FinderPatternFinder finder(image_);
|
||||
Ref<FinderPatternInfo> info(finder.find());
|
||||
|
|
|
@ -31,9 +31,11 @@ namespace zxing {
|
|||
namespace qrcode {
|
||||
|
||||
class Detector : public Counted {
|
||||
protected:
|
||||
private:
|
||||
Ref<BitMatrix> image_;
|
||||
|
||||
protected:
|
||||
Ref<BitMatrix> getImage();
|
||||
|
||||
static Ref<BitMatrix> sampleGrid(Ref<BitMatrix> image, int dimension, Ref<PerspectiveTransform>);
|
||||
static int computeDimension(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref<ResultPoint> bottomLeft,
|
||||
|
|
|
@ -49,7 +49,7 @@ Ref<PerspectiveTransform> QREdgeDetector::createTransform(Ref<ResultPoint> topLe
|
|||
ResultPoint > bottomLeft, Ref<ResultPoint> alignmentPattern, int dimension) {
|
||||
|
||||
if(alignmentPattern == NULL) {
|
||||
Point corner = findCorner(*image_.object_, rp(topLeft), rp(topRight), rp(bottomLeft), dimension);
|
||||
Point corner = findCorner(*Detector::getImage(), rp(topLeft), rp(topRight), rp(bottomLeft), dimension);
|
||||
return get1CornerTransform(rp(topLeft), rp(topRight), rp(bottomLeft), corner, dimension);
|
||||
} else {
|
||||
return Detector::createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension);
|
||||
|
@ -108,10 +108,10 @@ Ref<PerspectiveTransform> QREdgeDetector::get1CornerTransform(Point topLeft, Poi
|
|||
|
||||
// Adapted from "sizeOfBlackWhiteBlackRun" in zxing::qrcode::Detector
|
||||
Point QREdgeDetector::endOfReverseBlackWhiteBlackRun(const BitMatrix& image, Point from, Point to) {
|
||||
float fromX = from.x;
|
||||
float fromY = from.y;
|
||||
float toX = to.x;
|
||||
float toY = to.y;
|
||||
int fromX = (int)from.x;
|
||||
int fromY = (int)from.y;
|
||||
int toX = (int)to.x;
|
||||
int toY = (int)to.y;
|
||||
|
||||
bool steep = abs(toY - fromY) > abs(toX - fromX);
|
||||
if (steep) {
|
||||
|
@ -131,8 +131,8 @@ Point QREdgeDetector::endOfReverseBlackWhiteBlackRun(const BitMatrix& image, Poi
|
|||
int state = 0; // In black pixels, looking for white, first or second time
|
||||
|
||||
// In case there are no points, prepopulate to from
|
||||
int realX = from.x;
|
||||
int realY = from.y;
|
||||
int realX = fromX;
|
||||
int realY = fromY;
|
||||
for (int x = fromX, y = fromY; x != toX; x += xstep) {
|
||||
realX = steep ? y : x;
|
||||
realY = steep ? x : y;
|
||||
|
|
Loading…
Reference in a new issue