Blender V5.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#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)
__forceinline LightTreeMeasure operator+(const LightTreeMeasure &a, const LightTreeMeasure &b)
ccl_device_inline Extrema< T > operator*(const Extrema< T > a, const T b)
Definition math_base.h:967
ccl_device_inline Extrema< T > operator+=(ccl_private Extrema< T > &a, const ccl_private Extrema< T > &b)
Definition math_base.h:980
ccl_device_inline dual< T > operator/(const dual< T > a, T b)
Definition math_dual.h:71
ccl_device_inline dual< T1 > operator-(const dual< T1 > a, T2 b)
Definition math_dual.h:113
ccl_device_inline bool operator==(const float2 a, const float2 b)
ccl_device_inline float4 operator^(const float4 a, const float4 b)
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 int i)
Definition math_int2.h:43