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:
ralf.kistner@gmail.com 2009-12-09 11:06:01 +00:00
parent 5472325ffe
commit a1083bebd4
4 changed files with 530 additions and 524 deletions

View file

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

View file

@ -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,

View file

@ -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;