1 /* PR middle-end/63762 */
2 /* { dg-do assemble } */
3 /* { dg-options "-O2" } */
9 void astNegate (void *);
10 int astGetNegated (void *);
11 void astGetRegionBounds (void *, double *, double *);
12 int astResampleF (void *, ...);
17 MaskF (int inside
, int ndim
, const int lbnd
[], const int ubnd
[],
18 float in
[], float val
)
22 float *c
, *d
, *out
, *tmp_out
;
23 double *lbndgd
, *ubndgd
;
24 int *lbndg
, *ubndg
, idim
, ipix
, nax
, nin
, nout
, npix
, npixg
, result
= 0;
25 if (!astOK
) return result
;
26 lbndg
= astMalloc (sizeof (int)*(size_t) ndim
);
27 ubndg
= astMalloc (sizeof (int)*(size_t) ndim
);
28 lbndgd
= astMalloc (sizeof (double)*(size_t) ndim
);
29 ubndgd
= astMalloc (sizeof (double)*(size_t) ndim
);
32 astGetRegionBounds (used_region
, lbndgd
, ubndgd
);
35 for (idim
= 0; idim
< ndim
; idim
++)
37 lbndg
[ idim
] = lbnd
[ idim
];
38 ubndg
[ idim
] = ubnd
[ idim
];
39 npix
*= (ubnd
[ idim
] - lbnd
[ idim
] + 1);
40 if (npixg
>= 0) npixg
*= (ubndg
[ idim
] - lbndg
[ idim
] + 1);
42 if (npixg
<= 0 && astOK
)
44 if ((inside
!= 0) == (astGetNegated( used_region
) != 0))
47 for (ipix
= 0; ipix
< npix
; ipix
++) *(c
++) = val
;
51 else if (npixg
> 0 && astOK
)
53 if ((inside
!= 0) == (astGetNegated (used_region
) != 0))
55 tmp_out
= astMalloc (sizeof (float)*(size_t) npix
);
59 for (ipix
= 0; ipix
< npix
; ipix
++) *(c
++) = val
;
60 result
= npix
- npixg
;
69 if (inside
) astNegate (used_region
);
70 result
+= astResampleF (used_region
, ndim
, lbnd
, ubnd
, in
, NULL
,
71 NULL
, NULL
, 0, 0.0, 100, val
, ndim
,
72 lbnd
, ubnd
, lbndg
, ubndg
, out
, NULL
);
73 if (inside
) astNegate (used_region
);