tabdata.c File Reference

Routines for processing tables (curves) of data with one independent parameter which is common to many sets of dependent data values. More...

#include "common.h"
#include <math.h>
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "bu.h"
#include "bn.h"
Include dependency graph for tabdata.c:

Go to the source code of this file.

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, register double scale)
void bn_tabdata_incr_mul2_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, register double scale)
void bn_tabdata_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, register double scale)
void bn_table_scale (struct bn_table *tabp, register double scale)
void bn_tabdata_join1 (struct bn_tabdata *out, const struct bn_tabdata *in1, register double scale, const struct bn_tabdata *in2)
void bn_tabdata_join2 (struct bn_tabdata *out, const struct bn_tabdata *in1, register double scale2, const struct bn_tabdata *in2, register double scale3, const struct bn_tabdata *in3)
void bn_tabdata_blend2 (struct bn_tabdata *out, register double scale1, const struct bn_tabdata *in1, register double scale2, const struct bn_tabdata *in2)
void bn_tabdata_blend3 (struct bn_tabdata *out, register double scale1, const struct bn_tabdata *in1, register double scale2, const struct bn_tabdata *in2, register 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)
long bn_table_find_x (const struct bn_table *tabp, double xval)
fastf_t bn_table_lin_interp (const struct bn_tabdata *samp, register 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

Routines for processing tables (curves) of data with one independent parameter which is common to many sets of dependent data values.

Operates on bn_table (independent var) and bn_tabdata (dependent variable) structures.

One application is for storing spectral curves, see spectrum.c

Inspired by -
Roy Hall and his book "Illumination and Color in Computer @n Generated Imagery", Springer Verlag, New York, 1989.
ISBN 0-387-96774-5

With thanks to Russ Moulton Jr, EOSoft Inc. for his "rad.c" module.

Definition in file tabdata.c.


Function Documentation

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,
register double  scale 
)

Definition at line 236 of file tabdata.c.

References BN_CK_TABDATA.

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

Definition at line 270 of file tabdata.c.

References BN_CK_TABDATA.

void bn_tabdata_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
register double  scale 
)

Definition at line 300 of file tabdata.c.

References BN_CK_TABDATA.

void bn_table_scale ( struct bn_table tabp,
register double  scale 
)

Definition at line 329 of file tabdata.c.

References BN_CK_TABLE.

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

Definition at line 352 of file tabdata.c.

References BN_CK_TABDATA.

void bn_tabdata_join2 ( struct bn_tabdata out,
const struct bn_tabdata in1,
register double  scale2,
const struct bn_tabdata in2,
register double  scale3,
const struct bn_tabdata in3 
)

Definition at line 388 of file tabdata.c.

References BN_CK_TABDATA.

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

Definition at line 422 of file tabdata.c.

References BN_CK_TABDATA.

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

Definition at line 453 of file tabdata.c.

References BN_CK_TABDATA.

long bn_table_find_x ( const struct bn_table tabp,
double  xval 
)
fastf_t bn_table_lin_interp ( const struct bn_tabdata samp,
register double  wl 
)

Definition at line 642 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bn_table_find_x(), bn_table::nx, x, and bn_table::x.

Here is the call graph for this function:

Generated on Tue Dec 11 13:14:28 2012 for LIBBN by  doxygen 1.6.3