src/sampler.cc
branchpyrit
changeset 51 89fec8668768
parent 50 14a727b70d07
child 53 228cb8bfdd54
equal deleted inserted replaced
50:14a727b70d07 51:89fec8668768
    38 {
    38 {
    39 	static const int gridsamples[] = {1,5,9,16};
    39 	static const int gridsamples[] = {1,5,9,16};
    40 	const int samples = gridsamples[oversample];
    40 	const int samples = gridsamples[oversample];
    41 	if ( phase == 0 )
    41 	if ( phase == 0 )
    42 	{
    42 	{
    43 		cout << "phase 1" << endl;
       
    44 		phase++;
    43 		phase++;
    45 		sx = -1;
    44 		sx = -1;
    46 		return w*h*samples;
    45 		return w*h*samples;
    47 	}
    46 	}
    48 	else if ( phase == 1 && oversample )
    47 	else if ( phase == 1 && oversample )
    49 	{
    48 	{
    50 		cout << "phase 2" << endl;
       
    51 		phase = -1;
    49 		phase = -1;
    52 		Float *buf;
    50 		Float *buf;
    53 		for (buf = buffer; buf != buffer + w*h*3; buf++)
    51 		for (buf = buffer; buf != buffer + w*h*3; buf++)
    54 			*buf = *buf * (1.0/samples);
    52 			*buf = *buf * (1.0/samples);
    55 		return 0;
    53 		return 0;