当前位置: 首页>>代码示例>>C++>>正文


C++ const_iterator::count方法代码示例

本文整理汇总了C++中exiv2::exifdata::const_iterator::count方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::count方法的具体用法?C++ const_iterator::count怎么用?C++ const_iterator::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在exiv2::exifdata::const_iterator的用法示例。


在下文中一共展示了const_iterator::count方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getRawExifTag

bool NegativeProcessor::getRawExifTag(const char* exifTagName, int32 component, uint32* value) {
    Exiv2::ExifData::const_iterator it = m_RawExif.findKey(Exiv2::ExifKey(exifTagName));
    if ((it == m_RawExif.end()) || (it->count() < (component + 1))) return false;

    *value = static_cast<uint32>(it->toLong(component));
    return true;
}
开发者ID:elix22,项目名称:raw2dng,代码行数:7,代码来源:negativeProcessor.cpp

示例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";

    }
}
开发者ID:FihlaTV,项目名称:Satires,代码行数:25,代码来源:write2-test.cpp

示例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";

    }
}
开发者ID:obklar,项目名称:exiv2,代码行数:27,代码来源:write2-test.cpp

示例4: pixelHeight

 int RafImage::pixelHeight() const
 {
     Exiv2::ExifData::const_iterator heightIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelYDimension"));
     if (heightIter != exifData_.end() && heightIter->count() > 0) {
         return heightIter->toLong();
     }
     return 0;
 }
开发者ID:FihlaTV,项目名称:Satires,代码行数:8,代码来源:rafimage.cpp

示例5: pixelWidth

 int RafImage::pixelWidth() const
 {
     Exiv2::ExifData::const_iterator widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
     if (widthIter != exifData_.end() && widthIter->count() > 0) {
         return widthIter->toLong();
     }
     return 0;
 }
开发者ID:FihlaTV,项目名称:Satires,代码行数:8,代码来源:rafimage.cpp

示例6:

 const long getExiv2ValueLong(Exiv2::ExifData& exifData, Exiv2::ExifData::const_iterator it)
 {
     if(it!=exifData.end() && it->count())
     {
         return it->toLong();
     }
     return 0;
 };
开发者ID:ndevenish,项目名称:Hugin,代码行数:8,代码来源:Exiv2Helper.cpp

示例7: StrTrim

 const std::string getExiv2ValueString(Exiv2::ExifData& exifData,Exiv2::ExifData::const_iterator it)
 {
     if(it!=exifData.end() && it->count())
     {
         return hugin_utils::StrTrim(it->toString());
     };
     return std::string("");
 };
开发者ID:ndevenish,项目名称:Hugin,代码行数:8,代码来源:Exiv2Helper.cpp

示例8: 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";
    }
}
开发者ID:FihlaTV,项目名称:Satires,代码行数:21,代码来源:tiffmn-test.cpp

示例9: 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";
    }
}
开发者ID:MaiTiano,项目名称:fuppes,代码行数:21,代码来源:metadata_exiv2.cpp

示例10: scan_exiv2

void scan_exiv2(const class scanner_params &sp,const recursion_control_block &rcb)
{
    assert(sp.sp_version==scanner_params::CURRENT_SP_VERSION);
    if(sp.phase==scanner_params::PHASE_STARTUP){
        assert(sp.info->si_version==scanner_info::CURRENT_SI_VERSION);
	sp.info->name  = "exiv2";
        sp.info->author         = "Simson L. Garfinkel";
        sp.info->description    = "Searches for EXIF information using exiv2";
        sp.info->scanner_version= "1.0";
	sp.info->feature_names.insert("exif");
	sp.info->feature_names.insert("gps");
	sp.info->flags = scanner_info::SCANNER_DISABLED; // disabled because we have be_exif
	return;
    }
    if(sp.phase==scanner_params::PHASE_SHUTDOWN) return;
    if(sp.phase==scanner_params::PHASE_SCAN){

	const sbuf_t &sbuf = sp.sbuf;
	feature_recorder *exif_recorder = sp.fs.get_name("exif");
	feature_recorder *gps_recorder  = sp.fs.get_name("gps");

#ifdef HAVE_EXIV2__LOGMSG__SETLEVEL
	/* New form to suppress error messages on exiv2 */
	Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
#endif    

	size_t pos_max = 1;		// by default, just scan 1 byte
	if(sbuf.bufsize > min_exif_size){
	    pos_max = sbuf.bufsize - min_exif_size; //  we can scan more!
	}
    
	/* Loop through all possible locations in the buffer */
	for(size_t pos=0;pos<pos_max;pos++){
	    size_t count = exif_gulp_size;
	    count = min(count,sbuf.bufsize-pos);
	    //size_t count = sbuf.bufsize-pos; // use all to end

	    /* Explore the beginning of each 512-byte block as well as the starting location
	     * of any JPEG on any boundary. This will cause processing of any multimedia file
	     * that Exiv2 recognizes (for which I do not know all the headers.
	     */
	    if(pos%512==0 || jpeg_start(sbuf+pos)){
		try {
		    Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(sbuf.buf+pos,count);
		    if(image->good()){
			image->readMetadata();
		    
			Exiv2::ExifData &exifData = image->exifData();
			if (exifData.empty()) continue;
		    
			/*
			 * Create the MD5 of the first 4K to use as a unique identifier.
			 */
			sbuf_t tohash(sbuf,0,4096);
			string md5_hex = exif_recorder->fs.hasher.func(tohash.buf,tohash.bufsize);

			char xmlbuf[1024];
			snprintf(xmlbuf,sizeof(xmlbuf),
				 "<exiv2><width>%d</width><height>%d</height>",
				 image->pixelWidth(),image->pixelHeight());

			/* Scan through the fields reported by exiv2.
			 * Create XML for each and extract GPS information if present.
			 */
			string photo_time;	// use this when gps_time is not available
			string gps_time;
			string gps_date;
			string gps_lat_ref;
			string gps_lat;
			string gps_lon_ref;
			string gps_lon;
			string gps_ele;
			string gps_speed;
			string gps_course;

                        bool has_gps = false;
                        bool has_gps_date = false;

			string xml = xmlbuf;
			for (Exiv2::ExifData::const_iterator i = exifData.begin();
			    i != exifData.end(); ++i) {

			    if(i->count()>1000) continue;	// ignore long ones

			    string key = string(i->key());
			    xml.append("<"+key+">"+dfxml_writer::xmlescape(i->value().toString())+"</"+key+">");

                            // use Date from Photo unless date from GPS is available
			    if(key=="Exif.Photo.DateTimeOriginal"){
				photo_time = i->value().toString();

				/* change "2011/06/25 12:20:11" to "2011-06-25 12:20:11" */
				std::transform(photo_time.begin(),photo_time.end(),photo_time.begin(),slash_to_dash);

				/* change "2011:06:25 12:20:11" to "2011-06-25 12:20:11" */
                                if (photo_time[4] == ':') {
                                    photo_time[4] = '-';
                                }
                                if (photo_time[7] == ':') {
                                    photo_time[7] = '-';
//.........这里部分代码省略.........
开发者ID:simsong,项目名称:bulk_extractor,代码行数:101,代码来源:scan_exiv2.cpp

示例11: 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);
    }
}
开发者ID:Morgan243,项目名称:Dynamic-Image-Viewer,代码行数:77,代码来源:tag_handler.cpp


注:本文中的exiv2::exifdata::const_iterator::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。