BRL-CAD
Collaboration diagram for Tabulated Data:

Data Structures

struct  bn_table
 
struct  bn_tabdata
 

Macros

#define BN_CK_TABLE(_p)   BU_CKMAG(_p, BN_TABLE_MAGIC, "bn_table")
 
#define BN_TABLE_NULL   ((struct bn_table *)NULL)
 
#define BN_GET_TABLE(_table, _nx)
 
#define BN_CK_TABDATA(_p)   BU_CKMAG(_p, BN_TABDATA_MAGIC, "bn_tabdata")
 
#define BN_TABDATA_NULL   ((struct bn_tabdata *)NULL)
 
#define BN_SIZEOF_TABDATA_Y(_tabdata)   sizeof(fastf_t)*((_tabdata)->ny)
 
#define BN_SIZEOF_TABDATA(_table)
 
#define BN_GET_TABDATA(_data, _table)
 

Functions

void bn_table_free (struct bn_table *tabp)
 
void bn_tabdata_free (struct bn_tabdata *data)
 
void bn_ck_table (const struct bn_table *tabp)
 
struct bn_tablebn_table_make_uniform (size_t num, double first, double last)
 
void bn_tabdata_add (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2)
 
void bn_tabdata_mul (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2)
 
void bn_tabdata_mul3 (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, const struct bn_tabdata *in3)
 
void bn_tabdata_incr_mul3_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, const struct bn_tabdata *in3, double scale)
 
void bn_tabdata_incr_mul2_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, double scale)
 
void bn_tabdata_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, double scale)
 
void bn_table_scale (struct bn_table *tabp, double scale)
 
void bn_tabdata_join1 (struct bn_tabdata *out, const struct bn_tabdata *in1, double scale, const struct bn_tabdata *in2)
 
void bn_tabdata_join2 (struct bn_tabdata *out, const struct bn_tabdata *in1, double scale2, const struct bn_tabdata *in2, double scale3, const struct bn_tabdata *in3)
 
void bn_tabdata_blend2 (struct bn_tabdata *out, double scale1, const struct bn_tabdata *in1, double scale2, const struct bn_tabdata *in2)
 
void bn_tabdata_blend3 (struct bn_tabdata *out, double scale1, const struct bn_tabdata *in1, double scale2, const struct bn_tabdata *in2, double scale3, const struct bn_tabdata *in3)
 
double bn_tabdata_area1 (const struct bn_tabdata *in)
 
double bn_tabdata_area2 (const struct bn_tabdata *in)
 
double bn_tabdata_mul_area1 (const struct bn_tabdata *in1, const struct bn_tabdata *in2)
 
double bn_tabdata_mul_area2 (const struct bn_tabdata *in1, const struct bn_tabdata *in2)
 
fastf_t bn_table_lin_interp (const struct bn_tabdata *samp, double wl)
 
struct bn_tabdatabn_tabdata_resample_max (const struct bn_table *newtable, const struct bn_tabdata *olddata)
 
struct bn_tabdatabn_tabdata_resample_avg (const struct bn_table *newtable, const struct bn_tabdata *olddata)
 
int bn_table_write (const char *filename, const struct bn_table *tabp)
 
struct bn_tablebn_table_read (const char *filename)
 
void bn_pr_table (const char *title, const struct bn_table *tabp)
 
void bn_pr_tabdata (const char *title, const struct bn_tabdata *data)
 
int bn_print_table_and_tabdata (const char *filename, const struct bn_tabdata *data)
 
struct bn_tabdatabn_read_table_and_tabdata (const char *filename)
 
struct bn_tabdatabn_tabdata_binary_read (const char *filename, size_t num, const struct bn_table *tabp)
 
struct bn_tabdatabn_tabdata_malloc_array (const struct bn_table *tabp, size_t num)
 
void bn_tabdata_copy (struct bn_tabdata *out, const struct bn_tabdata *in)
 
struct bn_tabdatabn_tabdata_dup (const struct bn_tabdata *in)
 
struct bn_tabdatabn_tabdata_get_constval (double val, const struct bn_table *tabp)
 
void bn_tabdata_constval (struct bn_tabdata *data, double val)
 
void bn_tabdata_to_tcl (struct bu_vls *vp, const struct bn_tabdata *data)
 
struct bn_tabdatabn_tabdata_from_array (const double *array)
 
void bn_tabdata_freq_shift (struct bn_tabdata *out, const struct bn_tabdata *in, double offset)
 
int bn_table_interval_num_samples (const struct bn_table *tabp, double low, double hi)
 
