本文整理汇总了C++中GDALRasterBand::GetHistogram方法的典型用法代码示例。如果您正苦于以下问题:C++ GDALRasterBand::GetHistogram方法的具体用法?C++ GDALRasterBand::GetHistogram怎么用?C++ GDALRasterBand::GetHistogram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GDALRasterBand
的用法示例。
在下文中一共展示了GDALRasterBand::GetHistogram方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRasterSampleOverview
CPLErr VRTSourcedRasterBand::GetHistogram( double dfMin, double dfMax,
int nBuckets, int *panHistogram,
int bIncludeOutOfRange, int bApproxOK,
GDALProgressFunc pfnProgress,
void *pProgressData )
{
if( nSources != 1 )
return GDALRasterBand::GetHistogram( dfMin, dfMax,
nBuckets, panHistogram,
bIncludeOutOfRange, bApproxOK,
pfnProgress, pProgressData );
if( pfnProgress == NULL )
pfnProgress = GDALDummyProgress;
/* -------------------------------------------------------------------- */
/* If we have overviews, use them for the histogram. */
/* -------------------------------------------------------------------- */
if( bApproxOK && GetOverviewCount() > 0 && !HasArbitraryOverviews() )
{
// FIXME: should we use the most reduced overview here or use some
// minimum number of samples like GDALRasterBand::ComputeStatistics()
// does?
GDALRasterBand *poBestOverview = GetRasterSampleOverview( 0 );
if( poBestOverview != this )
{
return poBestOverview->GetHistogram( dfMin, dfMax, nBuckets,
panHistogram,
bIncludeOutOfRange, bApproxOK,
pfnProgress, pProgressData );
}
}
/* -------------------------------------------------------------------- */
/* Try with source bands. */
/* -------------------------------------------------------------------- */
if ( bAntiRecursionFlag )
{
CPLError( CE_Failure, CPLE_AppDefined,
"VRTSourcedRasterBand::GetHistogram() called recursively on the same band. "
"It looks like the VRT is referencing itself." );
return CE_Failure;
}
bAntiRecursionFlag = TRUE;
CPLErr eErr = papoSources[0]->GetHistogram(GetXSize(), GetYSize(), dfMin, dfMax, nBuckets,
panHistogram,
bIncludeOutOfRange, bApproxOK,
pfnProgress, pProgressData);
if (eErr != CE_None)
{
eErr = GDALRasterBand::GetHistogram( dfMin, dfMax,
nBuckets, panHistogram,
bIncludeOutOfRange, bApproxOK,
pfnProgress, pProgressData );
bAntiRecursionFlag = FALSE;
return eErr;
}
bAntiRecursionFlag = FALSE;
return CE_None;
}