comparison layer/Colour3DPlotLayer.cpp @ 537:0cc658fe1423

* Fix colour 3d plot's habit of repeating column 0 in column -1's position
author Chris Cannam
date Fri, 05 Jun 2009 10:48:25 +0000
parents aca01b3af29f
children be5c35d3f409
comparison
equal deleted inserted replaced
536:aca01b3af29f 537:0cc658fe1423
1408 for (int x = 0; x < w; ++x) { 1408 for (int x = 0; x < w; ++x) {
1409 1409
1410 targetLine[x] = 0; 1410 targetLine[x] = 0;
1411 1411
1412 float sx0 = sxa[x*2]; 1412 float sx0 = sxa[x*2];
1413 if (sx0 < 0) continue;
1413 int sx0i = int(sx0 + epsilon); 1414 int sx0i = int(sx0 + epsilon);
1414 if (sx0i >= sw) break; 1415 if (sx0i >= sw) break;
1415 if (sx0i < 0) continue;
1416 1416
1417 float a, b, value; 1417 float a, b, value;
1418 1418
1419 float sx1 = sxa[x*2+1]; 1419 float sx1 = sxa[x*2+1];
1420 if (sx1 > sx0 + 1.f) { 1420 if (sx1 > sx0 + 1.f) {
1486 1486
1487 uchar *sourceLine = source->scanLine(sy); 1487 uchar *sourceLine = source->scanLine(sy);
1488 1488
1489 for (int x = 0; x < w; ++x) { 1489 for (int x = 0; x < w; ++x) {
1490 1490
1491 int sx1i = int(sxa[x*2 + 1]); 1491 float sx1 = sxa[x*2 + 1];
1492 if (sx1i < 0) continue; 1492 if (sx1 < 0) continue;
1493 1493 int sx1i = int(sx1);
1494 int sx0i = int(sxa[x*2] + epsilon); 1494
1495 float sx0 = sxa[x*2];
1496 if (sx0 < 0) continue;
1497 int sx0i = int(sx0 + epsilon);
1495 if (sx0i >= sw) break; 1498 if (sx0i >= sw) break;
1496 1499
1497 uchar peak = 0; 1500 uchar peak = 0;
1498 for (int sx = sx0i; sx <= sx1i; ++sx) { 1501 for (int sx = sx0i; sx <= sx1i; ++sx) {
1499 if (sx < 0 || sx >= sw) continue; 1502 if (sx < 0 || sx >= sw) continue;