BRL-CAD
sh_points.c File Reference
#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "vmath.h"
#include "raytrace.h"
#include "fb.h"
#include "spm.h"
#include "optical.h"
Include dependency graph for sh_points.c:

Go to the source code of this file.

Data Structures

struct  points_specific
 
struct  points
 

Macros

#define PT_NAME_LEN   128
 
#define POINTS_NULL   ((struct points_specific *)0)
 
#define POINTS_O(m)   bu_offsetof(struct points_specific, m)
 

Functions

HIDDEN int points_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int points_render (struct application *ap, const struct partition *partp, struct shadework *swp, void *dp)
 
HIDDEN void points_print (register struct region *rp, void *dp)
 
HIDDEN void points_mfree (void *cp)
 

Variables

struct bu_structparse points_parse []
 
struct mfuncs points_mfuncs []
 

Detailed Description

Reads a file of u, v point locations and associated RGB color values. For each u, v texture mapping cell, this routine fills in the color of the "brightest" point contained in that cell (if any).

This routine was born in order to environment map the Yale Bright Star catalog data without under or over sampling the point sources. It was soon realized that making it "star" specific limited its usefulness.

Definition in file sh_points.c.

Macro Definition Documentation

#define PT_NAME_LEN   128

Definition at line 47 of file sh_points.c.

#define POINTS_NULL   ((struct points_specific *)0)

Definition at line 53 of file sh_points.c.

#define POINTS_O (   m)    bu_offsetof(struct points_specific, m)

Definition at line 54 of file sh_points.c.

Function Documentation

HIDDEN int points_setup ( register struct region rp,
struct bu_vls matparm,
void **  dpp,
const struct mfuncs *  mfp,
struct rt_i rtip 
)

Definition at line 89 of file sh_points.c.

References bn_spm_get(), bn_spm_init(), BU_ALLOC, BU_CK_VLS, bu_fgets(), BU_GET, bu_log(), BU_PUT, bu_strlcpy, bu_struct_parse(), points::color, points::next, points_specific::pt_file, points_specific::pt_map, points_specific::pt_size, points::u, OSL::Strings::u, points::v, and OSL::Strings::v.

Here is the call graph for this function:

HIDDEN int points_render ( struct application ap,
const struct partition partp,
struct shadework *  swp,
void *  dp 
)
HIDDEN void points_print ( register struct region rp,
void *  dp 
)

Definition at line 220 of file sh_points.c.

References bu_struct_print().

Here is the call graph for this function:

HIDDEN void points_mfree ( void *  cp)

Definition at line 228 of file sh_points.c.

References bn_spm_free().

Here is the call graph for this function:

Variable Documentation

struct bu_structparse points_parse[]
Initial value:
= {
{"%s", PT_NAME_LEN, "file", POINTS_O(pt_file), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "size", POINTS_O(pt_size), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "w", POINTS_O(pt_size), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define PT_NAME_LEN
Definition: sh_points.c:47
#define POINTS_O(m)
Definition: sh_points.c:54

Definition at line 56 of file sh_points.c.

struct mfuncs points_mfuncs[]
Initial value:
= {
{0, (char *)0, 0, 0, 0, 0, 0, 0, 0 }
}
#define MF_MAGIC
Definition: magic.h:205
HIDDEN int points_render(struct application *ap, const struct partition *partp, struct shadework *swp, void *dp)
Definition: sh_points.c:158
HIDDEN void points_mfree(void *cp)
Definition: sh_points.c:228
HIDDEN int points_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_points.c:89
HIDDEN void points_print(register struct region *rp, void *dp)
Definition: sh_points.c:220

Definition at line 69 of file sh_points.c.

Referenced by optical_shader_init().