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


C++ Filter::getName方法代码示例

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


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

示例1: testIsFilterPresent

  void testIsFilterPresent ()
  {
    size_t nbw;
    Filter* filter = Gzip::factory ("GzipFilter");
    MemBuf mb;
    MemoryStream ms (&mb);

    fc->setStream (&ms);

    CPPUNIT_ASSERT_EQUAL (fc->isFilterPresent (filter), 0);
    CPPUNIT_ASSERT_EQUAL (fc->isFilterPresent (filter->getName ()), 0);

    fc->addFilter (filter, &nbw);

    CPPUNIT_ASSERT (fc->isFilterPresent (filter) != 0);
    CPPUNIT_ASSERT (fc->isFilterPresent (filter->getName ()) != 0);
  }
开发者ID:rupinder,项目名称:GNU-MyServer,代码行数:17,代码来源:test_filter_chain.cpp

示例2: reinit

int BufferSrcFilterContext::reinit(const Filter &filter, const string &name)
{
    if (isFilterValid(filter))
    {
        return reinitInt(filter, name);
    }

    clog << "You pass invalid filter for context: " << (filter.isValid() ? filter.getName() : "(null)") << endl;

    return -1;
}
开发者ID:Adenilson,项目名称:avcpp,代码行数:11,代码来源:buffersrc.cpp

示例3: isFilterValid

bool BufferSrcFilterContext::isFilterValid(const Filter &filter)
{
    if (filter.isValid())
    {
        if (filter.getName() == "buffer" ||
            filter.getName() == "abuffer")
        {
            return true;
        }
    }
    return false;
}
开发者ID:Adenilson,项目名称:avcpp,代码行数:12,代码来源:buffersrc.cpp

示例4: pushFilter

void FilterGraph::pushFilter(Filter& filter)
{
    AVFilterContext* context = NULL;
    const int err = avfilter_graph_create_filter(&context, &filter.getAVFilter(), filter.getInstanceName().c_str(),
                                                 filter.getOptions().c_str(), NULL, _graph);
    filter.setAVFilterContext(context);
    if(err < 0)
    {
        std::string msg("Cannot add filter ");
        msg += filter.getName();
        msg += " (instance=";
        msg += filter.getInstanceName();
        msg += ") to the graph: ";
        msg += getDescriptionFromErrorCode(err);
        throw std::runtime_error(msg);
    }
}
开发者ID:avTranscoder,项目名称:avTranscoder,代码行数:17,代码来源:FilterGraph.cpp

示例5: name

// FilterGroup
	FilterElement::FilterElement(Filter& filter, const std::vector<std::string>& _path, QTreeWidget* tree)
	 : name(filter.getName()), path(_path), item(NULL)
	{
		//std::cout << "FilterElement::FilterElement : " << this << std::endl;

		item = new QTreeWidgetItem(NodeFilter);
		item->setData(0, Qt::UserRole, QVariant::fromValue<UniformObject*>( reinterpret_cast<UniformObject*>(NULL) ));

		item->setText(0, tr("%1 [%2]").arg(name.c_str()).arg(filter.getTypeName().c_str()) );

		// List the variables : 
		for(int k=0; k<filter.program().getUniformVarsNames().size(); k++)
		{
			bool processNewItem = true;

			// Omit the variables : 
			/*if(filter.prgm().getUniformVarsNames()[k]=="gl_ModelViewMatrix" || filter.prgm().getUniformVarsNames()[k]=="gl_TextureMatrix[0]")
				objects.push_back( reinterpret_cast<UniformObject*>(new UniformUnknown(filter.prgm().getUniformVarsNames()[k], "(Forbidden)")) );
			else*/

			if( filter.program().isValid( filter.program().getUniformVarsNames()[k] ) )
			{
				switch(filter.program().getUniformVarsTypes()[k])
				{
					case GL_INT : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_INT, 1, 1, false)) );				
						break;
					case GL_INT_VEC2 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_INT_VEC2, 1, 2, false)) );				
						break;
					case GL_INT_VEC3 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_INT_VEC3, 1, 3, false)) );				
						break;
					case GL_INT_VEC4 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_INT_VEC4, 1, 4, false)) );				
						break;
					case GL_UNSIGNED_INT : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_UNSIGNED_INT, 1, 1, true)) );				
						break;
					case GL_UNSIGNED_INT_VEC2 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_UNSIGNED_INT_VEC2, 1, 2, true)) );				
						break;
					case GL_UNSIGNED_INT_VEC3 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_UNSIGNED_INT_VEC3, 1, 3, true)) );				
						break;
					case GL_UNSIGNED_INT_VEC4 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformInteger(filter.program().getUniformVarsNames()[k], GL_UNSIGNED_INT_VEC4, 1, 4, true)) );				
						break;
					case GL_FLOAT : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT, 1, 1)) );				
						break;
					case GL_FLOAT_VEC2 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT_VEC2, 1, 2)) );				
						break;
					case GL_FLOAT_VEC3 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT_VEC3, 1, 3)) );				
						break;
					case GL_FLOAT_VEC4 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT_VEC4, 1, 4)) );				
						break;
					case GL_FLOAT_MAT2 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT_MAT2, 2, 2)) );				
						break;
					case GL_FLOAT_MAT3 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT_MAT3, 3, 3)) );				
						break;
					case GL_FLOAT_MAT4 : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformFloat(filter.program().getUniformVarsNames()[k], GL_FLOAT_MAT4, 4, 4)) );	
						break;
					default : 
						objects.push_back( reinterpret_cast<UniformObject*>(new UniformUnknown(filter.program().getUniformVarsNames()[k], tr("Unable to generate interface for type %1").arg(glParamName(filter.program().getUniformVarsTypes()[k]).c_str()))) );
				}

				objects.back()->read(filter.program());

				item->addChild( objects.back()->treeItem() );
				
				tree->setItemWidget( objects.back()->treeItem(), 1, objects.back() );

				QObject::connect( objects.back(), SIGNAL(updated(void)), this, SIGNAL(updated(void)) );
				QObject::connect( this, SIGNAL(propagateSettings(BoxesSettings&)), objects.back(), SLOT(applySettings(BoxesSettings&)));
			}
		}
	}
开发者ID:headupinclouds,项目名称:GLIP-Lib,代码行数:85,代码来源:uniformsTab.cpp


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