avcpp
3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
rect.h
Go to the documentation of this file.
1
#pragma once
2
9
10
namespace
av
{
11
18
class
Rect
19
{
20
public
:
24
Rect
() noexcept = default;
31
Rect
(
int
width,
int
height) noexcept;
40
Rect
(
int
x,
int
y,
int
width,
int
height) noexcept;
41
47
void
setX
(
int
x) noexcept { this->x = x; }
53
void
setY
(
int
y)
noexcept
{ this->y = y; }
59
void
setWidth
(
int
w)
noexcept
{ width = w; }
65
void
setHeight
(
int
h)
noexcept
{ height = h; }
66
72
int
getX
() const noexcept {
return
x; }
78
int
getY
() const noexcept {
return
y; }
84
int
getWidth
() const noexcept {
return
width; }
90
int
getHeight
() const noexcept {
return
height; }
91
92
private
:
93
int
x{};
94
int
y{};
95
int
width{};
96
int
height{};
97
};
98
99
}
// ::av
100
101
#if __has_include(<format>)
102
#include <format>
103
#ifdef __cpp_lib_format
104
// std::format
105
template
<
typename
CharT>
106
struct
std::formatter<
av
::Rect, CharT>
107
{
108
template
<
typename
ParseContext>
109
constexpr
auto
parse(ParseContext& ctx)
110
{
111
return
ctx.begin();
112
}
113
template
<
typename
ParseContext>
114
auto
format(
const
av::Rect& value, ParseContext& ctx)
const
115
{
116
return
std::format_to(ctx.out(),
"{}x{}{:+}{:+}"
, value.
getWidth
(), value.
getHeight
(), value.
getX
(), value.
getY
());
117
}
118
};
119
#endif
// __cpp_lib_format
120
#endif
// __has_include
av::Rect::Rect
Rect() noexcept=default
Create a zero-sized rectangle at the origin.
av::Rect::getY
int getY() const noexcept
The top edge.
Definition
rect.h:78
av::Rect::setHeight
void setHeight(int h) noexcept
Set the height.
Definition
rect.h:65
av::Rect::getWidth
int getWidth() const noexcept
The width.
Definition
rect.h:84
av::Rect::setX
void setX(int x) noexcept
Set the left edge.
Definition
rect.h:47
av::Rect::getX
int getX() const noexcept
The left edge.
Definition
rect.h:72
av::Rect::getHeight
int getHeight() const noexcept
The height.
Definition
rect.h:90
av::Rect::setWidth
void setWidth(int w) noexcept
Set the width.
Definition
rect.h:59
av::Rect::setY
void setY(int y) noexcept
Set the top edge.
Definition
rect.h:53
av
Root namespace of the library.
Definition
audioresampler.h:19
avcpp
rect.h
Generated by
1.18.0