Blender V5.0
math_int2.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include "util/defines.h"
8#include "util/types_int2.h"
9
11
12#if !defined(__KERNEL_METAL__)
14{
15 return (a.x == b.x && a.y == b.y);
16}
17
19{
20 return make_int2(a.x + b.x, a.y + b.y);
21}
22
24{
25 return a = a + b;
26}
27
29{
30 return make_int2(a.x - b.x, a.y - b.y);
31}
32
34{
35 return make_int2(a.x * b.x, a.y * b.y);
36}
37
39{
40 return make_int2(a.x / b.x, a.y / b.y);
41}
42
44{
45 return make_int2(a.x >> i, a.y >> i);
46}
47
49{
50 return make_int2(a.x & b.x, a.y & b.y);
51}
52
54{
55 return make_int2(a.x ^ b.x, a.y ^ b.y);
56}
57#endif /* !__KERNEL_METAL__ */
58
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_device_forceinline int2 make_int2(const int x, const int y)
CCL_NAMESPACE_BEGIN ccl_device_inline bool operator==(const int2 a, const int2 b)
Definition math_int2.h:13
ccl_device_inline int2 operator*(const int2 &a, const int2 &b)
Definition math_int2.h:33
ccl_device_inline int2 operator/(const int2 &a, const int2 &b)
Definition math_int2.h:38
ccl_device_inline int2 operator&(const int2 a, const int2 b)
Definition math_int2.h:48
ccl_device_inline int2 operator-(const int2 &a, const int2 &b)
Definition math_int2.h:28
ccl_device_inline int2 operator^(const int2 a, const int2 b)
Definition math_int2.h:53
ccl_device_inline int2 operator+=(int2 &a, const int2 &b)
Definition math_int2.h:23
ccl_device_inline int2 operator+(const int2 &a, const int2 &b)
Definition math_int2.h:18
ccl_device_inline int2 operator>>(const int2 a, const int i)
Definition math_int2.h:43
i
Definition text_draw.cc:230