int bn_table_delete_sample_pts (struct bn_table *tabp, unsigned int i, unsigned int j)
 
struct bn_tablebn_table_merge2 (const struct bn_table *a, const struct bn_table *b)
 
struct bn_tabdatabn_tabdata_mk_linear_filter (const struct bn_table *spectrum, double lower_wavelen, double upper_wavelen)
 

Detailed Description

Macro Definition Documentation

#define BN_TABLE_NULL   ((struct bn_table *)NULL)

Definition at line 80 of file tabdata.h.

#define BN_GET_TABLE (   _table,
  _nx 
)
Value:
{ \
if ((_nx) < 1) bu_bomb("RT_GET_TABLE() _nx < 1\n"); \
_table = (struct bn_table *)bu_calloc(1, \
sizeof(struct bn_table) + sizeof(fastf_t)*(_nx), \
"struct bn_table"); \
_table->magic = BN_TABLE_MAGIC; \
_table->nx = (_nx); }
if(share_geom)
Definition: nmg_mod.c:3829
void * bu_calloc(size_t nelem, size_t elsize, const char *str)
Definition: malloc.c:321
oldeumate l2 magic
Definition: nmg_mod.c:3843
#define BN_TABLE_MAGIC
Definition: magic.h:73
void bu_bomb(const char *str) _BU_ATTR_NORETURN
Definition: bomb.c:91
double fastf_t
Definition: defines.h:300

Definition at line 84 of file tabdata.h.

Referenced by bn_read_table_and_tabdata(), bn_tabdata_from_array(), bn_table_make_uniform(), bn_table_merge2(), and bn_table_read().

#define BN_TABDATA_NULL   ((struct bn_tabdata *)NULL)

Definition at line 107 of file tabdata.h.

Referenced by light_hit(), phong_render(), and rr_render().

#define BN_SIZEOF_TABDATA_Y (   _tabdata)    sizeof(fastf_t)*((_tabdata)->ny)

Definition at line 109 of file tabdata.h.

Referenced by bn_tabdata_copy(), and bn_tabdata_dup().

#define BN_SIZEOF_TABDATA (   _table)
Value:
(sizeof(struct bn_tabdata) + \
sizeof(fastf_t)*((_table)->nx-1))
double fastf_t
Definition: defines.h:300

Definition at line 110 of file tabdata.h.

Referenced by bn_tabdata_binary_read(), and bn_tabdata_malloc_array().

#define BN_GET_TABDATA (   _data,
  _table 
)
Value:
{ \
BN_CK_TABLE(_table);\
_data = (struct bn_tabdata *)bu_calloc(1, \
BN_SIZEOF_TABDATA(_table), "struct bn_tabdata"); \
_data->magic = BN_TABDATA_MAGIC; \
_data->ny = (_table)->nx; \
_data->table = (_table); }
#define BN_TABDATA_MAGIC
Definition: magic.h:72
#define BN_SIZEOF_TABDATA(_table)
Definition: tabdata.h:110
#define BN_CK_TABLE(_p)
Definition: tabdata.h:79
void * bu_calloc(size_t nelem, size_t elsize, const char *str)
Definition: malloc.c:321

Definition at line 114 of file tabdata.h.

Referenced by bn_read_table_and_tabdata(), bn_tabdata_dup(), bn_tabdata_from_array(), bn_tabdata_get_constval(), bn_tabdata_mk_linear_filter(), bn_tabdata_resample_avg(), bn_tabdata_resample_max(), light_hit(), light_maker(), light_setup(), marble_render(), phong_render(), rr_render(), and rt_spect_make_CIE_XYZ().

Function Documentation

void bn_table_free ( struct bn_table tabp)

Definition at line 57 of file tabdata.c.

References BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_free(), bu_log(), and bn_table::nx.

Here is the call graph for this function:

void bn_tabdata_free ( struct bn_tabdata data)

Definition at line 67 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_free(), bu_log(), bn_tabdata::ny, and bn_tabdata::table.

Referenced by light_hit(), marble_render(), and phong_render().

Here is the call graph for this function:

void bn_ck_table ( const struct bn_table tabp)

Definition at line 80 of file tabdata.c.

References BN_CK_TABLE, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, and bn_table::x.

Referenced by bn_read_table_and_tabdata(), and bn_table_read().

Here is the call graph for this function:

struct bn_table* bn_table_make_uniform ( size_t  num,
double  first,
double  last 
)

Definition at line 98 of file tabdata.c.

