本文整理汇总了C++中GDALRasterBand::InvalidateMaskBand方法的典型用法代码示例。如果您正苦于以下问题:C++ GDALRasterBand::InvalidateMaskBand方法的具体用法?C++ GDALRasterBand::InvalidateMaskBand怎么用?C++ GDALRasterBand::InvalidateMaskBand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GDALRasterBand
的用法示例。
在下文中一共展示了GDALRasterBand::InvalidateMaskBand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CleanOverviews
//.........这里部分代码省略.........
papoOverviewBands[nNewOverviews++] = poOverview;
break;
}
}
}
if( nNewOverviews > 0 )
{
const double dfOffset = dfAreaNewOverviews / dfAreaRefreshedOverviews;
const double dfScale = 1.0 - dfOffset;
pScaledProgress = GDALCreateScaledProgress(
dfOffset + dfScale * iBand / nBands,
dfOffset + dfScale * (iBand+1) / nBands,
pfnProgress, pProgressData );
eErr = GDALRegenerateOverviews( (GDALRasterBandH) poBand,
nNewOverviews,
(GDALRasterBandH*)papoOverviewBands,
pszResampling,
GDALScaledProgress, pScaledProgress );
GDALDestroyScaledProgress( pScaledProgress );
}
}
/* -------------------------------------------------------------------- */
/* Cleanup */
/* -------------------------------------------------------------------- */
CPLFree( papoOverviewBands );
CPLFree( panNewOverviewList );
CPLFree( pahBands );
/* -------------------------------------------------------------------- */
/* If we have a mask file, we need to build its overviews too. */
/* -------------------------------------------------------------------- */
if( HaveMaskFile() && poMaskDS )
{
// Some config option are not compatible with mask overviews
// so unset them, and define more sensible values.
const bool bJPEG =
EQUAL(CPLGetConfigOption("COMPRESS_OVERVIEW", ""), "JPEG");
const bool bPHOTOMETRIC_YCBCR =
EQUAL(CPLGetConfigOption("PHOTOMETRIC_OVERVIEW", ""), "YCBCR");
if( bJPEG )
CPLSetThreadLocalConfigOption("COMPRESS_OVERVIEW", "DEFLATE");
if( bPHOTOMETRIC_YCBCR )
CPLSetThreadLocalConfigOption("PHOTOMETRIC_OVERVIEW", "");
poMaskDS->BuildOverviews( pszResampling, nOverviews, panOverviewList,
0, NULL, pfnProgress, pProgressData );
// Restore config option.
if( bJPEG )
CPLSetThreadLocalConfigOption("COMPRESS_OVERVIEW", "JPEG");
if( bPHOTOMETRIC_YCBCR )
CPLSetThreadLocalConfigOption("PHOTOMETRIC_OVERVIEW", "YCBCR");
if( bOwnMaskDS )
{
// Reset the poMask member of main dataset bands, since it
// will become invalid after poMaskDS closing.
for( int iBand = 1; iBand <= poDS->GetRasterCount(); iBand ++ )
{
GDALRasterBand *poOtherBand = poDS->GetRasterBand(iBand);
if( poOtherBand != NULL )
poOtherBand->InvalidateMaskBand();
}
GDALClose( poMaskDS );
}
// force next request to reread mask file.
poMaskDS = NULL;
bOwnMaskDS = false;
bCheckedForMask = false;
}
/* -------------------------------------------------------------------- */
/* If we have an overview dataset, then mark all the overviews */
/* with the base dataset Used later for finding overviews */
/* masks. Uggg. */
/* -------------------------------------------------------------------- */
if( poODS )
{
const int nOverviewCount = GetOverviewCount(1);
for( int iOver = 0; iOver < nOverviewCount; iOver++ )
{
GDALRasterBand *poOtherBand = GetOverview( 1, iOver );
GDALDataset *poOverDS = poOtherBand != NULL ?
poOtherBand->GetDataset() : NULL;
if( poOverDS != NULL )
{
poOverDS->oOvManager.poBaseDS = poDS;
poOverDS->oOvManager.poDS = poOverDS;
}
}
}
return eErr;
}