本文整理汇总了C++中exiv2::exifdata::const_iterator::typeName方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::typeName方法的具体用法?C++ const_iterator::typeName怎么用?C++ const_iterator::typeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exiv2::exifdata::const_iterator
的用法示例。
在下文中一共展示了const_iterator::typeName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exifDataToString
QString exifDataToString(Exiv2::ExifData exifData) {
if (exifData.empty()) {
return QString(QObject::tr("No EXIF found"));
}
try {
Exiv2::ExifData::const_iterator end = exifData.end();
QString tmpExif, final;
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
const char* tn = i->typeName();
/*std::string str = i->key() << " ";
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< (tn ? tn : "Unknown") << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";*/
tmpExif = "<span style='color:#1cb495;'>" + QString::fromStdString(i->key()).split(".").at(2) + "</span> " +
//QString::number(i->tag()) + "\t" +
//(tn ? tn : "Unknown") + "\t" +
//QString::number(i->count()) + "\t" +
QString::fromStdString(i->value().toString()) + "<br />";
final.append(tmpExif);
}
return final;
} catch(Exiv2::Error& e) {
示例2: print
void print(const std::string& file)
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(file);
assert(image.get() != 0);
image->readMetadata();
Exiv2::ExifData &ed = image->exifData();
Exiv2::ExifData::const_iterator end = ed.end();
for (Exiv2::ExifData::const_iterator i = ed.begin(); i != end; ++i) {
std::cout << std::setw(45) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(12) << std::setfill(' ') << std::left
<< i->ifdName() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< i->typeName() << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
}
}
示例3: print
void print(const std::string& file)
{
Exiv2::ExifData ed;
int rc = ed.read(file);
if (rc) {
std::string error = Exiv2::ExifData::strError(rc, file);
throw Exiv2::Error(error);
}
Exiv2::ExifData::const_iterator end = ed.end();
for (Exiv2::ExifData::const_iterator i = ed.begin(); i != end; ++i) {
std::cout << std::setw(45) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(12) << std::setfill(' ') << std::left
<< i->ifdName() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< i->typeName() << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
}
}
示例4: print
void print(const ExifData& exifData)
{
if (exifData.empty()) {
std::string error("No Exif data found in the file");
throw Exiv2::Error(1, error);
}
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< i->typeName() << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
}
}
示例5: exiv2_dump_tags
void exiv2_dump_tags(const ExifData& exif)
{
cout << "exiv2_dump_tags: " << endl;
Exiv2::ExifData::const_iterator end = exif.end();
for (Exiv2::ExifData::const_iterator i = exif.begin(); i != end; ++i)
{
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< i->typeName() << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
}
}
示例6: parseTag
void Tag_Handler::parseTag()
{
if(!gps_from_filename)
gps_found = false;
Exiv2::ExifData::const_iterator end = exif_data->end();
for(Exiv2::ExifData::const_iterator i = exif_data->begin(); i != end; ++i)
{
if(0)//(dumpAllExif)
{
const char* tn = i->typeName();
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< (tn ? tn : "Unknown") << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
}
if(i->key() == "Exif.GPSInfo.GPSLatitude" && !gps_from_filename)
{
gps.lat_ratio = QString::fromStdString(i->value().toString());
convert_degMinSec(gps.lat_ratio, gps.lat_coord);
gps.lat_coord.dec_form = getDecForm(gps.lat_coord, gps.lat_coord.ref);
gps_found = true;
}
else if(i->key() == "Exif.GPSInfo.GPSLongitude" && !gps_from_filename)
{
gps.long_ratio = QString::fromStdString(i->value().toString());
convert_degMinSec(gps.long_ratio, gps.long_coord);
gps.long_coord.dec_form = getDecForm(gps.long_coord, gps.long_coord.ref);
gps_found = true;
}
else if(i->key() == "Exif.GPSInfo.GPSLatitudeRef" && !gps_from_filename)
{
gps.lat_coord.ref = QString::fromStdString(i->value().toString());
}
else if(i->key() == "Exif.GPSInfo.GPSLongitudeRef" && !gps_from_filename)
{
gps.long_coord.ref = QString::fromStdString(i->value().toString());
}
else if(i->key() == "Exif.Photo.UserComment")
{
const char* tn = i->typeName();
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< (tn ? tn : "Unknown") << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
//need to reset user comment if hasn't been set before
if(i->count() == 264)
{
(*exif_data)["Exif.Photo.UserComment"] = "";
image->writeMetadata();
}
}
}
if(!gps_found)
{
clearGPSdata(gps);
}
}