Tachyon (current)
Current Main Branch
|
Tachyon cross-platform timers, special math function wrappers, and RNGs. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "tachyon.h"
#include "macros.h"
#include "util.h"
#include "parallel.h"
#include "ui.h"
Go to the source code of this file.
Data Structures | |
struct | rt_timer |
Macros | |
#define | TACHYON_INTERNAL 1 |
#define | STDTIME |
Functions | |
void | rt_finalize (void) |
Shut down Tachyon library for good, at final use before program termination. More... | |
void | rt_timer_start (rt_timerhandle v) |
void | rt_timer_stop (rt_timerhandle v) |
double | rt_timer_time (rt_timerhandle v) |
rt_timerhandle | rt_timer_create (void) |
void | rt_timer_destroy (rt_timerhandle v) |
double | rt_timer_timenow (rt_timerhandle v) |
unsigned int | rt_rand (unsigned int *idum) |
void | rng_urand_init (rng_urand_handle *rngh) |
void | rng_urand_seed (rng_urand_handle *rngh, unsigned int seed) |
unsigned int | rng_urand (rng_urand_handle *rngh) |
void | rng_frand_init (rng_frand_handle *rngh) |
float | rng_frand (rng_frand_handle *rngh) |
void | rng_frand_seed (rng_frand_handle *rngh, unsigned int seed) |
void | rng_drand_init (rng_drand_handle *rngh) |
double | rng_drand (rng_frand_handle *rngh) |
void | rng_drand_seed (rng_frand_handle *rngh, unsigned int seed) |
unsigned int | rng_seed_from_tid_nodeid (int tid, int node) |
unsigned int | tea2 (unsigned int v0, unsigned int v1) |
unsigned int | tea4 (unsigned int v0, unsigned int v1) |
double | compute_goldenratio_phi (int dim) |
float | goldenratioseq1d (int n) |
void | goldenratioseq1d_incr (float *x) |
void | goldenratioseq2d (int n, float *x, float *y) |
void | goldenratioseq2d_incr (float *x, float *y) |
void | goldenratioseq3d (int n, float *x, float *y, float *z) |
void | goldenratioseq3d_incr (float *x, float *y, float *z) |
void | jitter_offset2f (unsigned int *pval, float *xy) |
void | jitter_disc2f (unsigned int *pval, float *dir) |
void | jitter_sphere3f (rng_frand_handle *rngh, float *dir) |
Tachyon cross-platform timers, special math function wrappers, and RNGs.
Definition in file util.c.
void goldenratioseq3d | ( | int | n, |
float * | x, | ||
float * | y, | ||
float * | z | ||
) |
void goldenratioseq3d_incr | ( | float * | x, |
float * | y, | ||
float * | z | ||
) |
void jitter_disc2f | ( | unsigned int * | pval, |
float * | dir | ||
) |
void jitter_offset2f | ( | unsigned int * | pval, |
float * | xy | ||
) |
Definition at line 751 of file util.c.
References rt_rand(), and RT_RAND_MAX_INV.
void jitter_sphere3f | ( | rng_frand_handle * | rngh, |
float * | dir | ||
) |
Definition at line 779 of file util.c.
References rng_frand().
Referenced by shade_ambient_occlusion().
double rng_drand | ( | rng_frand_handle * | rngh | ) |
Definition at line 572 of file util.c.
References rng_urand(), and RT_RNG_MAX.
void rng_drand_init | ( | rng_drand_handle * | rngh | ) |
Definition at line 568 of file util.c.
References rng_urand_init().
void rng_drand_seed | ( | rng_frand_handle * | rngh, |
unsigned int | seed | ||
) |
Definition at line 576 of file util.c.
References rng_urand_seed().
float rng_frand | ( | rng_frand_handle * | rngh | ) |
Definition at line 560 of file util.c.
References rng_urand(), and RT_RNG_MAX.
Referenced by jitter_sphere3f().
void rng_frand_init | ( | rng_frand_handle * | rngh | ) |
void rng_frand_seed | ( | rng_frand_handle * | rngh, |
unsigned int | seed | ||
) |
unsigned int rng_urand | ( | rng_urand_handle * | rngh | ) |
Definition at line 501 of file util.c.
References rng_urand_handle::c, rng_urand_handle::k, rng_urand_handle::m, rng_urand_handle::w, rng_urand_handle::x, rng_urand_handle::y, and rng_urand_handle::z.
Referenced by rng_drand(), and rng_frand().
void rng_urand_init | ( | rng_urand_handle * | rngh | ) |
Definition at line 483 of file util.c.
References rng_urand_handle::c, rng_urand_handle::k, rng_urand_handle::m, rng_urand_handle::w, rng_urand_handle::x, rng_urand_handle::y, and rng_urand_handle::z.
Referenced by rng_drand_init(), and rng_frand_init().
void rng_urand_seed | ( | rng_urand_handle * | rngh, |
unsigned int | seed | ||
) |
Definition at line 493 of file util.c.
References rng_urand_handle::c, rng_urand_handle::w, rng_urand_handle::x, rng_urand_handle::y, and rng_urand_handle::z.
Referenced by rng_drand_seed(), and rng_frand_seed().
void rt_finalize | ( | void | ) |
Shut down Tachyon library for good, at final use before program termination.
Tachyon may not be used after rt_finalize has been called.
Definition at line 153 of file api.c.
References FreeTextures(), global_parhnd, and rt_par_finish().
Referenced by animate_scene(), fly_scene(), and main().
unsigned int rt_rand | ( | unsigned int * | idum | ) |
Definition at line 324 of file util.c.
Referenced by adjust(), InitNoise(), jitter_disc2f(), jitter_offset2f(), rt_landscape(), sky_plane_background_texture(), and sky_sphere_background_texture().
rt_timerhandle rt_timer_create | ( | void | ) |
Definition at line 226 of file util.c.
Referenced by animate_scene(), fly_scene(), main(), rendercheck(), renderio(), and renderscene().
void rt_timer_destroy | ( | rt_timerhandle | v | ) |
Definition at line 233 of file util.c.
Referenced by animate_scene(), fly_scene(), main(), rendercheck(), renderio(), and renderscene().
void rt_timer_start | ( | rt_timerhandle | v | ) |
Definition at line 168 of file util.c.
References rt_timer::tz.
Referenced by animate_scene(), fly_scene(), main(), rendercheck(), renderio(), and renderscene().
void rt_timer_stop | ( | rt_timerhandle | v | ) |
Definition at line 177 of file util.c.
References rt_timer::endtime, and rt_timer::tz.
Referenced by animate_scene(), fly_scene(), main(), rendercheck(), renderio(), renderscene(), and rt_timer_timenow().
double rt_timer_time | ( | rt_timerhandle | v | ) |
Definition at line 186 of file util.c.
References rt_timer::endtime.
Referenced by animate_scene(), fly_scene(), main(), rendercheck(), renderio(), renderscene(), and rt_timer_timenow().
double rt_timer_timenow | ( | rt_timerhandle | v | ) |
Definition at line 237 of file util.c.
References rt_timer_stop(), and rt_timer_time().
unsigned int tea4 | ( | unsigned int | v0, |
unsigned int | v1 | ||
) |
Definition at line 626 of file util.c.
Referenced by sky_plane_background_texture(), sky_sphere_background_texture(), and thread_trace().