| 615 | } |
| 616 | |
| 617 | std::vector<unsigned char> RenderWindowBridge::TakeMxNEditorScreenshot( |
| 618 | std::optional<std::pair<int, int>> size, |
| 619 | ScreenshotFormat format) const |
| 620 | { |
| 621 | MxNEditorScreenshotProvider provider; |
| 622 | StorageThreadDispatcherBase::Pointer dispatcher; |
| 623 | { |
| 624 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 625 | provider = m_MxNEditorScreenshotProvider; |
| 626 | dispatcher = m_Dispatcher.Lock(); |
| 627 | } |
| 628 | |
| 629 | if (!provider) |
| 630 | throw std::runtime_error("No MxN editor screenshot provider is connected to the RenderWindowBridge"); |
| 631 | |
| 632 | std::vector<unsigned char> result; |
| 633 | Dispatch(dispatcher, [&]() { result = provider(size, format); }); |
| 634 | return result; |
| 635 | } |
| 636 | |
| 637 | std::vector<unsigned char> RenderWindowBridge::TakeMxNWindowScreenshot( |
| 638 | const std::string& windowId, |