IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 27, 2008, 12:41:58 PM (18 years ago)
Author:
eugene
Message:

turn on threading; add -threads argument, split out pswarpTransformSources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080719/pswarp/src/pswarpMapGrid.c

    r12523 r18753  
    44// coordinates (src) to destination coordinates (dest).  we construct a grid with superpixel
    55// spacing of nXpix, nYpix.  The transformation for each grid cell is valid for the superpixel.
    6 // The grid over-fills the source image so ever source image pixel is guaranteed to have a map.
     6// The grid over-fills the source image so every source image pixel is guaranteed to have a map.
    77pswarpMapGrid *pswarpMapGridFromImage (pmReadout *dest, pmReadout *src, int nXpix, int nYpix) {
    88
     
    1111
    1212    // start counting from the center of the superpixels
    13     int xMin = 0.5*nXpix;
    14     int yMin = 0.5*nYpix;
     13    double xMin = 0.5*nXpix;
     14    double yMin = 0.5*nYpix;
    1515
    1616    // the map is defined for coordinates in the image parent frame.
     
    4242
    4343// set the grid coordinate (gridX,gridY) for the given source image coordinate (ix,iy)
     44// XXX return true if the result is on the src image, false otherwise (???)
    4445bool pswarpMapGridSetGrid (pswarpMapGrid *grid, int ix, int iy, int *gridX, int *gridY) {
    4546
    4647    *gridX = 0.5 + (ix - grid->xMin) / (double) grid->nXpix;
    4748    *gridY = 0.5 + (iy - grid->yMin) / (double) grid->nYpix;
     49
     50    return true;
     51}
     52
     53// given the specified grid coordinate (gridX, gridY), return the min and max coordinates for the tile
     54bool pswarpMapGridCoordRange (pswarpMapGrid *grid, int gridX, int gridY, psPlane *min, psPlane *max) {
     55
     56    min->x = (gridX - 0.5)*grid->nXpix + grid->xMin;
     57    min->y = (gridY - 0.5)*grid->nYpix + grid->yMin;
     58
     59    max->x = min->x + grid->nXpix;
     60    max->y = min->y + grid->nYpix;
     61
    4862    return true;
    4963}
Note: See TracChangeset for help on using the changeset viewer.