r259: MSVC modifications
[ctsim.git] / src / views.cpp
index 8ceaf03501b79bd47e73e223d02ef27aa1b10c61..e94ca255c4563dd440d1419f2bdc099160292f5c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.23 2000/10/11 08:16:08 kevin Exp $
+**  $Id: views.cpp,v 1.24 2000/12/16 03:29:02 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -96,7 +96,7 @@ ImageFileCanvas::OnMouseEvent(wxMouseEvent& event)
        int nx = rIF.nx();
        int ny = rIF.ny();
 
-       if (pt.x >= 0 && pt.x < nx && pt.y >= 0 & pt.y < ny) {
+       if (pt.x >= 0 && pt.x < nx && pt.y >= 0 && pt.y < ny) {
          ostringstream os;
          os << "Image value (" << pt.x << "," << pt.y << ") = " << v[pt.x][ny - 1 - pt.y] << "\n";
            *theApp->getLog() << os.str().c_str();
@@ -912,13 +912,13 @@ ProjectionFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)
 
        unsigned char* imageData = new unsigned char [nDet * nView * 3];
        double scale = (max - min) / 255;
-       for (int iy = 0; iy < nView; iy++) {
-           const DetectorArray& detarray = rProj.getDetectorArray(iy);
+       for (int iy2 = 0; iy2 < nView; iy2++) {
+           const DetectorArray& detarray = rProj.getDetectorArray (iy2);
            const DetectorValue* detval = detarray.detValues();
            for (int ix = 0; ix < nDet; ix++) {
                int intensity = static_cast<int>(((detval[ix] - min) / scale) + 0.5);
                intensity = clamp(intensity, 0, 255);
-               int baseAddr = (iy * nDet + ix) * 3;
+               int baseAddr = (iy2 * nDet + ix) * 3;
                imageData[baseAddr] = imageData[baseAddr+1] = imageData[baseAddr+2] = intensity;
            }
        }