spherical maps
[libbn (numerical functions)]

Collaboration diagram for spherical maps:


Files

file  spm.h
 Sphere data structure and function declarations.
file  sphmap.c
 Common Subroutines for Spherical Data Structures/Texture Maps Subroutines.

Data Structures

struct  spm_map_t

Defines

#define SEEN_SPM_H   seen
#define SPM_NULL   (spm_map_t *)0
#define SPM_MAGIC   0x41278678
#define RT_CK_SPM(smp)   BU_CKMAG(smp, SPM_MAGIC, "spm_map_t" )
#define BN_CK_SPM(smp)   BU_CKMAG(smp, SPM_MAGIC, "spm_map_t" )

Functions

spm_map_tspm_init ()
void spm_free ()
void spm_read ()
void spm_write ()
char * spm_get ()
int spm_load ()
int spm_save ()
int spm_pix_load ()
int spm_pix_save ()
void spm_dump ()
int spm_px_load (spm_map_t *mapp, char *filename, int nx, int ny)
spm_map_tspm_init (int N, int elsize)
 Return a sphere map structure initialized for N points around the equator.
void spm_free (spm_map_t *mp)
 Free the storage associated with a sphere structure.
void spm_read (register spm_map_t *mapp, register unsigned char *valp, double u, double v)
void spm_write (register spm_map_t *mapp, register unsigned char *valp, double u, double v)
char * spm_get (register spm_map_t *mapp, double u, double v)
int spm_load (spm_map_t *mapp, char *filename)
int spm_save (spm_map_t *mapp, char *filename)
int spm_px_save (spm_map_t *mapp, char *filename, int nx, int ny)
void spm_dump (spm_map_t *mp, int verbose)

Define Documentation

#define SEEN_SPM_H   seen
 

Definition at line 39 of file spm.h.

#define SPM_NULL   (spm_map_t *)0
 

Definition at line 62 of file spm.h.

Referenced by spm_free(), and spm_init().

#define SPM_MAGIC   0x41278678
 

Definition at line 64 of file spm.h.

Referenced by bu_identify_magic().

#define RT_CK_SPM smp   )     BU_CKMAG(smp, SPM_MAGIC, "spm_map_t" )
 

Definition at line 66 of file spm.h.

Referenced by spm_dump(), spm_free(), spm_get(), spm_load(), spm_px_load(), spm_px_save(), spm_read(), spm_save(), and spm_write().

#define BN_CK_SPM smp   )     BU_CKMAG(smp, SPM_MAGIC, "spm_map_t" )
 

Definition at line 67 of file spm.h.


Function Documentation

spm_map_t* spm_init  ) 
 

void spm_free  ) 
 

Referenced by spm_init().

void spm_read  ) 
 

Referenced by spm_px_save().

void spm_write  ) 
 

char* spm_get  ) 
 

int spm_load  ) 
 

int spm_save  ) 
 

int spm_pix_load  ) 
 

int spm_pix_save  ) 
 

void spm_dump  ) 
 

int spm_px_load spm_map_t mapp,
char *  filename,
int  nx,
int  ny
 

Definition at line 329 of file sphmap.c.

References bu_log(), bu_malloc(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), buffer, fp, green, int, NULL, spm_map_t::nx, spm_map_t::ny, red, RT_CK_SPM, and void().

Here is the call graph for this function:

spm_map_t* spm_init int  N,
int  elsize
 

Return a sphere map structure initialized for N points around the equator.

S P M _ I N I T

Malloc the storage and fill in the pointers. This code leaves a ring of "triangular" pixels at the poles. An alternative would be to have the pole region map to a single pixel.

Returns SPM_NULL on error.

Definition at line 75 of file sphmap.c.

References bn_twopi, bu_malloc(), bzero, index, NULL, spm_free(), and SPM_NULL.

Here is the call graph for this function:

void spm_free spm_map_t mp  ) 
 

Free the storage associated with a sphere structure.

S P M _ F R E E

Definition at line 129 of file sphmap.c.

References spm_map_t::_data, bu_free(), NULL, spm_map_t::nx, RT_CK_SPM, SPM_NULL, void(), and spm_map_t::xbin.

Here is the call graph for this function:

void spm_read register spm_map_t mapp,
register unsigned char *  valp,
double  u,
double  v
 

Definition at line 163 of file sphmap.c.

References RT_CK_SPM.

void spm_write register spm_map_t mapp,
register unsigned char *  valp,
double  u,
double  v
 

Definition at line 191 of file sphmap.c.

References RT_CK_SPM.

char* spm_get register spm_map_t mapp,
double  u,
double  v
 

Definition at line 219 of file sphmap.c.

References RT_CK_SPM.

int spm_load spm_map_t mapp,
char *  filename
 

Definition at line 243 of file sphmap.c.

References spm_map_t::_data, BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), spm_map_t::elsize, fp, NULL, spm_map_t::nx, spm_map_t::ny, RT_CK_SPM, and void().

Here is the call graph for this function:

int spm_save spm_map_t mapp,
char *  filename
 

Definition at line 282 of file sphmap.c.

References bu_log(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), spm_map_t::elsize, fp, NULL, spm_map_t::nx, spm_map_t::ny, RT_CK_SPM, void(), and spm_map_t::xbin.

Here is the call graph for this function:

int spm_px_save spm_map_t mapp,
char *  filename,
int  nx,
int  ny
 

Definition at line 402 of file sphmap.c.

References bu_log(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), fp, NULL, RT_CK_SPM, spm_read(), and void().

Here is the call graph for this function:

void spm_dump spm_map_t mp,
int  verbose
 

Definition at line 451 of file sphmap.c.

References spm_map_t::_data, bu_log(), spm_map_t::elsize, spm_map_t::nx, spm_map_t::ny, RT_CK_SPM, and spm_map_t::xbin.

Here is the call graph for this function:


Generated on Mon Sep 18 01:25:24 2006 for BRL-CAD by  doxygen 1.4.6