Mir
Loading...
Searching...
No Matches
dimensions.h
Go to the documentation of this file.
1/*
2 * Copyright © 2012, 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 2 or 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef MIR_GEOMETRY_DIMENSIONS_H_
18#define MIR_GEOMETRY_DIMENSIONS_H_
19
20#include "dimensions_generic.h"
21
22#include <cstdint>
23
24namespace mir
25{
28namespace geometry
29{
30namespace detail
31{
32template<typename Tag>
33class IntWrapper : public generic::Value<int>::Wrapper<Tag>
34{
35public:
36 template<typename OtherTag>
38
39 using generic::Value<int>::Wrapper<Tag>::Wrapper;
40
41 constexpr IntWrapper() {}
42
43 constexpr uint32_t as_uint32_t() const // TODO: Deprecate this later
44 {
45 return (uint32_t)this->value;
46 }
47};
48} // namespace detail
49
52// Just to be clear, mir::geometry::Stride is the stride of the buffer in bytes
54
59}
60}
61
62#endif /* MIR_GEOMETRY_DIMENSIONS_H_ */
Definition: dimensions.h:34
constexpr IntWrapper()
Definition: dimensions.h:41
constexpr uint32_t as_uint32_t() const
Definition: dimensions.h:43
detail::IntWrapper< DeltaYTag > DeltaY
Definition: dimensions.h:58
detail::IntWrapper< struct StrideTag > Stride
Definition: dimensions.h:53
detail::IntWrapper< YTag > Y
Definition: dimensions.h:56
detail::IntWrapper< DeltaXTag > DeltaX
Definition: dimensions.h:57
detail::IntWrapper< XTag > X
Definition: dimensions.h:55
detail::IntWrapper< HeightTag > Height
Definition: dimensions.h:51
detail::IntWrapper< WidthTag > Width
Definition: dimensions.h:50
Definition: splash_session.h:22
T value
Definition: dimensions_generic.h:131
Definition: dimensions_generic.h:51

Copyright © 2012-2022 Canonical Ltd.
Generated on Tue Nov 8 21:37:30 UTC 2022
This documentation is licensed under the GPL version 2 or 3.