Skip to content

Commit 558a3ec

Browse files
author
JJPPeters
committed
Fixed tiff export some more
TIFF export wasn't quite fixed. Should work for everything now...
1 parent ab4fda1 commit 558a3ec

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Plotting/imageplot.h

+4-10
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,10 @@ class QCPDataColorMap : public QCPColorMap
4444
// key is x, value is y?
4545
std::vector<double> output(data()->valueSize()*data()->keySize());
4646

47-
auto r1 = data()->keyRange();
48-
auto r2 = data()->valueRange();
49-
50-
int counter = 0;
51-
for (int i = r2.upper; i >= r2.lower; --i)
52-
for (int j = r1.lower; j < r1.upper; ++j)
53-
{
54-
output[ counter ] = data()->data(j, i);
55-
++counter;
56-
}
47+
// the odd indexing is because we need to export the image 'upside down'
48+
for (int i = 0; i < data()->valueSize(); ++i)
49+
for (int j = 0; j < data()->keySize(); ++j)
50+
output[ i*data()->keySize() + j ] = data()->cell(j, data()->valueSize()-1-i);
5751

5852
return output;
5953
}

0 commit comments

Comments
 (0)