本文整理汇总了C++中NodeOperation::determineResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeOperation::determineResolution方法的具体用法?C++ NodeOperation::determineResolution怎么用?C++ NodeOperation::determineResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeOperation
的用法示例。
在下文中一共展示了NodeOperation::determineResolution方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: determineResolutions
void NodeOperationBuilder::determineResolutions()
{
/* determine all resolutions of the operations (Width/Height) */
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) {
unsigned int resolution[2] = {0, 0};
unsigned int preferredResolution[2] = {0, 0};
op->determineResolution(resolution, preferredResolution);
op->setResolution(resolution);
}
}
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) {
unsigned int resolution[2] = {0, 0};
unsigned int preferredResolution[2] = {0, 0};
op->determineResolution(resolution, preferredResolution);
op->setResolution(resolution);
}
}
/* add convert resolution operations when needed */
{
Links convert_links;
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
const Link &link = *it;
if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) {
NodeOperation &from_op = link.from()->getOperation();
NodeOperation &to_op = link.to()->getOperation();
if (from_op.getWidth() != to_op.getWidth() || from_op.getHeight() != to_op.getHeight())
convert_links.push_back(link);
}
}
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
const Link &link = *it;
Converter::convertResolution(*this, link.from(), link.to());
}
}
}
示例2: determineResolution
void OutputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
NodeBase *node = this->getNode();
if (node->isOperation()) {
NodeOperation *operation = (NodeOperation *)node;
if (operation->isResolutionSet()) {
resolution[0] = operation->getWidth();
resolution[1] = operation->getHeight();
}
else {
operation->determineResolution(resolution, preferredResolution);
operation->setResolution(resolution);
}
}
}