#ifndef rdo_synthesis_basis_H #define rdo_synthesis_basis_H /* Tools for image synthesis that require an approx basis. */ #define rdo_synthesis_basis_H_COPYRIGHT "Copyright © 2008 Danillo Pereira and J. Stolfi, UNICAMP" /* Last edited on 2024-12-21 11:51:00 by stolfi */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void rdo_synthesis_basis_coeffs_from_site_radiances ( double B[], int n_smp, dspmat_t *M, double L[], int n_bas ); /* Given the radiances {B[0..nB-1]} at the sampling sites {smp[0..nB-1]}, computes the coeffcients {L[0..nL-1]} of the approximation basis {bas[0..nL-1]} such that the approximation interpolates those values; i.e., such that {B[i] == SUM{ bas[j](smp[i]) * L[j] : j \in 0..nL - 1}} for all {i}. Requires the /basis matrix/ {M}, such that {M[i,j] == bas[j](smp[i])}. Uses {rdo_linalg_solve_system} with parameters {max_iter,omega,abs_tol,rel_tol}. Requires {nB == nL == M->rows == M->cols}, and that the matrix {M} be sorted by rows. */ void rdo_synthesis_basis_compute_image ( scene_t *scn, point3_t *eye, dist_type_t tpDist, basis_elem_type_t tpElem, sampling_options_t *opSmp, approx_basis_options_t *opBas, dspmat_t *M, dspmat_t *T, synthesis_options_t *opSyn, int channel, site_vec_t *pix, dspmat_t *Q, double F[] ); /* Assumes that {pix.e[0..pix.ne-1]} are the sites on the surface of scene {scn} that are visible at certain points of some image. Stores into {F[0..pix->ne-1]} the radiances of those sites, computed according to the parameters {tpDist,opSyn}. This function is appropriate for an image type that requires site samples and/or an approximation basis of type {tpElem}. If the site samples {scn->smp} are not available, chooses them with the parameters {eye,tpDist,opSmp}. If the basis {scn->bas} is null, creates it using the parameters {tpDist,tpElem,opBas}. */ #endif