Changeset 17267


Ignore:
Timestamp:
Jun 19, 2009 2:18:57 PM (7 years ago)
Author:
rouault
Message:

Prevent using cascaded overviews when a dataset has an alpha band (#3033)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.6/gdal/gcore/overview.cpp

    r16885 r17267  
    897897    }
    898898
     899
     900    /* If we have a nodata mask and we are doing something more complicated */
     901    /* than nearest neighbouring, we have to fetch to nodata mask */
     902    int bUseNoDataMask = (!EQUALN(pszResampling,"NEAR",4) &&
     903                          (poSrcBand->GetMaskFlags() & GMF_ALL_VALID) == 0);
     904
    899905/* -------------------------------------------------------------------- */
    900906/*      If we are operating on multiple overviews, and using            */
     
    902908/*      amount of computation.                                          */
    903909/* -------------------------------------------------------------------- */
    904     if( (EQUALN(pszResampling,"AVER",4) || EQUALN(pszResampling,"GAUSS",5)) && nOverviewCount > 1 )
     910
     911    /* In case the mask made be computed from another band of the dataset, */
     912    /* we can't use cascaded generation, as the computation of the overviews */
     913    /* of the band used for the mask band may not have yet occured (#3033) */
     914    if( (EQUALN(pszResampling,"AVER",4) || EQUALN(pszResampling,"GAUSS",5)) && nOverviewCount > 1
     915         && !(bUseNoDataMask && poSrcBand->GetMaskFlags() != GMF_NODATA))
    905916        return GDALRegenerateCascadingOverviews( poSrcBand,
    906917                                                 nOverviewCount, papoOvrBands,
     
    926937    else
    927938        eType = GDT_Float32;
    928 
    929     /* If we have a nodata mask and we are doing something more complicated */
    930     /* than nearest neighbouring, we have to fetch to nodata mask */
    931     int bUseNoDataMask = (!EQUALN(pszResampling,"NEAR",4) &&
    932                           (poSrcBand->GetMaskFlags() & GMF_ALL_VALID) == 0);
    933939
    934940    nWidth = poSrcBand->GetXSize();
Note: See TracChangeset for help on using the changeset viewer.