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


C++ CompositorContext::getQuality方法代码示例

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


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

示例1: convertToOperations

void BokehBlurNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{
	bNode *b_node = this->getbNode();

	NodeInput *inputSizeSocket = this->getInputSocket(2);

	bool connectedSizeSocket = inputSizeSocket->isLinked();
	const bool extend_bounds = (b_node->custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS) != 0;

	if ((b_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) && connectedSizeSocket) {
		VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
		operation->setQuality(context.getQuality());
		operation->setThreshold(0.0f);
		operation->setMaxBlur(b_node->custom4);
		operation->setDoScaleSize(true);
		
		converter.addOperation(operation);
		converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
		converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
		converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2));
		converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());
	}
	else {
		BokehBlurOperation *operation = new BokehBlurOperation();
		operation->setQuality(context.getQuality());
		operation->setExtendBounds(extend_bounds);
		
		converter.addOperation(operation);
		converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
		converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));

		// NOTE: on the bokeh blur operation the sockets are switched.
		// for this reason the next two lines are correct.
		// Fix for T43771
		converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(3));
		converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(2));

		converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket());

		if (!connectedSizeSocket) {
			operation->setSize(this->getInputSocket(2)->getEditorValueFloat());
		}
	}
}
开发者ID:DarkDefender,项目名称:blender-npr-tess2,代码行数:44,代码来源:COM_BokehBlurNode.cpp

示例2: convertToOperations

void BilateralBlurNode::convertToOperations(NodeConverter &converter,
                                            const CompositorContext &context) const
{
  NodeBilateralBlurData *data = (NodeBilateralBlurData *)this->getbNode()->storage;
  BilateralBlurOperation *operation = new BilateralBlurOperation();
  operation->setQuality(context.getQuality());
  operation->setData(data);

  converter.addOperation(operation);
  converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
  converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
  converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
}
开发者ID:dfelinto,项目名称:blender,代码行数:13,代码来源:COM_BilateralBlurNode.cpp

示例3: convertToOperations

void BlurNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{
	bNode *editorNode = this->getbNode();
	NodeBlurData *data = (NodeBlurData *)editorNode->storage;
	NodeInput *inputSizeSocket = this->getInputSocket(1);
	bool connectedSizeSocket = inputSizeSocket->isLinked();

	const float size = this->getInputSocket(1)->getEditorValueFloat();
	
	CompositorQuality quality = context.getQuality();
	NodeOperation *input_operation = NULL, *output_operation = NULL;

	if (data->filtertype == R_FILTER_FAST_GAUSS) {
		FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation();
		operationfgb->setData(data);
		converter.addOperation(operationfgb);
		
		converter.mapInputSocket(getInputSocket(1), operationfgb->getInputSocket(1));
		
		input_operation = operationfgb;
		output_operation = operationfgb;
	}
	else if (editorNode->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) {
		MathAddOperation *clamp = new MathAddOperation();
		SetValueOperation *zero = new SetValueOperation();
		zero->setValue(0.0f);
		clamp->setUseClamp(true);
		
		converter.addOperation(clamp);
		converter.addOperation(zero);
		converter.mapInputSocket(getInputSocket(1), clamp->getInputSocket(0));
		converter.addLink(zero->getOutputSocket(), clamp->getInputSocket(1));
		
		GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation();
		operationx->setData(data);
		operationx->setQuality(quality);
		operationx->setSize(1.0f);
		operationx->setFalloff(PROP_SMOOTH);
		operationx->setSubtract(false);
		
		converter.addOperation(operationx);
		converter.addLink(clamp->getOutputSocket(), operationx->getInputSocket(0));
		
		GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
		operationy->setData(data);
		operationy->setQuality(quality);
		operationy->setSize(1.0f);
		operationy->setFalloff(PROP_SMOOTH);
		operationy->setSubtract(false);
		
		converter.addOperation(operationy);
		converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
		
		GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation();
		operation->setData(data);
		operation->setQuality(quality);
		
		converter.addOperation(operation);
		converter.addLink(operationy->getOutputSocket(), operation->getInputSocket(1));
		
		output_operation = operation;
		input_operation = operation;
	}
	else if (!data->bokeh) {
		GaussianXBlurOperation *operationx = new GaussianXBlurOperation();
		operationx->setData(data);
		operationx->setQuality(quality);
		
		converter.addOperation(operationx);
		converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1));
		
		GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
		operationy->setData(data);
		operationy->setQuality(quality);

		converter.addOperation(operationy);
		converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1));
		converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));

		if (!connectedSizeSocket) {
			operationx->setSize(size);
			operationy->setSize(size);
		}

		input_operation = operationx;
		output_operation = operationy;
	}
	else {
		GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation();
		operation->setData(data);
		operation->setQuality(quality);
		
		converter.addOperation(operation);
		converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));

		if (!connectedSizeSocket) {
			operation->setSize(size);
		}

		input_operation = operation;
