37 |
|
|
38 |
|
int repeatcnt = 1; |
39 |
|
|
40 |
– |
char *progname; |
40 |
|
|
42 |
– |
|
41 |
|
int |
42 |
|
main( |
43 |
|
int argc, |
48 |
|
int rval, getdim = 0; |
49 |
|
int i; |
50 |
|
|
51 |
< |
progname = argv[0]; |
51 |
> |
fixargv0(argv[0]); /* sets global progname */ |
52 |
|
if (argc < 2) |
53 |
|
goto userr; |
54 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) |
107 |
|
break; |
108 |
|
case 'c': /* repeat count */ |
109 |
|
repeatcnt = atoi(argv[++i]); |
110 |
+ |
if (repeatcnt < 1) repeatcnt = 1; |
111 |
|
break; |
112 |
|
case 'p': /* pixel aspect or jitter */ |
113 |
|
if (argv[i][2] == 'a') |
153 |
|
(vw.vaft > FTINY) ? " -ld+" : ""); |
154 |
|
return(0); |
155 |
|
} |
156 |
+ |
if ((repeatcnt > 1) & (pj > FTINY)) |
157 |
+ |
initurand(1024); |
158 |
|
if (fromstdin) |
159 |
|
pix2rays(stdin); |
160 |
|
else |
173 |
|
RREAL loc[2] |
174 |
|
) |
175 |
|
{ |
176 |
< |
if (pj > FTINY) { |
177 |
< |
loc[0] += pj*(.5 - frandom())/rs.xr; |
178 |
< |
loc[1] += pj*(.5 - frandom())/rs.yr; |
179 |
< |
} |
176 |
> |
static int nsamp; |
177 |
> |
double xyr[2]; |
178 |
> |
|
179 |
> |
if (pj <= FTINY) |
180 |
> |
return; |
181 |
> |
|
182 |
> |
if (repeatcnt == 1) { |
183 |
> |
xyr[0] = frandom(); |
184 |
> |
xyr[1] = frandom(); |
185 |
> |
} else /* stratify samples */ |
186 |
> |
multisamp(xyr, 2, urand(nsamp++)); |
187 |
> |
|
188 |
> |
loc[0] += pj*(.5 - xyr[0])/rs.xr; |
189 |
> |
loc[1] += pj*(.5 - xyr[1])/rs.yr; |
190 |
|
} |
191 |
|
|
192 |
|
|