5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
26 #include <dali/public-api/common/dali-common.h>
31 * @addtogroup dali_core_common
36 * @brief Structure describing the a collection of uint16_t.
39 struct DALI_CORE_API Extents
42 * @brief Default constructor which provides an initialized Dali::Extents( 0u, 0u, 0u, 0u ).
48 * @brief Copy constructor.
50 * @param[in] copy A reference to the copied Extents
52 Extents(const Extents& copy) = default;
55 * @brief Move constructor.
57 * @param[in] move A reference to the moved Extents
59 Extents(Extents&& move) = default;
65 * @param[in] start Start extent
66 * @param[in] end End extent
67 * @param[in] top Top extent
68 * @param[in] bottom Bottom extent
70 Extents(uint16_t start, uint16_t end, uint16_t top, uint16_t bottom);
73 * @brief Copy Assignment operator.
75 * @param[in] copy A reference to the copied Extents
78 Extents& operator=(const Extents& copy) = default;
81 * @brief Move Assignment operator.
83 * @param[in] move A reference to the moved Extents
86 Extents& operator=(Extents&& move) = default;
89 * @brief Assignment operator.
92 * @param[in] array Array of uint16_t
95 Extents& operator=(const uint16_t* array);
98 * @brief Equality operator.
101 * @param[in] rhs The Extents to test against
102 * @return True if the extents are equal
104 bool operator==(const Extents& rhs) const;
107 * @brief Inequality operator.
110 * @param[in] rhs The Extents to test against
111 * @return True if the extents are not equal
113 bool operator!=(const Extents& rhs) const;
116 uint16_t start; ///< The start extent. @SINCE_1_2.62
117 uint16_t end; ///< The end extent. @SINCE_1_2.62
118 uint16_t top; ///< The top extent. @SINCE_1_2.62
119 uint16_t bottom; ///< The bottom extent. @SINCE_1_2.62
123 * @brief Converts the value of the extents into a string and insert in to an output stream.
126 * @param[in] stream The output stream operator
127 * @param[in] extents The Extents to output
128 * @return The output stream operator
130 DALI_CORE_API std::ostream& operator<<(std::ostream& stream, const Extents& extents);
137 #endif // DALI_EXTENTS_H