Diff of /resample.c [84521e] .. [839d2e]  Maximize  Restore

  Switch to unified view

a/resample.c b/resample.c
...
...
1949
    double          max_x = (double) TrPtr->src->width; // Maximum x values in source image
1949
    double          max_x = (double) TrPtr->src->width; // Maximum x values in source image
1950
    double          max_y = (double) TrPtr->src->height; // Maximum y values in source image
1950
    double          max_y = (double) TrPtr->src->height; // Maximum y values in source image
1951
    double          min_x =  -1.0;//0.0; // Minimum x values in source image
1951
    double          min_x =  -1.0;//0.0; // Minimum x values in source image
1952
    double          min_y =  -1.0;//0.0; // Minimum y values in source image
1952
    double          min_y =  -1.0;//0.0; // Minimum y values in source image
1953
1953
1954
  int         mix   = TrPtr->src->width - 1; // maximum x-index src
1955
  
1956
  int         mix2;
1957
  int         miy   = TrPtr->src->height - 1;// maximum y-index src
1958
  int         miy2;
1959
1960
    // Variables used to convert screen coordinates to cartesian coordinates
1954
    // Variables used to convert screen coordinates to cartesian coordinates
1961
1955
1962
    double          w2  = (double) TrPtr->dest->width  / 2.0 - 0.5;  // Steve's L
1956
    double          w2  = (double) TrPtr->dest->width  / 2.0 - 0.5;  // Steve's L
1963
    double          h2  = (double) TrPtr->dest->height / 2.0 - 0.5;
1957
    double          h2  = (double) TrPtr->dest->height / 2.0 - 0.5;
1964
    double          sw2 = (double) TrPtr->src->width   / 2.0 - 0.5;
1958
    double          sw2 = (double) TrPtr->src->width   / 2.0 - 0.5;
1965
    double          sh2 = (double) TrPtr->src->height  / 2.0 - 0.5;
1959
    double          sh2 = (double) TrPtr->src->height  / 2.0 - 0.5;
1966
    
1960
    
1967
    int         BytesPerLine    = TrPtr->src->bytesPerLine;
1961
    int         BytesPerLine    = TrPtr->src->bytesPerLine;
1968
  int         FirstColorByte, SamplesPerPixel;
1962
  int         FirstColorByte;
1969
    unsigned int    BytesPerPixel, BytesPerSample;
1963
    unsigned int    BytesPerPixel, BytesPerSample;
1970
1964
1971
  int         n, n2;      // How many pixels should be used for interpolation 
1972
  // int          lu = 0;     // Use lookup table?
1973
  int         wrap_x = FALSE;
1974
    double          theGamma;   // gamma handed to SetUpGamma()
1965
    double          theGamma;   // gamma handed to SetUpGamma()
1975
    
1966
    
1976
    // Some things for the floodfill algorithm
1967
    // Some things for the floodfill algorithm
1977
    
1968
    
1978
    invCacheItem *invCache;
1969
    invCacheItem *invCache;
...
...
2009
2000
2010
    srcWidth  = TrPtr->src->width; 
2001
    srcWidth  = TrPtr->src->width; 
2011
    srcHeight  = TrPtr->src->height; 
2002
    srcHeight  = TrPtr->src->height; 
