FrameManagerPtr FrameManager::instance() { static FrameManagerWPtr instw; FrameManagerPtr inst = instw.lock(); if (!inst) { inst.reset(new FrameManager); instw = inst; } return inst; }
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; }
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; }