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


C++ NodeOperation::determineDependingAreaOfInterest方法代码示例

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


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

示例1: determineDependingAreaOfInterest

bool DisplaceSimpleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
	rcti colorInput;
	NodeOperation *operation = NULL;

	/* the vector buffer only needs a 2x2 buffer. The image needs whole buffer */
	/* image */
	operation = getInputOperation(0);
	colorInput.xmax = operation->getWidth();
	colorInput.xmin = 0;
	colorInput.ymax = operation->getHeight();
	colorInput.ymin = 0;
	if (operation->determineDependingAreaOfInterest(&colorInput, readOperation, output)) {
		return true;
	}

	/* vector */
	if (operation->determineDependingAreaOfInterest(input, readOperation, output)) {
		return true;
	}

	/* scale x */
	operation = getInputOperation(2);
	if (operation->determineDependingAreaOfInterest(input, readOperation, output) ) {
		return true;
	}

	/* scale y */
	operation = getInputOperation(3);
	if (operation->determineDependingAreaOfInterest(input, readOperation, output) ) {
		return true;
	}

	return false;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:35,代码来源:COM_DisplaceSimpleOperation.cpp

示例2: determineDependingAreaOfInterest

bool BokehBlurOperation::determineDependingAreaOfInterest(rcti *input,
                                                          ReadBufferOperation *readOperation,
                                                          rcti *output)
{
  rcti newInput;
  rcti bokehInput;
  const float max_dim = max(this->getWidth(), this->getHeight());

  if (this->m_sizeavailable) {
    newInput.xmax = input->xmax + (this->m_size * max_dim / 100.0f);
    newInput.xmin = input->xmin - (this->m_size * max_dim / 100.0f);
    newInput.ymax = input->ymax + (this->m_size * max_dim / 100.0f);
    newInput.ymin = input->ymin - (this->m_size * max_dim / 100.0f);
  }
  else {
    newInput.xmax = input->xmax + (10.0f * max_dim / 100.0f);
    newInput.xmin = input->xmin - (10.0f * max_dim / 100.0f);
    newInput.ymax = input->ymax + (10.0f * max_dim / 100.0f);
    newInput.ymin = input->ymin - (10.0f * max_dim / 100.0f);
  }

  NodeOperation *operation = getInputOperation(1);
  bokehInput.xmax = operation->getWidth();
  bokehInput.xmin = 0;
  bokehInput.ymax = operation->getHeight();
  bokehInput.ymin = 0;
  if (operation->determineDependingAreaOfInterest(&bokehInput, readOperation, output)) {
    return true;
  }
  operation = getInputOperation(0);
  if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output)) {
    return true;
  }
  operation = getInputOperation(2);
  if (operation->determineDependingAreaOfInterest(input, readOperation, output)) {
    return true;
  }
  if (!this->m_sizeavailable) {
    rcti sizeInput;
    sizeInput.xmin = 0;
    sizeInput.ymin = 0;
    sizeInput.xmax = 5;
    sizeInput.ymax = 5;
    operation = getInputOperation(3);
    if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
      return true;
    }
  }
  return false;
}
开发者ID:dfelinto,项目名称:blender,代码行数:50,代码来源:COM_BokehBlurOperation.cpp

示例3: determineDependingAreaOfInterest

bool GaussianAlphaYBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
	rcti newInput;
#if 0 /* until we add size input */
	rcti sizeInput;
	sizeInput.xmin = 0;
	sizeInput.ymin = 0;
	sizeInput.xmax = 5;
	sizeInput.ymax = 5;

	NodeOperation *operation = this->getInputOperation(1);
	if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
		return true;
	}
	else
