4 |
|
/* |
5 |
|
* sm_samp.c |
6 |
|
*/ |
7 |
+ |
|
8 |
+ |
#include <string.h> |
9 |
+ |
|
10 |
|
#include "standard.h" |
11 |
|
#include "sm_flag.h" |
12 |
|
#include "rhd_sample.h" |
13 |
|
|
14 |
|
SAMP rsL; |
15 |
< |
int4 *samp_flag=NULL; |
15 |
> |
int32 *samp_flag=NULL; |
16 |
|
|
17 |
|
/* Each sample has a world coord point, and direction, brightness,chrominance, |
18 |
|
and RGB triples |
19 |
|
*/ |
20 |
|
|
21 |
|
#define TMSIZE sizeof(TMbright) |
22 |
< |
#define SAMPSIZ (3*sizeof(SFLOAT)+sizeof(int4)+ 6*sizeof(BYTE) + TMSIZE + 2*sizeof(int)) |
22 |
> |
#define SAMPSIZ (3*sizeof(SFLOAT)+sizeof(int32)+ 6*sizeof(BYTE) + TMSIZE + 2*sizeof(int)) |
23 |
|
|
24 |
|
/* Extra points world space point, vert flag and qt flag */ |
25 |
|
#define POINTSIZ (3*sizeof(SFLOAT) + 2*sizeof(int)) |
29 |
|
SAMP *s; |
30 |
|
{ |
31 |
|
if(samp_flag) |
32 |
< |
bzero((char *)samp_flag,FLAG_BYTES(S_MAX_BASE_PT(s))); |
32 |
> |
memset((char *)samp_flag, '\0', FLAG_BYTES(S_MAX_BASE_PT(s))); |
33 |
|
} |
34 |
|
|
35 |
|
sInit(s) |
85 |
|
|
86 |
|
/* assign larger alignment types earlier */ |
87 |
|
S_W_PT(s) = (SFLOAT(*)[3])S_BASE(s); |
88 |
< |
S_W_DIR(s) = (int4 *)(S_W_PT(s) + n + extra_points); |
88 |
> |
S_W_DIR(s) = (int32 *)(S_W_PT(s) + n + extra_points); |
89 |
|
S_BRT(s) = (TMbright *)(S_W_DIR(s) + n); |
90 |
|
S_CHR(s) = (BYTE (*)[3])(S_BRT(s) + n); |
91 |
|
S_RGB(s) = (BYTE (*)[3])(S_CHR(s) + n); |
95 |
|
S_MAX_BASE_PT(s) = n + extra_points; |
96 |
|
|
97 |
|
/* Allocate memory for a per/sample bit flag */ |
98 |
< |
if(!(samp_flag = (int4 *)malloc(FLAG_BYTES(n+extra_points)))) |
98 |
> |
if(!(samp_flag = (int32 *)malloc(FLAG_BYTES(n+extra_points)))) |
99 |
|
error(SYSTEM,"sAlloc(): Unable to allocate flag memory"); |
100 |
|
sInit(s); |
101 |
|
sClear_all_flags(s); |