2012
2003
2013
    switch( TrPtr->src->bitsPerPixel ){
2004
    switch( TrPtr->src->bitsPerPixel ){
2014
        case 128:   FirstColorByte = 4; BytesPerPixel = 16; SamplesPerPixel = 4; BytesPerSample = 4; break;
2005
        case 128:   FirstColorByte = 4; BytesPerPixel = 16; BytesPerSample = 4; break;
2015
        case  96:   FirstColorByte = 0; BytesPerPixel = 12; SamplesPerPixel = 3; BytesPerSample = 4; break;
2006
        case  96:   FirstColorByte = 0; BytesPerPixel = 12; BytesPerSample = 4; break;
2016
        case  64:   FirstColorByte = 2; BytesPerPixel = 8; SamplesPerPixel = 4; BytesPerSample = 2; break;
2007
        case  64:   FirstColorByte = 2; BytesPerPixel = 8; BytesPerSample = 2; break;
2017
        case  48:   FirstColorByte = 0; BytesPerPixel = 6; SamplesPerPixel = 3; BytesPerSample = 2; break;
2008
        case  48:   FirstColorByte = 0; BytesPerPixel = 6; BytesPerSample = 2; break;
2018
        case  32:   FirstColorByte = 1; BytesPerPixel = 4; SamplesPerPixel = 4; BytesPerSample = 1; break;
2009
        case  32:   FirstColorByte = 1; BytesPerPixel = 4; BytesPerSample = 1; break;
2019
        case  24:   FirstColorByte = 0; BytesPerPixel = 3; SamplesPerPixel = 3; BytesPerSample = 1; break;
2010
        case  24:   FirstColorByte = 0; BytesPerPixel = 3; BytesPerSample = 1; break;
2020
        case   8:   FirstColorByte = 0; BytesPerPixel = 1; SamplesPerPixel = 1; BytesPerSample = 1; break;
2011
        case   8:   FirstColorByte = 0; BytesPerPixel = 1; BytesPerSample = 1; break;
2021
        default :   PrintError("Unsupported Pixel Size: %d", TrPtr->src->bitsPerPixel);
2012
        default :   PrintError("Unsupported Pixel Size: %d", TrPtr->src->bitsPerPixel);
2022
                    TrPtr->success = 0;
2013
                    TrPtr->success = 0;
2023
                    return;
2014
                    return;
2024
    }
2015
    }
2025
/* Patch for PTStitcher to support 32 bit
2016
/* Patch for PTStitcher to support 32 bit
...
...
2030
        myfree ((unsigned char**)TrPtr->dest->data);
2021
        myfree ((unsigned char**)TrPtr->dest->data);
2031
        TrPtr->dest->data=(unsigned char**) mymalloc ((size_t)TrPtr->dest->dataSize);
2022
        TrPtr->dest->data=(unsigned char**) mymalloc ((size_t)TrPtr->dest->dataSize);
2032
    }
2023
    }
2033
*/
2024
*/
2034
    // Set interpolator etc:
2025
    // Set interpolator etc:
2035
  n=1;
2036
    switch( TrPtr->interpolator ){
2026
    switch( TrPtr->interpolator ){
2037
        case _aabox:
2027
        case _aabox:
2038
            aaSupport = 0.5;
2028
            aaSupport = 0.5;
2039
            aafilter=Box;
2029
            aafilter=Box;
2040
            break;
2030
            break;
...
...
2102
            PrintError( "Invalid Antialiased Interpolator selected" );
2092
            PrintError( "Invalid Antialiased Interpolator selected" );
2103
            TrPtr->success = 0;
2093
            TrPtr->success = 0;
2104
            return;
2094
            return;
2105
    }
2095
    }
2106
2096
2107
  n2 = n/2 ;
2108
  mix2 = mix +1 - n;
2109
  miy2 = miy +1 - n;
2110
2111
    dest = *TrPtr->dest->data;
2097
    dest = *TrPtr->dest->data;
2112
    src  = *TrPtr->src->data; // is locked
2098
    src  = *TrPtr->src->data; // is locked
2113
2099
2114
    if(TrPtr->mode & _show_progress){
2100
    if(TrPtr->mode & _show_progress){
2115
        switch(color){
2101
        switch(color){
...
...
2162
                    
2148
                    
2163
//          default: progressMessage = "Something is wrong here";
2149
//          default: progressMessage = "Something is wrong here";
2164
        }
2150
        }
2165
        Progress( _initProgress, progressMessage );
2151
        Progress( _initProgress, progressMessage );
2166
    }
2152
    }
2167
2168
  if(TrPtr->mode & _wrapX)
2169
      wrap_x = TRUE;
2170
2153
2171
    if( TrPtr->src->dataformat == _RGB )    // Gamma correct only RGB-images
2154
    if( TrPtr->src->dataformat == _RGB )    // Gamma correct only RGB-images
2172
        theGamma = TrPtr->gamma;
2155
        theGamma = TrPtr->gamma;
2173
    else
2156
    else
2174
        theGamma = 1.0;
2157
        theGamma = 1.0;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks