本文整理汇总了C++中ossimRefPtr::valid方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimRefPtr::valid方法的具体用法?C++ ossimRefPtr::valid怎么用?C++ ossimRefPtr::valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimRefPtr
的用法示例。
在下文中一共展示了ossimRefPtr::valid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dbSort
//---
// For std::sort of ElevationDatabaseListType
// e.g.: std::sort( dbList.begin(), dbList.end(), dbSort );
//---
bool dbSort(ossimRefPtr<ossimElevationDatabase> a, ossimRefPtr<ossimElevationDatabase> b)
{
bool result = false;
if ( a.valid() && b.valid() )
{
result = ( a->getMeanSpacingMeters() < b->getMeanSpacingMeters() );
}
return result;
}
示例2: SIZE
template <class T> void ossimTiledElevationDatabase::fillGrid(T /* dummyTemplate */,
ossimRefPtr<ossimImageData> data)
{
if ( data.valid() )
{
// Copy to grid reversing the lines as the ossimDblGrid's origin is the SW corner.
const ossim_float64 NP = data->getNullPix(0);
const T* buf = static_cast<T*>(data->getBuf(0));
if ( buf )
{
const ossimIpt SIZE( data->getWidth(), data->getHeight() );
ossim_int32 bufIdx = (SIZE.y-1) * data->getWidth();
ossim_int32 grdY = 0;
for (ossim_int32 y = SIZE.y-1; y >= 0; --y)
{
for (ossim_int32 x = 0; x < SIZE.x; ++ x)
{
ossim_float64 v = static_cast<ossim_float64>(buf[bufIdx+x]);
m_grid->setNode(x, grdY, (v!=NP?v:ossim::nan()) );
}
bufIdx -= data->getWidth();
++grdY;
}
}
}
}
示例3: createHistogram
void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih)
{
static const char M[] = "ossimImageUtil::createHistogram #1";
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
}
if ( ih.valid() )
{
// Get the entry list:
std::vector<ossim_uint32> entryList;
ih->getEntryList(entryList);
bool useEntryIndex = false;
if ( entryList.size() )
{
if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
}
for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
{
createHistogram(ih, entryList[idx], useEntryIndex);
}
}
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
}
}
示例4: setProperty
void ossimLasReader::setProperty(ossimRefPtr<ossimProperty> property)
{
if ( property.valid() )
{
if ( property->getName() == SCALE_KW )
{
ossimString s;
property->valueToString(s);
ossim_float64 d = s.toFloat64();
if ( ossim::isnan(d) == false )
{
setScale( d );
}
}
else if ( property->getName() == SCAN_KW )
{
ossimString s;
property->valueToString(s);
m_scan = s.toBool();
}
else
{
ossimImageHandler::setProperty(property);
}
}
}
示例5: setProperty
bool ossimOpjCompressor::setProperty(ossimRefPtr<ossimProperty> property)
{
bool consumed = false;
if ( property.valid() )
{
ossimString key = property->getName();
if ( traceDebug() )
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "ossimOpjCompressor::setProperty DEBUG:"
<< "\nkey: " << key
<< " values: " << property->valueToString() << std::endl;
}
if (key == ossimKeywordNames::COMPRESSION_QUALITY_KW)
{
setQualityTypeString(property->valueToString());
consumed = true;
}
else if ( (key == LEVELS_KW) || (key == "Clevels") )
{
m_levels = property->valueToString().toInt32();
consumed = true;
}
else if( (key == REVERSIBLE_KW) || (key == "Creversible") )
{
setReversibleFlag(property->valueToString().toBool());
consumed = true;
}
else if (key == ADD_ALPHA_CHANNEL_KW)
{
m_alpha = property->valueToString().toBool();
consumed = true;
}
else if ( key == THREADS_KW)
{
m_threads = property->valueToString().toInt32();
consumed = true;
}
else if ( (key == "Clayers") ||
(key == "Cprecincts") )
{
// Generic options passed through kdu_params::parse_string.
// Make in the form of "key=value" for kdu_params::parse_string.
ossimString option = key;
option += "=";
option += property->valueToString();
// Add to list.
m_options.push_back(option);
consumed = true;
}
}
return consumed;
}
示例6: recursiveAdd
void ossimPlanetQtLegendItem::recursiveAdd(QTreeWidgetItem* parent,
const ossimRefPtr<ossimXmlNode> node)
{
if(!node.valid())
{
return;
}
const std::vector<ossimRefPtr<ossimXmlNode> >& childNodes = node->getChildNodes();
if(childNodes.size() == 0)
{
QTreeWidgetItem* item = new QTreeWidgetItem(parent);
item->setText(0, node->getTag().c_str());
item->setText(1, node->getText().c_str());
}
else
{
ossim_uint32 idx = 0;
ossim_uint32 idxMax = 0;
idxMax = childNodes.size();
QTreeWidgetItem* item = new QTreeWidgetItem(parent);
item->setText(0, node->getTag().c_str());
item->setText(1, node->getText().c_str());
for(idx = 0; idx < idxMax; ++idx)
{
recursiveAdd(item, childNodes[idx]);
}
}
}
示例7: getBoundingRect
void ossimTiledElevationDatabase::getBoundingRect(
ossimRefPtr<ossimImageGeometry> geom, ossimGrect& boundingRect) const
{
if ( geom.valid() )
{
std::vector<ossimGpt> corner(4);
if ( geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
{
ossimGpt ulGpt(corner[0]);
ossimGpt lrGpt(corner[0]);
for ( ossim_uint32 i = 1; i < 4; ++i )
{
if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
}
boundingRect = ossimGrect(ulGpt, lrGpt);
}
else
{
boundingRect.makeNan();
}
}
}
示例8: createOverview
// Create overview for image:
void ossimImageUtil::createOverview(ossimRefPtr<ossimImageHandler>& ih,
bool& consumedHistogramOptions,
bool& /* consumedCmmOptions */)
{
static const char M[] = "ossimImageUtil::createOverview #1";
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
}
if ( ih.valid() )
{
// Get the entry list:
std::vector<ossim_uint32> entryList;
ih->getEntryList(entryList);
bool useEntryIndex = false;
if ( entryList.size() )
{
if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
}
// Create the overview builder:
ossimString overviewType;
getOverviewType( overviewType.string() );
ossimRefPtr<ossimOverviewBuilderBase> ob =
ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(overviewType);
if ( ob.valid() )
{
// Set up any overview builder options that don't involve histograms.
ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>( ob.get() );
if ( pi ) setProps(pi);
ossim_uint32 stopDimension = getOverviewStopDimension();
if ( stopDimension ) ob->setOverviewStopDimension(stopDimension);
ob->setScanForMinMax( scanForMinMax() );
ob->setScanForMinMaxNull( scanForMinMaxNull() );
for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
{
createOverview(ih, ob, entryList[idx], useEntryIndex, consumedHistogramOptions);
}
}
else
{
ossimNotify(ossimNotifyLevel_WARN)
<< "ERROR:\nCould not create builder for: "<< overviewType << std::endl;
outputOverviewWriterTypes();
}
}
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
}
}
示例9: getNumberOfBands
ossim_uint32 ossimMultiResLevelHistogram::getNumberOfBands(ossim_uint32 resLevel) const
{
const ossimRefPtr<ossimMultiBandHistogram> h = getMultiBandHistogram(resLevel);
if (h.valid())
{
return h->getNumberOfBands();
}
return 0;
}
示例10: setProperty
void ossimKakaduNitfWriter::setProperty(ossimRefPtr<ossimProperty> property)
{
if ( property.valid() )
{
if ( m_compressor->setProperty(property) == false )
{
// Not a compressor property.
ossimNitfWriterBase::setProperty(property);
}
}
}
示例11: getMultiBandHistogram
const ossimRefPtr<ossimHistogram> ossimMultiResLevelHistogram::getHistogram(ossim_uint32 band,
ossim_uint32 resLevel)const
{
const ossimRefPtr<ossimMultiBandHistogram> temp = getMultiBandHistogram(resLevel);
if(temp.valid())
{
return temp->getHistogram(band);
}
return (ossimHistogram*)0;
}
示例12: setCurrentImageData
void ossimRgbImage::setCurrentImageData(ossimRefPtr<ossimImageData>& imageData)
{
if(imageData.valid())
{
if((imageData->getScalarType() == OSSIM_UCHAR)&&
(imageData->getDataObjectStatus()!=OSSIM_NULL))
{
theImageData = imageData;
initialize();
}
}
}
示例13: getBandInformation
ossimRefPtr<ossimNBandLutDataObject> ossimNitfImageHeader::createLut(
ossim_uint32 bandIdx)const
{
ossimRefPtr<ossimNBandLutDataObject> result;
if(bandIdx < (ossim_uint32)getNumberOfBands())
{
const ossimRefPtr<ossimNitfImageBand> band = getBandInformation(bandIdx);
if(band.valid())
{
ossim_uint32 bands = band->getNumberOfLuts();
if(bands > 0)
{
if(band->getLut(0).valid())
{
ossim_uint32 entries = band->getLut(0)->getNumberOfEntries();
result = new ossimNBandLutDataObject();
result->create(entries, band->getNumberOfLuts());
ossim_uint32 bIdx;
ossim_uint32 entryIdx;
for(bIdx = 0; bIdx < bands; ++bIdx)
{
const ossimRefPtr<ossimNitfImageLut> lut = band->getLut(bIdx);
if(lut.valid())
{
for(entryIdx = 0; entryIdx < entries; ++entryIdx)
{
(*result)[entryIdx][bIdx] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(lut->getValue(entryIdx));
}
}
}
}
}
}
}
return result;
}
示例14: hasRequiredOverview
bool ossimImageUtil::hasRequiredOverview( ossimRefPtr<ossimImageHandler>& ih,
ossimRefPtr<ossimOverviewBuilderBase>& ob )
{
bool result = false;
if ( ih.valid() && ob.valid() && ( getCopyAllFlag() == false ) )
{
if ( ih->getClassName() == "ossimCcfTileSource" )
{
// CCF reader does not use external overviews.
result = true;
}
else
{
// Note we always have one rset
ossim_uint32 required = 1;
ossim_uint32 startingResLevel = ih->getNumberOfDecimationLevels();
ossim_uint32 overviewStopDimension = ob->getOverviewStopDimension();
ossim_uint32 largestImageDimension =
ih->getNumberOfSamples(0) >
ih->getNumberOfLines(0) ?
ih->getNumberOfSamples(0) :
ih->getNumberOfLines(0);
while(largestImageDimension > overviewStopDimension)
{
largestImageDimension /= 2;
++required;
}
if ( startingResLevel >= required )
{
result = true;
}
}
}
return result;
}
示例15:
virtual ~MosaicImageChain()
{
if(theReprojection.valid())
{
theReprojection->disconnect();
theReprojection = 0;
}
if(theHistogramRemapper.valid())
{
theHistogramRemapper->disconnect();
theHistogramRemapper = 0;
}
if(theBandSelector.valid())
{
theBandSelector->disconnect();
theBandSelector = 0;
}
if(theHandler.valid())
{
theHandler->disconnect();
theHandler = 0;
}
}