| 635 | } |
| 636 | |
| 637 | std::vector<unsigned char> RenderWindowBridge::TakeMxNWindowScreenshot( |
| 638 | const std::string& windowId, |
| 639 | std::optional<std::pair<int, int>> size, |
| 640 | ScreenshotFormat format) const |
| 641 | { |
| 642 | MxNWindowScreenshotProvider provider; |
| 643 | StorageThreadDispatcherBase::Pointer dispatcher; |
| 644 | { |
| 645 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 646 | provider = m_MxNWindowScreenshotProvider; |
| 647 | dispatcher = m_Dispatcher.Lock(); |
| 648 | } |
| 649 | |
| 650 | if (!provider) |
| 651 | throw std::runtime_error("No MxN window screenshot provider is connected to the RenderWindowBridge"); |
| 652 | |
| 653 | std::vector<unsigned char> result; |
| 654 | Dispatch(dispatcher, [&]() { result = provider(windowId, size, format); }); |
| 655 | return result; |
| 656 | } |
| 657 | |
| 658 | CameraState RenderWindowBridge::GetMxNCamera(const std::string& windowId) const |
| 659 | { |