| 393 | } |
| 394 | |
| 395 | std::vector<unsigned char> RenderWindowBridge::TakeScreenshot( |
| 396 | std::optional<std::pair<int, int>> size, |
| 397 | ScreenshotFormat format) const |
| 398 | { |
| 399 | ScreenshotProvider provider; |
| 400 | StorageThreadDispatcherBase::Pointer dispatcher; |
| 401 | { |
| 402 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 403 | provider = m_ScreenshotProvider; |
| 404 | dispatcher = m_Dispatcher.Lock(); |
| 405 | } |
| 406 | |
| 407 | if (!provider) |
| 408 | throw std::runtime_error("No screenshot provider is connected to the RenderWindowBridge"); |
| 409 | |
| 410 | std::vector<unsigned char> result; |
| 411 | Dispatch(dispatcher, [&]() { result = provider(size, format); }); |
| 412 | return result; |
| 413 | } |
| 414 | |
| 415 | SelectedPositionInfo RenderWindowBridge::GetSelectedPosition() const |
| 416 | { |
no test coverage detected