本文整理汇总了C++中VRTDataset::BuildVirtualOverviews方法的典型用法代码示例。如果您正苦于以下问题:C++ VRTDataset::BuildVirtualOverviews方法的具体用法?C++ VRTDataset::BuildVirtualOverviews怎么用?C++ VRTDataset::BuildVirtualOverviews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VRTDataset
的用法示例。
在下文中一共展示了VRTDataset::BuildVirtualOverviews方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GDALOpenShared
GDALRasterBand *VRTRasterBand::GetOverview( int iOverview )
{
// First: overviews declared in <Overview> element
if( !m_apoOverviews.empty() )
{
if( iOverview < 0
|| iOverview >= static_cast<int>( m_apoOverviews.size() ) )
return NULL;
if( m_apoOverviews[iOverview].poBand == NULL
&& !m_apoOverviews[iOverview].bTriedToOpen )
{
m_apoOverviews[iOverview].bTriedToOpen = TRUE;
GDALDataset *poSrcDS = reinterpret_cast<GDALDataset *>(
GDALOpenShared( m_apoOverviews[iOverview].osFilename,
GA_ReadOnly ) );
if( poSrcDS == NULL )
return NULL;
m_apoOverviews[iOverview].poBand = poSrcDS->GetRasterBand(
m_apoOverviews[iOverview].nBand );
if (m_apoOverviews[iOverview].poBand == NULL)
{
GDALClose( (GDALDatasetH)poSrcDS );
}
}
return m_apoOverviews[iOverview].poBand;
}
// If not found, external .ovr overviews
GDALRasterBand* poRet = GDALRasterBand::GetOverview( iOverview );
if( poRet )
return poRet;
// If not found, implicit virtual overviews
VRTDataset* poVRTDS = reinterpret_cast<VRTDataset *>( poDS );
poVRTDS->BuildVirtualOverviews();
if( !poVRTDS->m_apoOverviews.empty() && poVRTDS->m_apoOverviews[0] )
{
if( iOverview < 0
|| iOverview >= static_cast<int>( poVRTDS->m_apoOverviews.size() ) )
return NULL;
return poVRTDS->m_apoOverviews[iOverview]->GetRasterBand(nBand);
}
return NULL;
}
示例2: GDALOpenShared
GDALRasterBand *VRTRasterBand::GetOverview( int iOverview )
{
// First: overviews declared in <Overview> element
if( apoOverviews.size() > 0 )
{
if( iOverview < 0 || iOverview >= (int) apoOverviews.size() )
return NULL;
if( apoOverviews[iOverview].poBand == NULL
&& !apoOverviews[iOverview].bTriedToOpen )
{
apoOverviews[iOverview].bTriedToOpen = TRUE;
GDALDataset *poSrcDS = (GDALDataset *)
GDALOpenShared( apoOverviews[iOverview].osFilename, GA_ReadOnly );
if( poSrcDS == NULL )
return NULL;
apoOverviews[iOverview].poBand = poSrcDS->GetRasterBand(
apoOverviews[iOverview].nBand );
if (apoOverviews[iOverview].poBand == NULL)
{
GDALClose( (GDALDatasetH)poSrcDS );
}
}
return apoOverviews[iOverview].poBand;
}
// If not found, external .ovr overviews
GDALRasterBand* poRet = GDALRasterBand::GetOverview( iOverview );
if( poRet )
return poRet;
// If not found, implicit virtual overviews
VRTDataset* poVRTDS = ((VRTDataset *)poDS);
poVRTDS->BuildVirtualOverviews();
if( poVRTDS->apoOverviews.size() && poVRTDS->apoOverviews[0] )
{
if( iOverview < 0 || iOverview >= (int) poVRTDS->apoOverviews.size() )
return NULL;
return poVRTDS->apoOverviews[iOverview]->GetRasterBand(nBand);
}
return NULL;
}
示例3: GetOverviewCount
int VRTRasterBand::GetOverviewCount()
{
// First: overviews declared in <Overview> element
if( !m_apoOverviews.empty() )
return static_cast<int>(m_apoOverviews.size());
// If not found, external .ovr overviews
const int nOverviewCount = GDALRasterBand::GetOverviewCount();
if( nOverviewCount )
return nOverviewCount;
// If not found, implicit virtual overviews
VRTDataset* poVRTDS = reinterpret_cast<VRTDataset *>( poDS );
poVRTDS->BuildVirtualOverviews();
if( !poVRTDS->m_apoOverviews.empty() && poVRTDS->m_apoOverviews[0] )
return static_cast<int>( poVRTDS->m_apoOverviews.size() );
return 0;
}
示例4: GetOverviewCount
int VRTRasterBand::GetOverviewCount()
{
// First: overviews declared in <Overview> element
if( apoOverviews.size() > 0 )
return apoOverviews.size();
// If not found, external .ovr overviews
int nOverviewCount = GDALRasterBand::GetOverviewCount();
if( nOverviewCount )
return nOverviewCount;
// If not found, implicit virtual overviews
VRTDataset* poVRTDS = ((VRTDataset *)poDS);
poVRTDS->BuildVirtualOverviews();
if( poVRTDS->apoOverviews.size() && poVRTDS->apoOverviews[0] )
return (int)poVRTDS->apoOverviews.size();
return 0;
}