#ifndef rdo_synthesis_plain_H #define rdo_synthesis_plain_H /* Tools for image synthesis that do not need an approx basis. */ #define rdo_synthesis_plain_H_COPYRIGHT "Copyright © 2008 Danillo Pereira and J. Stolfi, UNICAMP" /* Last edited on 2024-12-21 11:50:49 by stolfi */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void rdo_synthesis_plain_compute_image ( solid_vec_t *sds, finish_vec_t *fns, camera_t *cam, dist_type_t tpDist, synthesis_options_t *opSyn, int channel, site_vec_t *pix, double F[] ); /* Assumes that {pix.e[0..pix.ne-1]} are a list of sites on the solid objects {sds} that are visible from camera {cam}. Stores into {F[0..pix.ne-1]} the corresponding radiances for the given {channel}, computed according to the parameters {tpDist,opSyn}. This procedure is restricted to images whose type {opSyn->type} does not need an approximation basis. Typically, it means that the radiance of a site depends only on the local surface properties (such as finish, normal, depth, distance, etc.). */ /* SPECIALIZED IMAGE SYNTHESIS FUNCTIONS */ void rdo_synthesis_plain_compute_image_Diffusion ( solid_vec_t *sds, finish_vec_t *fns, int channel, site_vec_t *pix, double F[] ); void rdo_synthesis_plain_compute_image_Emission ( solid_vec_t *sds, finish_vec_t *fns, int channel, site_vec_t *pix, double F[] ); void rdo_synthesis_plain_compute_image_Normal ( int channel, site_vec_t *pix, double F[] ); void rdo_synthesis_plain_compute_image_Quadrants ( solid_vec_t *sds, int channel, site_vec_t *pix, double F[] ); void rdo_synthesis_plain_compute_image_Depth ( solid_vec_t *sds, camera_t *cam, int channel, site_vec_t *pix, double F[] ); /* Fills color band {channel} of {img} with an image that shows the distances from each pixel site to the camera. The sample value is 1.0 if the depth is zero, and decreases to 0.0 as the depth increases to the maximum depth in the scene's bounding box. */ void rdo_synthesis_plain_compute_image_SiteDist ( solid_vec_t *sds, camera_t *cam, int des_pix[], double des_val[], int des_n, dist_type_t tpDist, double crossSize, int channel, site_vec_t *pix, double F[] ); /* Fills color band {channel} of {img} with an image that shows the distances from each pixel site to the pixel sites whose indices are {des_pix[0..des_n-1]}. More precisely, fora each selected pixel site {sd[j] = pix->e[des_pix[j]]} and each image pixel site {pix->e[i]}, the procedure computes a value {v[i,j]}. This value is {des_val[j]} when {i==j} and decreases as the distance between {sd[j]} and {pix->e[i]} increases. The sample value placed into {img} for pixel {i} is the sum of {v[i,j]} for all {j} in {0..des_n-1}. */ #endif