Exemplo n.º 1
0
bool ColorProducer::Initialize(FrameManagerPtr pFrameManager) {
	if(pFrameManager != 0) {
		FramePtr pFrame = pFrameManager->CreateFrame();
		if(pFrame != 0)	{
			memset_d(reinterpret_cast<unsigned long*>(pFrame->GetDataPtr()), colorValue_, pFrame->GetDataSize() / sizeof(unsigned long));
			frameBuffer_.push_back(pFrame);
			return true;
		}
	}
	return false;
}
Exemplo n.º 2
0
bool TargaProducer::Initialize(FrameManagerPtr pFrameManager) {
	if(pFrameManager != 0) {
		FramePtr pFrame = pFrameManager->CreateFrame();
		if(pFrame != 0 && pFrame->GetDataPtr() != 0) {
			PixmapDataPtr pResult = TargaManager::CropPadToFrameFormat(pImage_, pFrameManager->GetFrameFormatDescription());

			unsigned char* pFrameData = pFrame->GetDataPtr();
			unsigned char* pImageData = pResult->GetDataPtr();

			memcpy(pFrameData, pImageData, pFrame->GetDataSize());

			frameBuffer_.push_back(pFrame);
			return true;
		}
	}
	return false;
}