本文整理汇总了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());
}
}
}
示例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));
}
示例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;
//.........这里部分代码省略.........
示例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();
//.........这里部分代码省略.........