Sphere data structure and function declarations. Provides spherical data structures for texture mapping.
More...
|
bn_spm_map_t * | bn_spm_init (int N, int elsize) |
| Return a sphere map structure initialized for N points around the equator.
|
|
void | bn_spm_free (bn_spm_map_t *mp) |
| Free the storage associated with a sphere structure.
|
|
void | bn_spm_read (register bn_spm_map_t *mapp, register unsigned char *valp, double u, double v) |
| Read the value of the pixel at the given normalized (u, v) coordinates. It does NOT check the sanity of the coords.
|
|
void | bn_spm_write (register bn_spm_map_t *mapp, register unsigned char *valp, double u, double v) |
| Write the value of the pixel at the given normalized (u, v) coordinates. It does NOT check the sanity of the coords.
|
|
char * | bn_spm_get (register bn_spm_map_t *mapp, double u, double v) |
| Return a pointer to the storage element indexed by (u, v) coordinates. It does NOT check the sanity of the coords.
|
|
int | bn_spm_load (bn_spm_map_t *mapp, char *filename) |
| Read a saved sphere map from a file ("-" for stdin) into the given map structure. This does not check for conformity of size, etc.
|
|
int | bn_spm_save (bn_spm_map_t *mapp, char *filename) |
| Write a loaded sphere map to the given file ("-" for stdout). Returns -1 on error, else 0.
|
|
int | bn_spm_pix_load (bn_spm_map_t *mapp, char *filename, int nx, int ny) |
| Load an 'nx' by 'ny' pix file and filter it into the given sphere structure.
|
|
int | bn_spm_pix_save (bn_spm_map_t *mapp, char *filename, int nx, int ny) |
| Save a sphere structure as an 'nx' by 'ny' pix file.
|
|
void | bn_spm_dump (bn_spm_map_t *mp, int verbose) |
| Display a sphere structure on stderr. Used for debugging.
|
|
Sphere data structure and function declarations. Provides spherical data structures for texture mapping.
◆ BN_SPM_MAP_NULL
Definition at line 44 of file spm.h.
◆ BN_CK_SPM_MAP
Definition at line 45 of file spm.h.
◆ bn_spm_init()
Return a sphere map structure initialized for N points around the equator.
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 BN_SPM_NULL on error.
◆ bn_spm_free()
Free the storage associated with a sphere structure.
◆ bn_spm_read()
Read the value of the pixel at the given normalized (u, v) coordinates. It does NOT check the sanity of the coords.
0.0 <= u < 1.0 Left to Right
0.0 <= v < 1.0 Bottom to Top
◆ bn_spm_write()
Write the value of the pixel at the given normalized (u, v) coordinates. It does NOT check the sanity of the coords.
0.0 <= u < 1.0 Left to Right
0.0 <= v < 1.0 Bottom to Top
◆ bn_spm_get()
Return a pointer to the storage element indexed by (u, v) coordinates. It does NOT check the sanity of the coords.
0.0 <= u < 1.0 Left to Right
0.0 <= v < 1.0 Bottom to Top
◆ bn_spm_load()
Read a saved sphere map from a file ("-" for stdin) into the given map structure. This does not check for conformity of size, etc.
- Returns
- -1 on error, else 0.
◆ bn_spm_save()
Write a loaded sphere map to the given file ("-" for stdout). Returns -1 on error, else 0.
◆ bn_spm_pix_load()
Load an 'nx' by 'ny' pix file and filter it into the given sphere structure.
- Returns
- -1 on error, else 0.
◆ bn_spm_pix_save()
Save a sphere structure as an 'nx' by 'ny' pix file.
- Returns
- -1 on error, else 0.
◆ bn_spm_dump()
Display a sphere structure on stderr. Used for debugging.