opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
screenshot.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <span>
7#include <utility>
8#include <vector>
9
10namespace osc
11{
13 public:
14 explicit Screenshot(
16 std::vector<ScreenshotAnnotation> annotations) :
17
18 texture_{std::move(texture)},
19 annotations_{std::move(annotations)}
20 {}
21
22 // Returns a texture that represents the content of the screenshot.
23 const Texture2D& texture() const { return texture_; }
24
25 // Returns the dimensions of the screenshot in physical pixels.
26 Vector2i pixel_dimensions() const { return texture_.pixel_dimensions(); }
27
28 // Returns the dimensions of the screenshot in device-independent pixels.
29 Vector2 dimensions() const { return texture_.dimensions(); }
30
31 // Returns a sequence of annotations (metadata) associated with the screenshot.
32 std::span<const ScreenshotAnnotation> annotations() const { return annotations_; }
33
34 private:
35 Texture2D texture_;
36 std::vector<ScreenshotAnnotation> annotations_;
37 };
38}
Definition screenshot.h:12
Vector2 dimensions() const
Definition screenshot.h:29
Screenshot(Texture2D texture, std::vector< ScreenshotAnnotation > annotations)
Definition screenshot.h:14
const Texture2D & texture() const
Definition screenshot.h:23
std::span< const ScreenshotAnnotation > annotations() const
Definition screenshot.h:32
Vector2i pixel_dimensions() const
Definition screenshot.h:26
Definition texture2d.h:22
Vector2 dimensions() const
Vector2i pixel_dimensions() const
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56