Blender  V2.93
util_types_float2_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2017 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __UTIL_TYPES_FLOAT2_IMPL_H__
18 #define __UTIL_TYPES_FLOAT2_IMPL_H__
19 
20 #ifndef __UTIL_TYPES_H__
21 # error "Do not include this file directly, include util_types.h instead."
22 #endif
23 
24 #ifndef __KERNEL_GPU__
25 # include <cstdio>
26 #endif
27 
29 
30 #ifndef __KERNEL_GPU__
32 {
33  util_assert(i >= 0);
34  util_assert(i < 2);
35  return *(&x + i);
36 }
37 
39 {
40  util_assert(i >= 0);
41  util_assert(i < 2);
42  return *(&x + i);
43 }
44 
46 {
47  float2 a = {x, y};
48  return a;
49 }
50 
51 ccl_device_inline void print_float2(const char *label, const float2 &a)
52 {
53  printf("%s: %.8f %.8f\n", label, (double)a.x, (double)a.y);
54 }
55 #endif /* __KERNEL_GPU__ */
56 
58 
59 #endif /* __UTIL_TYPES_FLOAT2_IMPL_H__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
const char * label
#define ccl_device_inline
#define CCL_NAMESPACE_END
static unsigned a[3]
Definition: RandGen.cpp:92
__forceinline float operator[](int i) const
#define util_assert(statement)
Definition: util_defines.h:143
#define __forceinline
Definition: util_defines.h:71
ccl_device_inline void print_float2(const char *label, const float2 &a)
ccl_device_inline float2 make_float2(float x, float y)