#endif
	{
		if (this->m_sizeavailable && this->m_gausstab != NULL) {
			newInput.xmax = input->xmax;
			newInput.xmin = input->xmin;
			newInput.ymax = input->ymax + this->m_rad + 1;
			newInput.ymin = input->ymin - this->m_rad - 1;
		}
		else {
			newInput.xmax = this->getWidth();
			newInput.xmin = 0;
			newInput.ymax = this->getHeight();
			newInput.ymin = 0;
		}
		return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
	}
}
开发者ID:castlelore,项目名称:blender-git,代码行数:32,代码来源:COM_GaussianAlphaYBlurOperation.cpp

示例4: determineDependingAreaOfInterest

bool NodeOperation::determineDependingAreaOfInterest(rcti *input,
                                                     ReadBufferOperation *readOperation,
                                                     rcti *output)
{
  if (isInputOperation()) {
    BLI_rcti_init(output, input->xmin, input->xmax, input->ymin, input->ymax);
    return false;
  }
  else {
    rcti tempOutput;
    bool first = true;
    for (int i = 0; i < getNumberOfInputSockets(); i++) {
      NodeOperation *inputOperation = this->getInputOperation(i);
      if (inputOperation &&
          inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
        if (first) {
          output->xmin = tempOutput.xmin;
          output->ymin = tempOutput.ymin;
          output->xmax = tempOutput.xmax;
          output->ymax = tempOutput.ymax;
          first = false;
        }
        else {
          output->xmin = min(output->xmin, tempOutput.xmin);
          output->ymin = min(output->ymin, tempOutput.ymin);
          output->xmax = max(output->xmax, tempOutput.xmax);
          output->ymax = max(output->ymax, tempOutput.ymax);
        }
      }
    }
    return !first;
  }
}
开发者ID:dfelinto,项目名称:blender,代码行数:33,代码来源:COM_NodeOperation.cpp

示例5: determineDependingAreaOfInterest

bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti * /*input*/, ReadBufferOperation *readOperation, rcti *output)
{
	rcti newInput;
	rcti sizeInput;
	sizeInput.xmin = 0;
	sizeInput.ymin = 0;
	sizeInput.xmax = 5;
	sizeInput.ymax = 5;

	NodeOperation *operation = this->getInputOperation(1);
	if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
		return true;
	}
	else {
		if (this->m_iirgaus) {
			return false;
		}
		else {
			newInput.xmin = 0;
			newInput.ymin = 0;
			newInput.xmax = this->getWidth();
			newInput.ymax = this->getHeight();
		}
		return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
	}
}
开发者ID:wchargin,项目名称:blender,代码行数:26,代码来源:COM_FastGaussianBlurOperation.cpp

示例6: determineDependingAreaOfInterest

bool GaussianXBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
	rcti newInput;
	
	if (!this->m_sizeavailable) {
		rcti sizeInput;
		sizeInput.xmin = 0;
		sizeInput.ymin = 0;
		sizeInput.xmax = 5;
		sizeInput.ymax = 5;
		NodeOperation *operation = this->getInputOperation(1);
		if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
			return true;
		}
	}
	{
		if (this->m_sizeavailable && this->m_gausstab != NULL) {
			newInput.xmax = input->xmax + this->m_filtersize + 1;
			newInput.xmin = input->xmin - this->m_filtersize - 1;
			newInput.ymax = input->ymax;
			newInput.ymin = input->ymin;
		}
		else {
			newInput.xmax = this->getWidth();
			newInput.xmin = 0;
			newInput.ymax = this->getHeight();
			newInput.ymin = 0;
		}
		return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
	}
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:31,代码来源:COM_GaussianXBlurOperation.cpp

示例7: determineDependingAreaOfInterest

bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
	rcti newInput;
	rcti bokehInput;

	const float max_dim = max(m_width, m_height);
	const float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f;
	int maxBlurScalar = this->m_maxBlur * scalar;

	newInput.xmax = input->xmax + maxBlurScalar + 2;
	newInput.xmin = input->xmin - maxBlurScalar + 2;
	newInput.ymax = input->ymax + maxBlurScalar - 2;
	newInput.ymin = input->ymin - maxBlurScalar - 2;
	bokehInput.xmax = COM_BLUR_BOKEH_PIXELS;
	bokehInput.xmin = 0;
	bokehInput.ymax = COM_BLUR_BOKEH_PIXELS;
	bokehInput.ymin = 0;
	

	NodeOperation *operation = getInputOperation(2);
	if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) {
		return true;
	}
	operation = getInputOperation(1);
	if (operation->determineDependingAreaOfInterest(&bokehInput, readOperation, output) ) {
		return true;
	}
