yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
screenshot_utils.h
Go to the documentation of this file.
1#ifndef YAZE_APP_CORE_SERVICE_SCREENSHOT_UTILS_H_
2#define YAZE_APP_CORE_SERVICE_SCREENSHOT_UTILS_H_
3
4#ifdef YAZE_WITH_GRPC
5
6#include <optional>
7#include <string>
8
9#include "absl/status/statusor.h"
10
11namespace yaze {
12namespace test {
13
14struct ScreenshotArtifact {
15 std::string file_path;
16 int width = 0;
17 int height = 0;
18 int64_t file_size_bytes = 0;
19};
20
21struct CaptureRegion {
22 int x = 0;
23 int y = 0;
24 int width = 0;
25 int height = 0;
26};
27
28// Captures the current renderer output into a BMP file.
29// If preferred_path is empty, an appropriate path under the system temp
30// directory is generated automatically. Returns the resolved artifact metadata
31// on success.
32absl::StatusOr<ScreenshotArtifact> CaptureHarnessScreenshot(
33 const std::string& preferred_path = "");
34
35// Captures a specific region of the renderer output.
36// If region is nullopt, captures the full renderer (same as CaptureHarnessScreenshot).
37absl::StatusOr<ScreenshotArtifact> CaptureHarnessScreenshotRegion(
38 const std::optional<CaptureRegion>& region,
39 const std::string& preferred_path = "");
40
41// Captures the currently active ImGui window.
42absl::StatusOr<ScreenshotArtifact> CaptureActiveWindow(
43 const std::string& preferred_path = "");
44
45// Captures a specific ImGui window by name.
46absl::StatusOr<ScreenshotArtifact> CaptureWindowByName(
47 const std::string& window_name,
48 const std::string& preferred_path = "");
49
50} // namespace test
51} // namespace yaze
52
53#endif // YAZE_WITH_GRPC
54#endif // YAZE_APP_CORE_SERVICE_SCREENSHOT_UTILS_H_
Main namespace for the application.
Definition controller.cc:20