/********************************/ /* aplum */ /* */ /* Evaluate aperture mag */ /********************************/ #include "focas1.h" static struct image pevl; aplum (ob, area, aperture, fd) struct objrec *ob; struct areas *area; float aperture; FILE * fd; { PIXEL * cp; int i, j, xci, yci; float Lfca, c, r; float fastr (); if (ob -> eflgs & DARK) return (0); if (rdimg (pfd, area -> rct, &pevl) < 0) return (0); /* Fixed aperature luminosity */ xci = lpcoords (ob->xc, 1, 2) - pevl.x0; yci = lpcoords (ob->yc, 2, 2) - pevl.y0; Lfca = 0.; for (i = pevl.dy - 1; i >= 0; i--) { cp = pevl.pic + i * pevl.dx; for (j = 0; j < pevl.dx; j++) { r = fastr (j - xci, i - yci); c = film (*cp++) - ob -> sbr; if (r < aperture) Lfca += c; } } if (Lfca <= 0.) return (1); else { ob -> Lfca = Lfca; return (0); } }