Ticket #2121: gdal_svn_trunk_gdalenhance_fixes.patch

File gdal_svn_trunk_gdalenhance_fixes.patch, 2.0 kB (added by rouault, 5 months ago)
  • apps/gdalenhance.cpp

    old new  
    6565            "       [-of format] [-co \"NAME=VALUE\"]*\n" 
    6666            "       [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/\n" 
    6767            "             CInt16/CInt32/CFloat32/CFloat64}]\n" 
    68             "       [-scale_src[_n] src_min src_max]\n" 
    69             "       [-scale_dst[_n] dst_min dst_max]\n" 
     68            "       [-src_scale[_n] src_min src_max]\n" 
     69            "       [-dst_scale[_n] dst_min dst_max]\n" 
    7070            "       [-lutbins count]\n"  
    7171            "       [-s_nodata[_n] value]\n" 
    7272            "       [-stddev multiplier]\n" 
     
    154154 
    155155        else if( EQUALN(argv[i],"-src_scale",10) && i < argc-2) 
    156156        { 
     157            // TODO 
    157158            i += 2; 
    158159        } 
    159160 
    160161        else if( EQUALN(argv[i],"-dst_scale",10) && i < argc-2 ) 
    161162        { 
     163            // TODO 
    162164            i += 2; 
    163165        } 
    164166 
     
    358360        exit( 0 ); 
    359361    } 
    360362 
     363    if (padfScaleMin == NULL || padfScaleMax == NULL) 
     364    { 
     365        fprintf( stderr, "-equalize or -config filename command line options must be specified.\n"); 
     366        exit(1); 
     367    } 
     368 
    361369/* ==================================================================== */ 
    362370/*      Create a virtual dataset.                                       */ 
    363371/* ==================================================================== */ 
     
    419427/*      enhancement.                                                    */ 
    420428/* -------------------------------------------------------------------- */ 
    421429        pasEInfo[iBand].poSrcBand = poSrcBand; 
    422         pasEInfo[iBand].eWrkType = eOutputType; 
     430        pasEInfo[iBand].eWrkType = eBandType; 
    423431        pasEInfo[iBand].dfScaleMin = padfScaleMin[iBand]; 
    424432        pasEInfo[iBand].dfScaleMax = padfScaleMax[iBand]; 
    425433        pasEInfo[iBand].nLUTBins = nLUTBins;