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


C++ MemoryBuffer::copyContentFrom方法代码示例

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


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

示例1: MemoryBuffer

MemoryBuffer *ExecutionGroup::constructConsolidatedMemoryBuffer(MemoryProxy *memoryProxy, rcti *rect)
{
	MemoryBuffer *imageBuffer = memoryProxy->getBuffer();
	MemoryBuffer *result = new MemoryBuffer(memoryProxy, rect);
	result->copyContentFrom(imageBuffer);
	return result;
}
开发者ID:wchargin,项目名称:blender,代码行数:7,代码来源:COM_ExecutionGroup.cpp

示例2: getMaximumValue

float MemoryBuffer::getMaximumValue(rcti *rect)
{
	rcti rect_clamp;

	/* first clamp the rect by the bounds or we get un-initialized values */
	BLI_rcti_isect(rect, &this->m_rect, &rect_clamp);

	if (!BLI_rcti_is_empty(&rect_clamp)) {
		MemoryBuffer *temp = new MemoryBuffer(NULL, &rect_clamp);
		temp->copyContentFrom(this);
		float result = temp->getMaximumValue();
		delete temp;
		return result;
	}
	else {
		BLI_assert(0);
		return 0.0f;
	}
}
开发者ID:JT-a,项目名称:blender-lukas_t,代码行数:19,代码来源:COM_MemoryBuffer.cpp

示例3: getDAI

void *FastGaussianBlurOperation::initializeTileData(rcti *rect)
{
#if 0
	lockMutex();
	if (!this->m_iirgaus) {
		MemoryBuffer *newBuf = (MemoryBuffer *)this->m_inputProgram->initializeTileData(rect);
		MemoryBuffer *copy = newBuf->duplicate();
		updateSize();

		int c;
		this->m_sx = this->m_data->sizex * this->m_size / 2.0f;
		this->m_sy = this->m_data->sizey * this->m_size / 2.0f;
		
		if ((this->m_sx == this->m_sy) && (this->m_sx > 0.f)) {
			for (c = 0; c < COM_NUMBER_OF_CHANNELS; ++c)
				IIR_gauss(copy, this->m_sx, c, 3);
		}
		else {
			if (this->m_sx > 0.0f) {
				for (c = 0; c < COM_NUMBER_OF_CHANNELS; ++c)
					IIR_gauss(copy, this->m_sx, c, 1);
			}
			if (this->m_sy > 0.0f) {
				for (c = 0; c < COM_NUMBER_OF_CHANNELS; ++c)
					IIR_gauss(copy, this->m_sy, c, 2);
			}
		}
		this->m_iirgaus = copy;
	}
	unlockMutex();
	return this->m_iirgaus;
#else

	lockMutex();
	if (this->m_iirgaus) {
		// if this->m_iirgaus is set, we don't do tile rendering, so
		// we can return the already calculated cache
		unlockMutex();
		return this->m_iirgaus;
	}
	updateSize();
	rcti dai;
	bool use_tiles = getDAI(rect, &dai);
	if (use_tiles) {
		unlockMutex();
	}

	MemoryBuffer *buffer = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
	rcti *buf_rect = buffer->getRect();

	dai.xmin = max(dai.xmin, buf_rect->xmin);
	dai.xmax = min(dai.xmax, buf_rect->xmax);
	dai.ymin = max(dai.ymin, buf_rect->ymin);
	dai.ymax = min(dai.ymax, buf_rect->ymax);

	MemoryBuffer *tile = new MemoryBuffer(NULL, &dai);
	tile->copyContentFrom(buffer);

	int c;
	float sx = this->m_data->sizex * this->m_size / 2.0f;
	float sy = this->m_data->sizey * this->m_size / 2.0f;

	if ((sx == sy) && (sx > 0.f)) {
		for (c = 0; c < COM_NUMBER_OF_CHANNELS; ++c)
			IIR_gauss(tile, sx, c, 3);
	}
	else {
		if (sx > 0.0f) {
			for (c = 0; c < COM_NUMBER_OF_CHANNELS; ++c)
				IIR_gauss(tile, sx, c, 1);
		}
		if (sy > 0.0f) {
			for (c = 0; c < COM_NUMBER_OF_CHANNELS; ++c)
				IIR_gauss(tile, sy, c, 2);
		}
	}
	if (!use_tiles) {
		this->m_iirgaus = tile;
		unlockMutex();
	}
	return tile;
#endif
}
开发者ID:Eibriel,项目名称:kiriblender,代码行数:83,代码来源:COM_FastGaussianBlurOperation.cpp


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