本文整理汇总了C++中imf::Header::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Header::end方法的具体用法?C++ Header::end怎么用?C++ Header::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类imf::Header
的用法示例。
在下文中一共展示了Header::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: headerToCompoundData
static void headerToCompoundData( const Imf::Header &header, CompoundData *blindData )
{
for ( Imf::Header::ConstIterator attrIt = header.begin(); attrIt != header.end(); attrIt++ )
{
std::string name = attrIt.name();
DataPtr data = attributeToData( attrIt.attribute() );
if ( data )
{
addHeaderAttribute( name, data, blindData );
}
}
}
示例2: if
//.........这里部分代码省略.........
if (m_levelmode == Imf::MIPMAP_LEVELS) {
m_nmiplevels = m_input_tiled->numLevels();
m_spec.attribute ("openexr:roundingmode", m_roundingmode);
} else if (m_levelmode == Imf::RIPMAP_LEVELS) {
m_nmiplevels = std::max (m_input_tiled->numXLevels(),
m_input_tiled->numYLevels());
m_spec.attribute ("openexr:roundingmode", m_roundingmode);
} else {
m_nmiplevels = 1;
}
} else {
m_levelmode = Imf::ONE_LEVEL;
m_nmiplevels = 1;
}
const Imf::EnvmapAttribute *envmap;
envmap = m_header->findTypedAttribute<Imf::EnvmapAttribute>("envmap");
if (envmap) {
m_cubeface = (envmap->value() == Imf::ENVMAP_CUBE);
m_spec.attribute ("textureformat", m_cubeface ? "CubeFace Environment" : "LatLong Environment");
// OpenEXR conventions for env maps
if (! m_cubeface)
m_spec.attribute ("oiio:updirection", "y");
m_spec.attribute ("oiio:sampleborder", 1);
// FIXME - detect CubeFace Shadow?
} else {
m_cubeface = false;
if (tiled && m_levelmode == Imf::MIPMAP_LEVELS)
m_spec.attribute ("textureformat", "Plain Texture");
// FIXME - detect Shadow
}
const Imf::CompressionAttribute *compressattr;
compressattr = m_header->findTypedAttribute<Imf::CompressionAttribute>("compression");
if (compressattr) {
const char *comp = NULL;
switch (compressattr->value()) {
case Imf::NO_COMPRESSION : comp = "none"; break;
case Imf::RLE_COMPRESSION : comp = "rle"; break;
case Imf::ZIPS_COMPRESSION : comp = "zip"; break;
case Imf::ZIP_COMPRESSION : comp = "zip"; break;
case Imf::PIZ_COMPRESSION : comp = "piz"; break;
case Imf::PXR24_COMPRESSION : comp = "pxr24"; break;
#ifdef IMF_B44_COMPRESSION
// The enum Imf::B44_COMPRESSION is not defined in older versions
// of OpenEXR, and there are no explicit version numbers in the
// headers. BUT this other related #define is present only in
// the newer version.
case Imf::B44_COMPRESSION : comp = "b44"; break;
case Imf::B44A_COMPRESSION : comp = "b44a"; break;
#endif
default:
break;
}
if (comp)
m_spec.attribute ("compression", comp);
}
for (Imf::Header::ConstIterator hit = m_header->begin();
hit != m_header->end(); ++hit) {
const Imf::IntAttribute *iattr;
const Imf::FloatAttribute *fattr;
const Imf::StringAttribute *sattr;
const Imf::M44fAttribute *mattr;
const Imf::V3fAttribute *vattr;
const char *name = hit.name();
std::string oname = exr_tag_to_ooio_std[name];
if (oname.empty()) // Empty string means skip this attrib
continue;
// if (oname == name)
// oname = std::string(format_name()) + "_" + oname;
const Imf::Attribute &attrib = hit.attribute();
std::string type = attrib.typeName();
if (type == "string" &&
(sattr = m_header->findTypedAttribute<Imf::StringAttribute> (name)))
m_spec.attribute (oname, sattr->value().c_str());
else if (type == "int" &&
(iattr = m_header->findTypedAttribute<Imf::IntAttribute> (name)))
m_spec.attribute (oname, iattr->value());
else if (type == "float" &&
(fattr = m_header->findTypedAttribute<Imf::FloatAttribute> (name)))
m_spec.attribute (oname, fattr->value());
else if (type == "m44f" &&
(mattr = m_header->findTypedAttribute<Imf::M44fAttribute> (name)))
m_spec.attribute (oname, TypeDesc::TypeMatrix, &(mattr->value()));
else if (type == "v3f" &&
(vattr = m_header->findTypedAttribute<Imf::V3fAttribute> (name)))
m_spec.attribute (oname, TypeDesc::TypeVector, &(vattr->value()));
else {
#if 0
std::cerr << " unknown attribute " << type << ' ' << name << "\n";
#endif
}
}
m_subimage = 0;
m_miplevel = 0;
newspec = m_spec;
return true;
}