References BN_GET_TABLE, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), delta, and bn_table::x.

Here is the call graph for this function:

void bn_tabdata_add ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 123 of file tabdata.c.

References BN_CK_TABDATA, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, and bn_tabdata::y.

Referenced by phong_render().

Here is the call graph for this function:

void bn_tabdata_mul ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 149 of file tabdata.c.

References BN_CK_TABDATA, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, and bn_tabdata::y.

Referenced by light_hit(), and rr_render().

Here is the call graph for this function:

void bn_tabdata_mul3 ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2,
const struct bn_tabdata in3 
)

Definition at line 175 of file tabdata.c.

References BN_CK_TABDATA, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, and bn_tabdata::y.

Here is the call graph for this function:

void bn_tabdata_incr_mul3_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2,
const struct bn_tabdata in3,
double  scale 
)

Referenced by phong_render().

void bn_tabdata_incr_mul2_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2,
double  scale 
)

Referenced by phong_render().

void bn_tabdata_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
double  scale 
)
void bn_table_scale ( struct bn_table tabp,
double  scale 
)
void bn_tabdata_join1 ( struct bn_tabdata out,
const struct bn_tabdata in1,
double  scale,
const struct bn_tabdata in2 
)
void bn_tabdata_join2 ( struct bn_tabdata out,
const struct bn_tabdata in1,
double  scale2,
const struct bn_tabdata in2,
double  scale3,
const struct bn_tabdata in3 
)

Referenced by rr_render().

void bn_tabdata_blend2 ( struct bn_tabdata out,
double  scale1,
const struct bn_tabdata in1,
double  scale2,
const struct bn_tabdata in2 
)

Referenced by marble_render().

void bn_tabdata_blend3 ( struct bn_tabdata out,
double  scale1,
const struct bn_tabdata in1,
double  scale2,
const struct bn_tabdata in2,
double  scale3,
const struct bn_tabdata in3 
)
double bn_tabdata_area1 ( const struct bn_tabdata in)

Definition at line 414 of file tabdata.c.

References BN_CK_TABDATA, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, and bn_tabdata::y.

Here is the call graph for this function:

double bn_tabdata_area2 ( const struct bn_tabdata in)

Definition at line 433 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, OSL::Strings::width, bn_table::x, and bn_tabdata::y.

Referenced by rt_spect_make_CIE_XYZ().

Here is the call graph for this function:

