IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 11, 2005, 5:43:47 AM (21 years ago)
Author:
eugene
Message:

adding mask & noise images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot-utils.c

    r4114 r4215  
    160160}
    161161
     162// mask the area contained by the region
     163void psImageMaskRegion (psImage *image, psRegion *region, int maskValue) {
     164
     165    for (int iy = 0; iy < image->numRows; iy++) {
     166        for (int ix = 0; ix < image->numCols; ix++) {
     167            if (ix + image->col0 <  region->x0) continue;
     168            if (ix + image->col0 >= region->x1) continue;
     169            if (iy + image->row0 <  region->y0) continue;
     170            if (iy + image->row0 >= region->y1) continue;
     171            image->data.U8[iy][ix] |= maskValue;
     172        }
     173    }
     174}
     175
     176// mask the area not contained by the region
     177void psImageKeepRegion (psImage *image, psRegion *region, int maskValue) {
     178
     179    for (int iy = 0; iy < image->numRows; iy++) {
     180        for (int ix = 0; ix < image->numCols; ix++) {
     181            if (ix + image->col0 <  region->x0) goto maskit;
     182            if (ix + image->col0 >= region->x1) goto maskit;
     183            if (iy + image->row0 <  region->y0) goto maskit;
     184            if (iy + image->row0 >= region->y1) goto maskit;
     185            continue;
     186        maskit:
     187            image->data.U8[iy][ix] |= maskValue;
     188        }
     189    }
     190}
     191
    162192// create a subset of sources for the PS_SOURCE_PSFSTAR entries
    163193// XXX deprecated
Note: See TracChangeset for help on using the changeset viewer.