00001 /*************************************************************************** 00002 * Copyright (C) 1998-2007 by authors (see AUTHORS.txt ) * 00003 * * 00004 * This file is part of Lux Renderer. * 00005 * * 00006 * Lux Renderer is free software; you can redistribute it and/or modify * 00007 * it under the terms of the GNU General Public License as published by * 00008 * the Free Software Foundation; either version 3 of the License, or * 00009 * (at your option) any later version. * 00010 * * 00011 * Lux Renderer is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00018 * * 00019 * This project is based on PBRT ; see http://www.pbrt.org * 00020 * Lux Renderer website : http://www.luxrender.org * 00021 ***************************************************************************/ 00022 00023 // NOTE - Radiance - currently disabled due to reimplementation of pixelsampling, will fix 00024 00025 /* 00026 // bestcandidate.cpp* 00027 #include "sampling.h" 00028 #include "paramset.h" 00029 #include "film.h" 00030 // BestCandidate Sampling Constants 00031 #define SQRT_SAMPLE_TABLE_SIZE 64 00032 #define SAMPLE_TABLE_SIZE (SQRT_SAMPLE_TABLE_SIZE * \ 00033 SQRT_SAMPLE_TABLE_SIZE) 00034 // BestCandidateSampler Declarations 00035 class BestCandidateSampler : public Sampler { 00036 public: 00037 // BestCandidateSampler Public Methods 00038 BestCandidateSampler(int xstart, int xend, 00039 int ystart, int yend, 00040 int pixelsamples); 00041 ~BestCandidateSampler() { 00042 delete[] strat2D; 00043 // so we leak on the individual elements of these arrays. so it goes... 00044 delete[] oneDSamples; 00045 delete[] twoDSamples; 00046 } 00047 int RoundSize(int size) const { 00048 int root = Ceil2Int(sqrtf((float)size - .5f)); 00049 return root*root; 00050 } 00051 bool GetNextSample(Sample *sample, u_int *use_pos); 00052 virtual BestCandidateSampler* clone() const; // Lux (copy) constructor for multithreading 00053 00054 static Sampler *CreateSampler(const ParamSet ¶ms, const Film *film); 00055 private: 00056 // BestCandidateSampler Private Data 00057 int tableOffset; 00058 float xTableCorner, yTableCorner, tableWidth; 00059 static const float sampleTable[SAMPLE_TABLE_SIZE][5]; 00060 float **oneDSamples, **twoDSamples; 00061 int *strat2D; 00062 float sampleOffsets[3]; 00063 }; 00064 */