/**
 * $Id: rayshade.c 18191 2008-12-31 05:08:04Z broken $
 *
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version. 
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * The Original Code is Copyright (C) 1990-1998 NeoGeo BV.
 * All rights reserved.
 *
 * Contributors: 2004/2005 Blender Foundation, Matt Ebb, Brecht van Lommel
 *
 * ***** END GPL LICENSE BLOCK *****
 */

struct Render;
struct QMCSampler;

void QMC_initPixel(QMCSampler *qsa, int thread);

void QMC_samplePhong(float *vec, QMCSampler *qsa, int thread, int num, float blur);
void QMC_sampleRect(float *vec, QMCSampler *qsa, int thread, int num, float sizex, float sizey);
void QMC_sampleDisc(float *vec, QMCSampler *qsa, int thread, int num, float radius);
void QMC_sampleHemi(float *vec, QMCSampler *qsa, int thread, int num);
void QMC_sampleHemiCosine(float *vec, QMCSampler *qsa, int thread, int num);

void init_render_qmcsampler(Render *re);
void free_render_qmcsampler(Render *re);
QMCSampler *get_thread_qmcsampler(Render *re, int thread, int type, int tot);
void release_thread_qmcsampler(Render *re, int thread, QMCSampler *qsa);

void random_sampleRect(float *vec, int thread, float sizex, float sizey);
void random_sampleDisc(float *vec, int thread, float radius);
void random_sampleHemiUniform(float *vec, int thread);
void random_sampleHemiCosine(float *vec, int thread);
void random_sampleSphere(float *vec, int thread);
void random_sampleCone(float *vec, int thread, float max_costheta);

int adaptive_sample_variance(int samples, float *col, float *colsq, float thresh);
int adaptive_sample_contrast_val(int samples, float prev, float val, float thresh);


