本文整理汇总了C++中exiv2::exifdata::const_iterator::print方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::print方法的具体用法?C++ const_iterator::print怎么用?C++ const_iterator::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exiv2::exifdata::const_iterator
的用法示例。
在下文中一共展示了const_iterator::print方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getRawExifTag
bool NegativeProcessor::getRawExifTag(const char* exifTagName, dng_date_time_info* value) {
Exiv2::ExifData::const_iterator it = m_RawExif.findKey(Exiv2::ExifKey(exifTagName));
if (it == m_RawExif.end()) return false;
dng_date_time dt; dt.Parse((it->print(&m_RawExif)).c_str()); value->SetDateTime(dt);
return true;
}
示例2: updateExifInfo
void ThumbView::updateExifInfo(QString imageFullPath)
{
Exiv2::Image::AutoPtr exifImage;
QString key;
QString val;
try {
exifImage = Exiv2::ImageFactory::open(imageFullPath.toStdString());
exifImage->readMetadata();
}
catch (Exiv2::Error &error) {
return;
}
Exiv2::ExifData &exifData = exifImage->exifData();
if (!exifData.empty()) {
Exiv2::ExifData::const_iterator end = exifData.end();
infoView->addTitleEntry("Exif");
for (Exiv2::ExifData::const_iterator md = exifData.begin(); md != end; ++md) {
key = QString::fromUtf8(md->tagName().c_str());
val = QString::fromUtf8(md->print().c_str());
infoView->addEntry(key, val);
}
}
Exiv2::IptcData &iptcData = exifImage->iptcData();
if (!iptcData.empty()) {
Exiv2::IptcData::iterator end = iptcData.end();
infoView->addTitleEntry("IPTC");
for (Exiv2::IptcData::iterator md = iptcData.begin(); md != end; ++md) {
key = QString::fromUtf8(md->tagName().c_str());
val = QString::fromUtf8(md->print().c_str());
infoView->addEntry(key, val);
}
}
Exiv2::XmpData &xmpData = exifImage->xmpData();
if (!xmpData.empty()) {
Exiv2::XmpData::iterator end = xmpData.end();
infoView->addTitleEntry("XMP");
for (Exiv2::XmpData::iterator md = xmpData.begin(); md != end; ++md) {
key = QString::fromUtf8(md->tagName().c_str());
val = QString::fromUtf8(md->print().c_str());
infoView->addEntry(key, val);
}
}
}
示例3: JMAP
JSONNODE *ImgTagJson::genLitExif(const Exiv2::Image::AutoPtr & image)
{
//const Exiv2::ExifData &data = image->exifData();
Exiv2::ExifData &data = image->exifData();
data.sortByKey();
if (data.empty()) return NULL;
Exiv2::ExifData::const_iterator end = data.end();
JMAP *grpmap = new JMAP();
JSONNODE *tree = json_new(JSON_NODE);
json_set_name(tree, "exif");
for (Exiv2::ExifData::const_iterator i = data.begin(); i != end; i++)
{
JSONNODE *grp;
if (grpmap->find(i->groupName()) == grpmap->end())
{
grp = json_new(JSON_NODE);
json_set_name(grp, i->groupName().c_str());
grpmap->insert(JMAP::value_type(i->groupName(), grp));
}
else
grp = (grpmap->find(i->groupName()))->second;
Exiv2::ExifData::const_iterator nxt = i;
nxt++;
if ((nxt != data.end()) && (i->key() == nxt->key()))
{
//cout << "Array Elem! " << i->key() << endl;
JSONNODE *arr = json_new(JSON_ARRAY);
json_set_name(arr, i->tagName().c_str());
json_push_back(arr, json_new_a((i->tagName()).c_str(),
(i->print()).c_str()));
while ((nxt != data.end()) && (nxt->key() == i->key()))
{
json_push_back(arr, json_new_a((nxt->tagName()).c_str(),
(nxt->print()).c_str()));
nxt++;
}
json_push_back(grp, arr);
if (nxt == data.end()) break;
nxt--;
i = nxt;
}
else
{
json_push_back(grp, json_new_a((i->tagName()).c_str(),
(i->print()).c_str()));
}
}
JMAP::iterator it;
for(it = grpmap->begin(); it != grpmap->end(); it++)
{
json_push_back(tree, it->second);
grpmap->erase(it);
}
//cout << it->first << endl;
delete grpmap;
//cout << json_write_formatted(tree) << endl;
return tree;
}