#ifdef COM_DEFOCUS_SEARCH
	rcti searchInput;
	searchInput.xmax = (input->xmax / InverseSearchRadiusOperation::DIVIDER) + 1;
	searchInput.xmin = (input->xmin / InverseSearchRadiusOperation::DIVIDER) - 1;
	searchInput.ymax = (input->ymax / InverseSearchRadiusOperation::DIVIDER) + 1;
	searchInput.ymin = (input->ymin / InverseSearchRadiusOperation::DIVIDER) - 1;
	operation = getInputOperation(3);
	if (operation->determineDependingAreaOfInterest(&searchInput, readOperation, output) ) {
		return true;
	}
#endif
	operation = getInputOperation(0);
	if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) {
		return true;
	}
	return false;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:44,代码来源:COM_VariableSizeBokehBlurOperation.cpp

示例8: determineDependingAreaOfInterest

bool AntiAliasOperation::determineDependingAreaOfInterest(
        rcti *input,
        ReadBufferOperation *readOperation,
        rcti *output)
{
	rcti imageInput;
	NodeOperation *operation = getInputOperation(0);
	imageInput.xmax = input->xmax + 1;
	imageInput.xmin = input->xmin - 1;
	imageInput.ymax = input->ymax + 1;
	imageInput.ymin = input->ymin - 1;
	return operation->determineDependingAreaOfInterest(&imageInput,
	                                                   readOperation,
	                                                   output);
}
开发者ID:DarkDefender,项目名称:blender-npr-tess2,代码行数:15,代码来源:COM_AntiAliasOperation.cpp

示例9: determineDependingAreaOfInterest

bool AntiAliasOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
	rcti imageInput;
	if (this->m_buffer) {
		return false;
	}
	else {
		NodeOperation *operation = getInputOperation(0);
		imageInput.xmax = operation->getWidth();
		imageInput.xmin = 0;
		imageInput.ymax = operation->getHeight();
		imageInput.ymin = 0;
		if (operation->determineDependingAreaOfInterest(&imageInput, readOperation, output) ) {
			return true;
		}
	}
	return false;
}
开发者ID:BlueLabelStudio,项目名称:blender,代码行数:18,代码来源:COM_AntiAliasOperation.cpp

示例10: determineDependingAreaOfInterest