//.........这里部分代码省略.........
开发者ID:floored,项目名称:blender,代码行数:101,代码来源:COM_BlurNode.cpp

示例4: convertToOperations

void DilateErodeNode::convertToOperations(NodeConverter &converter,
                                          const CompositorContext &context) const
{

  bNode *editorNode = this->getbNode();
  if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) {
    DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation();
    operation->setDistance(editorNode->custom2);
    operation->setInset(editorNode->custom3);
    converter.addOperation(operation);

    converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));

    if (editorNode->custom3 < 2.0f) {
      AntiAliasOperation *antiAlias = new AntiAliasOperation();
      converter.addOperation(antiAlias);

      converter.addLink(operation->getOutputSocket(), antiAlias->getInputSocket(0));
      converter.mapOutputSocket(getOutputSocket(0), antiAlias->getOutputSocket(0));
    }
    else {
      converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
    }
  }
  else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) {
    if (editorNode->custom2 > 0) {
      DilateDistanceOperation *operation = new DilateDistanceOperation();
      operation->setDistance(editorNode->custom2);
      converter.addOperation(operation);

      converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
      converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
    }
    else {
      ErodeDistanceOperation *operation = new ErodeDistanceOperation();
      operation->setDistance(-editorNode->custom2);
      converter.addOperation(operation);

      converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
      converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
    }
  }
  else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_FEATHER) {
    /* this uses a modified gaussian blur function otherwise its far too slow */
    CompositorQuality quality = context.getQuality();

    GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation();
    operationx->setData(&m_alpha_blur);
    operationx->setQuality(quality);
    operationx->setFalloff(PROP_SMOOTH);
    converter.addOperation(operationx);

    converter.mapInputSocket(getInputSocket(0), operationx->getInputSocket(0));
    // converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); // no size input
    // yet

    GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
    operationy->setData(&m_alpha_blur);
    operationy->setQuality(quality);
    operationy->setFalloff(PROP_SMOOTH);
    converter.addOperation(operationy);

    converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
    // converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1)); // no size input
    // yet
    converter.mapOutputSocket(getOutputSocket(0), operationy->getOutputSocket());

    converter.addPreview(operationy->getOutputSocket());

    /* TODO? */
    /* see gaussian blue node for original usage */
#if 0
    if (!connectedSizeSocket) {
      operationx->setSize(size);
      operationy->setSize(size);
    }
#else
    operationx->setSize(1.0f);
    operationy->setSize(1.0f);
#endif
    operationx->setSubtract(editorNode->custom2 < 0);
    operationy->setSubtract(editorNode->custom2 < 0);

    if (editorNode->storage) {
      NodeDilateErode *data_storage = (NodeDilateErode *)editorNode->storage;
      operationx->setFalloff(data_storage->falloff);
      operationy->setFalloff(data_storage->falloff);
    }
  }
  else {
    if (editorNode->custom2 > 0) {
      DilateStepOperation *operation = new DilateStepOperation();
      operation->setIterations(editorNode->custom2);
      converter.addOperation(operation);

      converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
      converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0));
    }
    else {
      ErodeStepOperation *operation = new ErodeStepOperation();
//.........这里部分代码省略.........
开发者ID:dfelinto,项目名称:blender,代码行数:101,代码来源:COM_DilateErodeNode.cpp


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