本文整理汇总了C++中NodeMetadata::setColorPlaneNComps方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeMetadata::setColorPlaneNComps方法的具体用法?C++ NodeMetadata::setColorPlaneNComps怎么用?C++ NodeMetadata::setColorPlaneNComps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeMetadata
的用法示例。
在下文中一共展示了NodeMetadata::setColorPlaneNComps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
ActionRetCodeEnum
RotoShapeRenderNode::getTimeInvariantMetadata(NodeMetadata& metadata)
{
assert(_imp->renderType.lock());
RotoShapeRenderTypeEnum type = (RotoShapeRenderTypeEnum)_imp->renderType.lock()->getValue();
int nComps;
if (type == eRotoShapeRenderTypeSolid) {
// If there's an input to the RotoShapeRender node, pass-through the meta-data number of components so that downstream nodes
// have a good default color plane.
// E.g: if we have Constant--> RotoShapeRender --> Merge, we want the Merge to have the number of components of the Constant
EffectInstancePtr inputEffect = getInputRenderEffectAtAnyTimeView(0);
if (inputEffect) {
ImagePlaneDesc inputPlane, paireInputPlane;
inputEffect->getMetadataComponents(-1, &inputPlane, &paireInputPlane);
nComps = inputPlane.getNumComponents();
} else {
nComps = 1;
}
} else {
nComps = 4;
}
metadata.setColorPlaneNComps(-1, nComps);
metadata.setColorPlaneNComps(0, nComps);
// The roto can be sampled at any non integer time
metadata.setIsContinuous(true);
RotoPaintOutputRoDTypeEnum rodType = (RotoPaintOutputRoDTypeEnum)_imp->outputRoDTypeKnob.lock()->getValue();
switch (rodType) {
case eRotoPaintOutputRoDTypeDefault:
// No format is set
break;
case eRotoPaintOutputRoDTypeFormat: {
KnobIntPtr sizeKnob = _imp->outputFormatSizeKnob.lock();
int w = sizeKnob->getValue(DimIdx(0));
int h = _imp->outputFormatSizeKnob.lock()->getValue(DimIdx(1));
double par = _imp->outputFormatParKnob.lock()->getValue();
RectI pixelFormat;
pixelFormat.x1 = pixelFormat.y1 = 0;
pixelFormat.x2 = w;
pixelFormat.y2 = h;
metadata.setPixelAspectRatio(-1, par);
metadata.setOutputFormat(pixelFormat);
} break;
case eRotoPaintOutputRoDTypeProject: {
Format f;
getApp()->getProject()->getProjectDefaultFormat(&f);
metadata.setPixelAspectRatio(-1, f.getPixelAspectRatio());
metadata.setOutputFormat(f);
} break;
}
return eActionStatusOK;
}