bool CombineChannelsOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) 
{
	rcti tempOutput;
	bool first = true;
	for (int i = 0 ; i < 4 ; i ++) {
		NodeOperation * inputOperation = this->getInputOperation(i);
		if (inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
			if (first) {
				output->xmin = tempOutput.xmin;
				output->ymin = tempOutput.ymin;
				output->xmax = tempOutput.xmax;
				output->ymax = tempOutput.ymax;
				first = false;
			} else {
				output->xmin = MIN2(output->xmin, tempOutput.xmin);
				output->ymin = MIN2(output->ymin, tempOutput.ymin);
				output->xmax = MAX2(output->xmax, tempOutput.xmax);
				output->ymax = MAX2(output->ymax, tempOutput.ymax);
			}
		}
	}
	return !first;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:23,代码来源:COM_CombineChannelsOperation.cpp

示例11: determineDependingAreaOfInterest

bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
	rcti newInputValue;
	newInputValue.xmin = 0;
	newInputValue.ymin = 0;
	newInputValue.xmax = 2;
	newInputValue.ymax = 2;
	
	NodeOperation *operation = getInputOperation(1);
	if (operation->determineDependingAreaOfInterest(&newInputValue, readOperation, output) ) {
		return true;
	}

	operation = getInputOperation(2);
	if (operation->determineDependingAreaOfInterest(&newInputValue, readOperation, output) ) {
		return true;
	}
	
	/* XXX the original method of estimating the area-of-interest does not work
	 * it assumes a linear increase/decrease of mapped coordinates, which does not
	 * yield correct results for the area and leaves uninitialized buffer areas.
	 * So now just use the full image area, which may not be as efficient but works at least ...
	 */
#if 1
	rcti imageInput;
	
	operation = getInputOperation(0);
	imageInput.xmax = operation->getWidth();
	imageInput.xmin = 0;
	imageInput.ymax = operation->getHeight();
	imageInput.ymin = 0;

	if (operation->determineDependingAreaOfInterest(&imageInput, readOperation, output) ) {
		return true;
	}
	return false;
#else
	rcti newInput;
	const float margin = 2;
	
	BLI_rcti_init_minmax(&newInput);
	
	if (m_dispersion_const && m_distortion_const) {
		/* update from fixed distortion/dispersion */
#define UPDATE_INPUT(x, y) \
		{ \
			float coords[6]; \
			determineUV(coords, x, y); \
			newInput.xmin = min_ffff(newInput.xmin, coords[0], coords[2], coords[4]); \
			newInput.ymin = min_ffff(newInput.ymin, coords[1], coords[3], coords[5]); \
			newInput.xmax = max_ffff(newInput.xmax, coords[0], coords[2], coords[4]); \
			newInput.ymax = max_ffff(newInput.ymax, coords[1], coords[3], coords[5]); \
		} (void)0

		UPDATE_INPUT(input->xmin, input->xmax);
		UPDATE_INPUT(input->xmin, input->ymax);
		UPDATE_INPUT(input->xmax, input->ymax);
		UPDATE_INPUT(input->xmax, input->ymin);

#undef UPDATE_INPUT
	}
	else {
		/* use maximum dispersion 1.0 if not const */
		float dispersion = m_dispersion_const ? m_dispersion : 1.0f;

#define UPDATE_INPUT(x, y, distortion) \
		{ \
			float coords[6]; \
			updateVariables(distortion, dispersion); \
			determineUV(coords, x, y); \
			newInput.xmin = min_ffff(newInput.xmin, coords[0], coords[2], coords[4]); \
			newInput.ymin = min_ffff(newInput.ymin, coords[1], coords[3], coords[5]); \
			newInput.xmax = max_ffff(newInput.xmax, coords[0], coords[2], coords[4]); \
			newInput.ymax = max_ffff(newInput.ymax, coords[1], coords[3], coords[5]); \
		} (void)0
		
		if (m_distortion_const) {
			/* update from fixed distortion */
			UPDATE_INPUT(input->xmin, input->xmax, m_distortion);
			UPDATE_INPUT(input->xmin, input->ymax, m_distortion);
			UPDATE_INPUT(input->xmax, input->ymax, m_distortion);
			UPDATE_INPUT(input->xmax, input->ymin, m_distortion);
		}
		else {
			/* update from min/max distortion (-1..1) */
			UPDATE_INPUT(input->xmin, input->xmax, -1.0f);
			UPDATE_INPUT(input->xmin, input->ymax, -1.0f);
			UPDATE_INPUT(input->xmax, input->ymax, -1.0f);
			UPDATE_INPUT(input->xmax, input->ymin, -1.0f);

			UPDATE_INPUT(input->xmin, input->xmax, 1.0f);
			UPDATE_INPUT(input->xmin, input->ymax, 1.0f);
			UPDATE_INPUT(input->xmax, input->ymax, 1.0f);
			UPDATE_INPUT(input->xmax, input->ymin, 1.0f);

#undef UPDATE_INPUT
		}
	}

	newInput.xmin -= margin;
//.........这里部分代码省略.........
开发者ID:BlueLabelStudio,项目名称:blender,代码行数:101,代码来源:COM_ScreenLensDistortionOperation.cpp


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