Blender V4.3
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#ifndef __UTIL_MATH_INT2_H__
6#define __UTIL_MATH_INT2_H__
7
8#ifndef __UTIL_MATH_H__
9# error "Do not include this file directly, include util/types.h instead."
10#endif
11
13
14#if !defined(__KERNEL_METAL__)
16{
17 return (a.x == b.x && a.y == b.y);
18}
19
21{
22 return make_int2(a.x + b.x, a.y + b.y);
23}
24
26{
27 return a = a + b;
28}
29
31{
32 return make_int2(a.x - b.x, a.y - b.y);
33}
34
36{
37 return make_int2(a.x * b.x, a.y * b.y);
38}
39
41{
42 return make_int2(a.x / b.x, a.y / b.y);
43}
44#endif /* !__KERNEL_METAL__ */
45
47
48#endif /* __UTIL_MATH_INT2_H__ */
local_group_size(16, 16) .push_constant(Type b
#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:15
ccl_device_inline int2 operator*(const int2 &a, const int2 &b)
Definition math_int2.h:35
ccl_device_inline int2 operator/(const int2 &a, const int2 &b)
Definition math_int2.h:40
ccl_device_inline int2 operator-(const int2 &a, const int2 &b)
Definition math_int2.h:30
ccl_device_inline int2 operator+=(int2 &a, const int2 &b)
Definition math_int2.h:25
ccl_device_inline int2 operator+(const int2 &a, const int2 &b)
Definition math_int2.h:20