IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2005, 5:50:29 PM (21 years ago)
Author:
drobbin
Message:

changed files according to requested revisions outlined in apidelta-report-cycle6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageGeomManip.c

    r4316 r4367  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-18 03:13:02 $
     12 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-06-23 03:50:29 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3636                      const psImage* restrict mask,
    3737                      psMaskType maskVal,
    38                       psU32 scale,
     38                      int scale,
    3939                      const psStats* stats)
    4040{
     
    303303
    304304psImage* psImageRotate(psImage* out,
    305                        const psImage* in,
     305                       const psImage* input,
    306306                       float angle,
    307                        psC64 unexposedValue,
     307                       _Complex exposed,
    308308                       psImageInterpolateMode mode)
    309309{
    310     if (in == NULL) {
     310    if (input == NULL) {
    311311        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    312312                PS_ERRORTEXT_psImage_IMAGE_NULL);
     
    319319    if (fabsf(angle - M_PI_2) < FLT_EPSILON) {
    320320        // perform 1/4 rotate counter-clockwise
    321         psS32 numRows = in->numCols;
    322         psS32 numCols = in->numRows;
     321        psS32 numRows = input->numCols;
     322        psS32 numCols = input->numRows;
    323323        psS32 lastCol = numCols - 1;
    324         psElemType type = in->type.type;
     324        psElemType type = input->type.type;
    325325
    326326        out = psImageRecycle(out, numCols, numRows, type);
     
    328328        #define PSIMAGE_ROTATE_LEFT_90(TYPE) \
    329329    case PS_TYPE_##TYPE: { \
    330             ps##TYPE** inData = in->data.TYPE; \
     330            ps##TYPE** inData = input->data.TYPE; \
    331331            for (psS32 row=0;row<numRows;row++) { \
    332332                ps##TYPE* outRow = out->data.TYPE[row]; \
     
    364364    } else if (fabsf(angle - M_PI) < FLT_EPSILON) {
    365365        // perform 1/2 rotate
    366         psS32 numRows = in->numRows;
     366        psS32 numRows = input->numRows;
    367367        psS32 lastRow = numRows - 1;
    368         psS32 numCols = in->numCols;
     368        psS32 numCols = input->numCols;
    369369        psS32 lastCol = numCols - 1;
    370         psElemType type = in->type.type;
     370        psElemType type = input->type.type;
    371371
    372372        out = psImageRecycle(out, numCols, numRows, type);
     
    376376            for (psS32 row=0;row<numRows;row++) { \
    377377                ps##TYPE* outRow = out->data.TYPE[row]; \
    378                 ps##TYPE* inRow = in->data.TYPE[lastRow-row]; \
     378                ps##TYPE* inRow = input->data.TYPE[lastRow-row]; \
    379379                for (psS32 col=0;col<numCols;col++) { \
    380380                    outRow[col] = inRow[lastCol - col]; \
     
    410410    } else if (fabsf(angle - (M_PI+M_PI_2)) < FLT_EPSILON) {
    411411        // perform 1/4 rotate clockwise
    412         psS32 numRows = in->numCols;
     412        psS32 numRows = input->numCols;
    413413        psS32 lastRow = numRows - 1;
    414         psS32 numCols = in->numRows;
    415         psElemType type = in->type.type;
     414        psS32 numCols = input->numRows;
     415        psElemType type = input->type.type;
    416416
    417417        out = psImageRecycle(out, numCols, numRows, type);
     
    419419        #define PSIMAGE_ROTATE_RIGHT_90(TYPE) \
    420420    case PS_TYPE_##TYPE: { \
    421             ps##TYPE** inData = in->data.TYPE; \
     421            ps##TYPE** inData = input->data.TYPE; \
    422422            for (psS32 row=0;row<numRows;row++) { \
    423423                ps##TYPE* outRow = out->data.TYPE[row]; \
     
    454454        }
    455455    } else if (fabsf(angle) < FLT_EPSILON) {
    456         out = psImageCopy(out, in, in->type.type);
     456        out = psImageCopy(out, input, input->type.type);
    457457    } else {
    458         psElemType type = in->type.type;
    459         psS32 numRows = in->numRows;
    460         psS32 numCols = in->numCols;
     458        psElemType type = input->type.type;
     459        psS32 numRows = input->numRows;
     460        psS32 numCols = input->numCols;
    461461        float centerX = (float)(numCols) / 2.0f;
    462462        float centerY = (float)(numRows) / 2.0f;
     
    497497
    498498        #define PSIMAGE_ROTATE_ARBITRARY_LOOP(TYPE,MODE) { \
    499             if (creal(unexposedValue) < PS_MIN_##TYPE || \
    500                     creal(unexposedValue) > PS_MAX_##TYPE || \
    501                     cimag(unexposedValue) < PS_MIN_##TYPE || \
    502                     cimag(unexposedValue) > PS_MAX_##TYPE) { \
     499            if (creal(exposed) < PS_MIN_##TYPE || \
     500                    creal(exposed) > PS_MAX_##TYPE || \
     501                    cimag(exposed) < PS_MIN_##TYPE || \
     502                    cimag(exposed) > PS_MAX_##TYPE) { \
    503503                psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    504504                        PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \
    505                         "unexposedValue", \
    506                         creal(unexposedValue),cimag(unexposedValue), \
     505                        "exposed", \
     506                        creal(exposed),cimag(exposed), \
    507507                        PS_TYPE_##TYPE##_NAME,  \
    508508                        (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \
     
    519519                outRow = out->data.TYPE[y]; \
    520520                for (psS32 x = 0; x < outCols; x++) { \
    521                     outRow[x] = p_psImagePixelInterpolate##MODE##_##TYPE(in,inX,inY,NULL,0,unexposedValue); \
     521                    outRow[x] = p_psImagePixelInterpolate##MODE##_##TYPE(input,inX,inY,NULL,0,exposed); \
    522522                    inX += cosT; \
    523523                    inY -= sinT; \
     
    594594
    595595psImage* psImageShift(psImage* out,
    596                       const psImage* in,
     596                      const psImage* input,
    597597                      float dx,
    598598                      float dy,
    599                       psC64 unexposedValue,
     599                      _Complex exposed,
    600600                      psImageInterpolateMode mode)
    601601{
     
    605605    psElemType type;
    606606
    607     if (in == NULL) {
     607    if (input == NULL) {
    608608        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    609609                PS_ERRORTEXT_psImage_IMAGE_NULL);
     
    613613    // create an output image of the same size
    614614    // and type
    615     outRows = in->numRows;
    616     outCols = in->numCols;
    617     type = in->type.type;
     615    outRows = input->numRows;
     616    outCols = input->numCols;
     617    type = input->type.type;
    618618    elementSize = PSELEMTYPE_SIZEOF(type);
    619619    out = psImageRecycle(out, outCols, outRows, type);
     
    621621    #define PSIMAGE_SHIFT_CASE(MODE,TYPE) \
    622622case PS_TYPE_##TYPE: \
    623     if (creal(unexposedValue) < PS_MIN_##TYPE || \
    624             creal(unexposedValue) > PS_MAX_##TYPE || \
    625             cimag(unexposedValue) < PS_MIN_##TYPE || \
    626             cimag(unexposedValue) > PS_MAX_##TYPE) { \
     623    if (creal(exposed) < PS_MIN_##TYPE || \
     624            creal(exposed) > PS_MAX_##TYPE || \
     625            cimag(exposed) < PS_MIN_##TYPE || \
     626            cimag(exposed) > PS_MAX_##TYPE) { \
    627627        psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    628628                PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID, \
    629                 "unexposedValue", \
    630                 creal(unexposedValue),cimag(unexposedValue), \
     629                "exposed", \
     630                creal(exposed),cimag(exposed), \
    631631                PS_TYPE_##TYPE##_NAME,  \
    632632                (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \
     
    640640        for (psS32 col=0;col<outCols;col++) { \
    641641            outRow[col] = p_psImagePixelInterpolate##MODE##_##TYPE( \
    642                           in,dx+(float)col,y,NULL,0,unexposedValue); \
     642                          input,dx+(float)col,y,NULL,0,exposed); \
    643643        } \
    644644    } \
     
    647647    #define PSIMAGE_SHIFT_ARBITRARY_CASE(MODE) \
    648648case PS_INTERPOLATE_##MODE: \
    649     switch (in->type.type) { \
     649    switch (input->type.type) { \
    650650        PSIMAGE_SHIFT_CASE(MODE,U8);  \
    651651        PSIMAGE_SHIFT_CASE(MODE,U16); \
     
    694694                          int inputMaskVal,
    695695                          const psPlaneTransform *outToIn,
    696                           const psRegion region,
     696                          psRegion region,
    697697                          const psPixels* pixels,
    698698                          psImageInterpolateMode mode,
    699                           int exposedValue)
     699                          double exposedValue)
    700700{
    701701    if (input == NULL) {
Note: See TracChangeset for help on using the changeset viewer.