RAMSES Documentation  27.0.130
Information for RAMSES users and developers
DcsmApiTypes.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2019 BMW AG
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_DCSMAPITYPES_H
10 #define RAMSES_DCSMAPITYPES_H
11 
12 #include "StronglyTypedValue.h"
13 #include <functional>
14 #include <limits>
15 #include <cstdint>
16 
17 namespace ramses
18 {
20  struct ContentIDTag {};
21 
26 
28  struct CategoryTag {};
29 
34 
37  {
40  };
41 
44 
51 
55  struct Rect
56  {
64  constexpr Rect(uint32_t xpos, uint32_t ypos, uint32_t w, uint32_t h)
65  : x(xpos)
66  , y(ypos)
67  , width(w)
68  , height(h)
69  {
70  }
71 
73  uint32_t x;
74 
76  uint32_t y;
77 
79  uint32_t width;
80 
82  uint32_t height;
83 
89  constexpr bool operator==(const Rect& rhs) const
90  {
91  return x == rhs.x && y == rhs.y && width == rhs.width && height == rhs.height;
92  }
93 
99  constexpr bool operator!=(const Rect& rhs) const
100  {
101  return !(*this == rhs);
102  }
103 
104  };
108  struct SizeInfo
109  {
115  constexpr SizeInfo(uint32_t w, uint32_t h)
116  : width(w)
117  , height(h)
118  {
119  }
120 
122  uint32_t width;
123 
125  uint32_t height;
126 
132  constexpr bool operator==(const SizeInfo& rhs) const
133  {
134  return (width == rhs.width && height == rhs.height);
135  }
136 
142  constexpr bool operator!=(const SizeInfo& rhs) const
143  {
144  return !(*this == rhs);
145  }
146  };
147 
152  {
154  uint64_t startTime;
155 
157  uint64_t finishTime;
158 
164  constexpr bool operator==(const AnimationInformation& rhs) const
165  {
166  return (startTime == rhs.startTime && finishTime == rhs.finishTime);
167  }
168 
174  constexpr bool operator!=(const AnimationInformation& rhs) const
175  {
176  return !(*this == rhs);
177  }
178  };
179 
184  enum class EDcsmState
185  {
187  Offered,
189  Assigned,
191  Ready,
193  Shown,
194  };
195 }
196 
197 #endif
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
ETechnicalContentType
Enum describing the possible distribution mechanisms for a specific content.
Definition: DcsmApiTypes.h:37
EDcsmState
DCSM content states. Used to request a specific state from provider via DcsmConsumer::sendContentStat...
Definition: DcsmApiTypes.h:185
@ Shown
Request content in shown state, i.e. actively updated.
@ Assigned
Request content to assigned only state.
@ Ready
Request content to be prepare to be shown at any time.
@ Offered
Release content to offered state, i.e. no longer assigned to consumer.
Definition: DcsmApiTypes.h:152
constexpr bool operator==(const AnimationInformation &rhs) const
The equality comparison operator.
Definition: DcsmApiTypes.h:164
uint64_t finishTime
end time of animation
Definition: DcsmApiTypes.h:157
constexpr bool operator!=(const AnimationInformation &rhs) const
The unequality comparison operator.
Definition: DcsmApiTypes.h:174
uint64_t startTime
start time of animation
Definition: DcsmApiTypes.h:154
Unique type tag for Category.
Definition: DcsmApiTypes.h:28
Unique type tag for ContentID.
Definition: DcsmApiTypes.h:20
Rectangle consisting of x, y, width, height.
Definition: DcsmApiTypes.h:56
uint32_t x
x position of rectangle
Definition: DcsmApiTypes.h:73
uint32_t width
width of rectangle
Definition: DcsmApiTypes.h:79
constexpr bool operator==(const Rect &rhs) const
The equality comparison operator.
Definition: DcsmApiTypes.h:89
uint32_t y
y position of rectangle
Definition: DcsmApiTypes.h:76
uint32_t height
height of rectangle
Definition: DcsmApiTypes.h:82
constexpr bool operator!=(const Rect &rhs) const
The inequality comparison operator.
Definition: DcsmApiTypes.h:99
constexpr Rect(uint32_t xpos, uint32_t ypos, uint32_t w, uint32_t h)
Constructor requiring values to be specified explicitly.
Definition: DcsmApiTypes.h:64
Size information for DCSM canvas size change.
Definition: DcsmApiTypes.h:109
uint32_t width
canvas width in pixels
Definition: DcsmApiTypes.h:122
constexpr bool operator!=(const SizeInfo &rhs) const
The inequality comparison operator.
Definition: DcsmApiTypes.h:142
constexpr SizeInfo(uint32_t w, uint32_t h)
Constructor requiring size to be specified explicitly.
Definition: DcsmApiTypes.h:115
uint32_t height
canvas height in pixels
Definition: DcsmApiTypes.h:125
constexpr bool operator==(const SizeInfo &rhs) const
The equality comparison operator.
Definition: DcsmApiTypes.h:132
Unique type tag for TechnicalContentDescriptor.
Definition: DcsmApiTypes.h:43