src/sampler.cc
branchpyrit
changeset 88 f7edb3b90816
parent 87 1081e3dd3f3e
child 92 9af5c039b678
--- a/src/sampler.cc	Sun Apr 27 22:55:17 2008 +0200
+++ b/src/sampler.cc	Mon Apr 28 11:44:11 2008 +0200
@@ -39,6 +39,9 @@
 {
 	static const int gridsamples[] = {1,5,9,16};
 	const int samples = gridsamples[oversample];
+	const int &w = pixmap.getWidth(), &h = pixmap.getHeight();
+	Float *&buffer = pixmap.getFloatData();
+
 	if ( phase == 0 )
 	{
 		if (subsample > 1)
@@ -141,6 +144,9 @@
 
 bool DefaultSampler::nextSample(Sample* s)
 {
+	const int &w = pixmap.getWidth(), &h = pixmap.getHeight();
+	Float *&buffer = pixmap.getFloatData();
+
 	if (phase == 1)
 	{
 		// subsampling
@@ -268,7 +274,8 @@
 
 void DefaultSampler::saveSample(Sample &samp, Colour &col)
 {
-	Float *buf = buffer + 3*(samp.sy * w + samp.sx);
+	Float *buf = pixmap.getFloatData()
+		+ 3*(samp.sy * pixmap.getWidth() + samp.sx);
 	if (phase == 2 && oversample)
 	{
 		*(buf+0) += col.r;