forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhsv_rgb.cpp
More file actions
44 lines (33 loc) · 1.06 KB
/
Copy pathhsv_rgb.cpp
File metadata and controls
44 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <Array.hpp>
#include <hsv_rgb.hpp>
#include <kernel/hsv_rgb.hpp>
#include <platform.hpp>
#include <queue.hpp>
#include <af/dim4.hpp>
namespace cpu {
template<typename T>
Array<T> hsv2rgb(const Array<T>& in) {
Array<T> out = createEmptyArray<T>(in.dims());
getQueue().enqueue(kernel::hsv2rgb<T>, out, in);
return out;
}
template<typename T>
Array<T> rgb2hsv(const Array<T>& in) {
Array<T> out = createEmptyArray<T>(in.dims());
getQueue().enqueue(kernel::rgb2hsv<T>, out, in);
return out;
}
#define INSTANTIATE(T) \
template Array<T> hsv2rgb<T>(const Array<T>& in); \
template Array<T> rgb2hsv<T>(const Array<T>& in);
INSTANTIATE(double)
INSTANTIATE(float)
} // namespace cpu