Blender V5.0
types_uchar4.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/types_base.h"
8
10
11#ifndef __KERNEL_NATIVE_VECTOR_TYPES__
12struct uchar4 {
13 uchar x, y, z, w;
14
15# ifndef __KERNEL_GPU__
17 {
18 util_assert(i >= 0);
19 util_assert(i < 4);
20 return *(&x + i);
21 }
22
24 {
25 util_assert(i >= 0);
26 util_assert(i < 4);
27 return *(&x + i);
28 }
29# endif
30};
31
33{
34 uchar4 a = {x, y, z, w};
35 return a;
36}
37
39{
40 return (a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w);
41}
42
43#endif /* __KERNEL_NATIVE_VECTOR_TYPES__ */
44
unsigned char uchar
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
#define util_assert(statement)
#define ccl_device_inline
#define __forceinline
#define CCL_NAMESPACE_END
__forceinline uchar & operator[](int i)
uchar z
uchar w
uchar x
uchar y
__forceinline uchar operator[](int i) const
i
Definition text_draw.cc:230
ccl_device_inline bool operator==(const uchar4 a, const uchar4 b)
ccl_device_inline uchar4 make_uchar4(const uchar x, const uchar y, uchar z, const uchar w)