double bn_tabdata_mul_area1 ( const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 455 of file tabdata.c.

References BN_CK_TABDATA, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, and bn_tabdata::y.

Here is the call graph for this function:

double bn_tabdata_mul_area2 ( const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 475 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, OSL::Strings::width, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

fastf_t bn_table_lin_interp ( const struct bn_tabdata samp,
double  wl 
)
struct bn_tabdata* bn_tabdata_resample_max ( const struct bn_table newtable,
const struct bn_tabdata olddata 
)

Definition at line 574 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BN_GET_TABDATA, bn_table_find_x(), bn_table_lin_interp(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, s, bn_tabdata::table, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_resample_avg ( const struct bn_table newtable,
const struct bn_tabdata olddata 
)

Definition at line 643 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BN_GET_TABDATA, bn_table_find_x(), bn_table_lin_interp(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, s, bn_tabdata::table, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

int bn_table_write ( const char *  filename,
const struct bn_table tabp 
)

Definition at line 717 of file tabdata.c.

References BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_log(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bn_table::nx, and bn_table::x.

Here is the call graph for this function:

struct bn_table* bn_table_read ( const char *  filename)

Definition at line 747 of file tabdata.c.

References bn_ck_table(), BN_GET_TABLE, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bu_vls_addr(), bu_vls_free(), bu_vls_gets(), BU_VLS_INIT_ZERO, bn_table::nx, and bn_table::x.

Here is the call graph for this function:

void bn_pr_table ( const char *  title,
const struct bn_table tabp 
)

Definition at line 803 of file tabdata.c.

References BN_CK_TABLE, bu_log(), bn_table::nx, and bn_table::x.

Here is the call graph for this function:

void bn_pr_tabdata ( const char *  title,
const struct bn_tabdata data 
)

Definition at line 816 of file tabdata.c.

References BN_CK_TABDATA, bu_log(), bn_tabdata::ny, and bn_tabdata::y.

Referenced by light_hit(), and pr_shadework().

Here is the call graph for this function:

int bn_print_table_and_tabdata ( const char *  filename,
const struct bn_tabdata data 
)

Definition at line 830 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_log(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bn_table::nx, bn_tabdata::table, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

struct bn_tabdata* bn_read_table_and_tabdata ( const char *  filename)

Definition at line 863 of file tabdata.c.

References bn_ck_table(), BN_GET_TABDATA, BN_GET_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_fgets(), bu_log(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), data, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_binary_read ( const char *  filename,
size_t  num,
const struct bn_table tabp 
)

Definition at line 934 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BN_SIZEOF_TABDATA, bu_debug, BU_DEBUG_TABDATA, bu_free(), bu_log(), bu_malloc(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), data, and bn_tabdata::table.

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_malloc_array ( const struct bn_table tabp,
size_t  num 
)

Definition at line 995 of file tabdata.c.

References BN_CK_TABLE, BN_SIZEOF_TABDATA, BN_TABDATA_MAGIC, bu_calloc(), bu_debug, BU_DEBUG_TABDATA, bu_log(), data, bn_tabdata::magic, bn_table::nx, bn_tabdata::ny, and bn_tabdata::table.

Here is the call graph for this function:

void bn_tabdata_copy ( struct bn_tabdata out,
const struct bn_tabdata in 
)

Definition at line 1025 of file tabdata.c.

References BN_CK_TABDATA, BN_SIZEOF_TABDATA_Y, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, and bn_tabdata::y.

Referenced by light_hit(), rr_render(), and viewshade().

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_dup ( const struct bn_tabdata in)

Definition at line 1041 of file tabdata.c.

References BN_CK_TABDATA, BN_GET_TABDATA, BN_SIZEOF_TABDATA_Y, bu_debug, BU_DEBUG_TABDATA, bu_log(), data, bn_tabdata::table, and bn_tabdata::y.

Referenced by light_hit(), phong_render(), and rr_render().

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_get_constval ( double  val,
const struct bn_table tabp 
)

Definition at line 1054 of file tabdata.c.

References BN_CK_TABLE, BN_GET_TABDATA, bu_debug, BU_DEBUG_TABDATA, bu_log(), data, bn_tabdata::ny, and bn_tabdata::y.

Referenced by light_hit(), rr_hit(), and rr_render().

Here is the call graph for this function:

void bn_tabdata_constval ( struct bn_tabdata data,
double  val 
)

Definition at line 1072 of file tabdata.c.

References BN_CK_TABDATA, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, and bn_tabdata::y.

Referenced by light_hit(), light_setup(), phong_render(), and rr_render().

Here is the call graph for this function:

void bn_tabdata_to_tcl ( struct bu_vls vp,
const struct bn_tabdata data 
)

Definition at line 1087 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BU_CK_VLS, bu_debug, BU_DEBUG_TABDATA, bu_log(), bu_vls_printf(), bu_vls_strcat(), MAX_FASTF, bn_table::nx, bn_tabdata::ny, bn_tabdata::table, bn_table::x, and bn_tabdata::y.

Referenced by rr_render().

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_from_array ( const double *  array)

Definition at line 1116 of file tabdata.c.

References BN_GET_TABDATA, BN_GET_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_log(), data, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

void bn_tabdata_freq_shift ( struct bn_tabdata out,
const struct bn_tabdata in,
double  offset 
)

Definition at line 1146 of file tabdata.c.

References BN_CK_TABDATA, bn_table_lin_interp(), bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_tabdata::ny, bn_tabdata::table, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

int bn_table_interval_num_samples ( const struct bn_table tabp,
double  low,
double  hi 
)

Definition at line 1168 of file tabdata.c.

References BN_CK_TABLE, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, and bn_table::x.

Referenced by rt_spect_make_CIE_XYZ().

Here is the call graph for this function:

int bn_table_delete_sample_pts ( struct bn_table tabp,
unsigned int  i,
unsigned int  j 
)

Definition at line 1184 of file tabdata.c.

References BN_CK_TABLE, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, and bn_table::x.

Here is the call graph for this function:

struct bn_table* bn_table_merge2 ( const struct bn_table a,
const struct bn_table b 
)

Definition at line 1209 of file tabdata.c.

References BN_CK_TABLE, BN_GET_TABLE, bu_bomb(), bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, bn_table::x, and ZERO.

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_mk_linear_filter ( const struct bn_table spectrum,
double  lower_wavelen,
double  upper_wavelen 
)

Definition at line 1252 of file tabdata.c.

References BN_CK_TABLE, BN_GET_TABDATA, bn_table_find_x(), BU_ASSERT, bu_debug, BU_DEBUG_TABDATA, bu_log(), bn_table::nx, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function: