opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
liboscar
platform
screenshot.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
liboscar/graphics/texture2d.h
>
4
#include <
liboscar/platform/screenshot_annotation.h
>
5
6
#include <span>
7
#include <utility>
8
#include <vector>
9
10
namespace
osc
11
{
12
class
Screenshot
final
{
13
public
:
14
explicit
Screenshot
(
15
Texture2D
texture
,
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
}
osc::Screenshot
Definition
screenshot.h:12
osc::Screenshot::dimensions
Vector2 dimensions() const
Definition
screenshot.h:29
osc::Screenshot::Screenshot
Screenshot(Texture2D texture, std::vector< ScreenshotAnnotation > annotations)
Definition
screenshot.h:14
osc::Screenshot::texture
const Texture2D & texture() const
Definition
screenshot.h:23
osc::Screenshot::annotations
std::span< const ScreenshotAnnotation > annotations() const
Definition
screenshot.h:32
osc::Screenshot::pixel_dimensions
Vector2i pixel_dimensions() const
Definition
screenshot.h:26
osc::Texture2D
Definition
texture2d.h:22
osc::Texture2D::dimensions
Vector2 dimensions() const
osc::Texture2D::pixel_dimensions
Vector2i pixel_dimensions() const
osc::Vector< int, 2 >
osc
Definition
custom_decoration_generator.h:5
osc::to
constexpr U to(T &&value)
Definition
conversion.h:56
screenshot_annotation.h
texture2d.h
Generated by
1.9.8