Exemplo n.º 1
0
int LDSampler::GetMoreSamples(Sample *samples) {
    if (yPos == yPixelEnd) return 0;
    if (sampleBuf == NULL)
        sampleBuf = new float[LDPixelSampleFloatsNeeded(samples, pixelSamples)];
    LDPixelSample(xPos, yPos, shutterOpen, shutterClose,
                  pixelSamples, samples, sampleBuf);
    if (++xPos == xPixelEnd) {
        xPos = xPixelStart;
        ++yPos;
    }
    return pixelSamples;
}
Exemplo n.º 2
0
int AdaptiveSampler::GetMoreSamples(Sample *samples, RNG &rng) {
    if (!sampleBuf)
        sampleBuf = new float[LDPixelSampleFloatsNeeded(samples,
                                                        maxSamples)];
    if (supersamplePixel) {
        LDPixelSample(xPos, yPos, shutterOpen, shutterClose, maxSamples,
                      samples, sampleBuf, rng);
        return maxSamples;
    }
    else {
        if (yPos == yPixelEnd) return 0;
        LDPixelSample(xPos, yPos, shutterOpen, shutterClose, minSamples,
                      samples, sampleBuf, rng);
        return minSamples;
    }
}