本文整理汇总了C++中exifdata::const_iterator::ifdId方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::ifdId方法的具体用法?C++ const_iterator::ifdId怎么用?C++ const_iterator::ifdId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exifdata::const_iterator
的用法示例。
在下文中一共展示了const_iterator::ifdId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Error
void Rw2Image::readMetadata()
{
#ifdef DEBUG
std::cerr << "Reading RW2 file " << io_->path() << "\n";
#endif
if (io_->open() != 0) {
throw Error(9, io_->path(), strError());
}
IoCloser closer(*io_);
// Ensure that this is the correct image type
if (!isRw2Type(*io_, false)) {
if (io_->error() || io_->eof()) throw Error(14);
throw Error(3, "RW2");
}
clearMetadata();
std::ofstream devnull;
printStructure(devnull, kpsRecursive, 0);
ByteOrder bo = Rw2Parser::decode(exifData_,
iptcData_,
xmpData_,
io_->mmap(),
io_->size());
setByteOrder(bo);
// A lot more metadata is hidden in the embedded preview image
// Todo: This should go into the Rw2Parser, but for that it needs the Image
PreviewManager loader(*this);
PreviewPropertiesList list = loader.getPreviewProperties();
// Todo: What if there are more preview images?
if (list.size() > 1) {
#ifndef SUPPRESS_WARNINGS
EXV_WARNING << "RW2 image contains more than one preview. None used.\n";
#endif
}
if (list.size() != 1) return;
ExifData exifData;
PreviewImage preview = loader.getPreviewImage(*list.begin());
Image::AutoPtr image = ImageFactory::open(preview.pData(), preview.size());
if (image.get() == 0) {
#ifndef SUPPRESS_WARNINGS
EXV_WARNING << "Failed to open RW2 preview image.\n";
#endif
return;
}
image->readMetadata();
ExifData& prevData = image->exifData();
if (!prevData.empty()) {
// Filter duplicate tags
for (ExifData::const_iterator pos = exifData_.begin(); pos != exifData_.end(); ++pos) {
if (pos->ifdId() == panaRawId) continue;
ExifData::iterator dup = prevData.findKey(ExifKey(pos->key()));
if (dup != prevData.end()) {
#ifdef DEBUG
std::cerr << "Filtering duplicate tag " << pos->key()
<< " (values '" << pos->value()
<< "' and '" << dup->value() << "')\n";
#endif
prevData.erase(dup);
}
}
}
// Remove tags not applicable for raw images
static const char* filteredTags[] = {
"Exif.Photo.ComponentsConfiguration",
"Exif.Photo.CompressedBitsPerPixel",
"Exif.Panasonic.ColorEffect",
"Exif.Panasonic.Contrast",
"Exif.Panasonic.NoiseReduction",
"Exif.Panasonic.ColorMode",
"Exif.Panasonic.OpticalZoomMode",
"Exif.Panasonic.Contrast",
"Exif.Panasonic.Saturation",
"Exif.Panasonic.Sharpness",
"Exif.Panasonic.FilmMode",
"Exif.Panasonic.SceneMode",
"Exif.Panasonic.WBRedLevel",
"Exif.Panasonic.WBGreenLevel",
"Exif.Panasonic.WBBlueLevel",
"Exif.Photo.ColorSpace",
"Exif.Photo.PixelXDimension",
"Exif.Photo.PixelYDimension",
"Exif.Photo.SceneType",
"Exif.Photo.CustomRendered",
"Exif.Photo.DigitalZoomRatio",
"Exif.Photo.SceneCaptureType",
"Exif.Photo.GainControl",
"Exif.Photo.Contrast",
"Exif.Photo.Saturation",
"Exif.Photo.Sharpness",
"Exif.Image.PrintImageMatching",
"Exif.Image.YCbCrPositioning"
};
for (unsigned int i = 0; i < EXV_COUNTOF(filteredTags); ++i) {
ExifData::iterator pos = prevData.findKey(ExifKey(filteredTags[i]));
if (pos != prevData.end()) {
#ifdef DEBUG
std::cerr << "Exif tag " << pos->key() << " removed\n";
#endif
prevData.erase(pos);
}
//.........这里部分代码省略.........