23 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_CONVERT_HPP_
24 #define VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_CONVERT_HPP_
45 static inline T
convert(T t) {
return t; }
57 return cl::sycl::float4(t[0], t[1], t[2], 0.0f);
66 return cl::sycl::float4(t[0], t[1], t[2], t[3]);
75 return cl::sycl::float4(
static_cast<float>(t[0]),
static_cast<float>(t[1]),
76 static_cast<float>(t[2]), 0.0f);
85 return cl::sycl::float4(
static_cast<float>(t[0]),
static_cast<float>(t[1]),
86 static_cast<float>(t[2]),
static_cast<float>(t[3]));
94 static inline cl::sycl::float4
convert(
float t) {
95 return cl::sycl::float4(t, t, t, t);
107 return cl::sycl::int4(
static_cast<int>(t[0]),
static_cast<int>(t[1]),
108 static_cast<int>(t[2]), 0);
117 return cl::sycl::int4(
static_cast<int>(t[0]),
static_cast<int>(t[1]),
118 static_cast<int>(t[2]),
static_cast<int>(t[3]));
127 return cl::sycl::int4(
static_cast<int>(t[0]),
static_cast<int>(t[1]),
128 static_cast<int>(t[2]), 0);
137 return cl::sycl::int4(
static_cast<int>(t[0]),
static_cast<int>(t[1]),
138 static_cast<int>(t[2]),
static_cast<int>(t[3]));
147 return cl::sycl::int4(t, t, t, t);
159 return cl::sycl::uint4(
static_cast<unsigned int>(t[0]),
160 static_cast<unsigned int>(t[1]),
161 static_cast<unsigned int>(t[2]), 0);
170 return cl::sycl::uint4(
171 static_cast<unsigned int>(t[0]),
static_cast<unsigned int>(t[1]),
172 static_cast<unsigned int>(t[2]),
static_cast<unsigned int>(t[3]));
181 return cl::sycl::uint4(
static_cast<unsigned int>(t[0]),
182 static_cast<unsigned int>(t[1]),
183 static_cast<unsigned int>(t[2]), 0);
192 return cl::sycl::uint4(
193 static_cast<unsigned int>(t[0]),
static_cast<unsigned int>(t[1]),
194 static_cast<unsigned int>(t[2]),
static_cast<unsigned int>(t[3]));
203 static inline cl::sycl::uint4
convert(
unsigned int t) {
204 return cl::sycl::uint4(t, t, t, t);
213 static inline cl::sycl::uint4
convert(
unsigned char t) {
214 return cl::sycl::uint4(t, t, t, t);
245 static_cast<float>(t.y()),
246 static_cast<float>(t.z()));
256 static_cast<float>(t.y()),
257 static_cast<float>(t.z()));
297 static_cast<float>(t.x()),
static_cast<float>(t.y()),
298 static_cast<float>(t.z()),
static_cast<float>(t.w()));
308 static_cast<float>(t.x()),
static_cast<float>(t.y()),
309 static_cast<float>(t.z()),
static_cast<float>(t.w()));
358 static_cast<unsigned char>(t.y()),
359 static_cast<unsigned char>(t.z()));
369 static_cast<unsigned char>(t.y()),
370 static_cast<unsigned char>(t.z()));
410 static_cast<unsigned char>(t.x()),
static_cast<unsigned char>(t.y()),
411 static_cast<unsigned char>(t.z()),
static_cast<unsigned char>(t.w()));
421 static_cast<unsigned char>(t.x()),
static_cast<unsigned char>(t.y()),
422 static_cast<unsigned char>(t.z()),
static_cast<unsigned char>(t.w()));
434 static inline unsigned char convert(cl::sycl::uint4 t) {
return t.x(); }
441 static inline unsigned char convert(
unsigned char t) {
return t; }
451 static inline char convert(cl::sycl::int4 t) {
return t.x(); }
459 static inline short convert(
char t) {
return t; }
470 static inline unsigned short convert(cl::sycl::uint4 t) {
return t.x(); }
478 static inline unsigned short convert(
unsigned short t) {
return t; }
488 static inline short convert(cl::sycl::int4 t) {
return t.x(); }
495 static inline short convert(
short t) {
return t; }
505 static inline int convert(cl::sycl::uint4 t) {
return t.x(); }
512 static inline unsigned int convert(
unsigned int t) {
return t; }
522 static inline int convert(cl::sycl::int4 t) {
return t.x(); }
529 static inline int convert(
int t) {
return t; }
539 static inline float convert(cl::sycl::float4 t) {
return t.x(); }
546 static inline float convert(
float t) {
return t; }
557 template <
typename T1,
typename T2>
Storage< float, 4 > F32C4
Storage< unsigned char, 4 > U8C4
Storage< unsigned char, 3 > U8C3
Storage< float, 3 > F32C3