// This function is executed in another thread at some point after it has been // scheduled. IT MUST NOT USE ANY V8 FUNCTIONALITY. Otherwise your extension // will crash randomly and you'll have a lot of fun debugging. // If you want to use parameters passed into the original call, you have to // convert them to PODs or some other fancy method. virtual void ExecuteNativeCode() { TRACE_FUNCTION; cv::Mat image = m_imageSource->getImage(); if (image.empty()) { SetErrorMessage("Cannot decode image"); return; } AnalyzeImage(image, m_analyzeResult); }
void PreviousImagesManager::LoadImageData(std::shared_ptr<PreviousImageInfo> spPreviousImageInfo) { std::vector<BYTE> vecJpegData; if (!LoadFileBytes(spPreviousImageInfo->Filename(), vecJpegData)) return; ReadJpegImage(spPreviousImageInfo, vecJpegData); AnalyzeImage(spPreviousImageInfo, vecJpegData); { LightweightMutex::LockType lock(m_mtxPreviousImagesList); spPreviousImageInfo->SetLoaded(); m_setCurrentlyLoadingImages.erase(spPreviousImageInfo); CallAndRemoveImageAvailHandlers(spPreviousImageInfo); } }