CVB++ 15.0
Loading...
Searching...
No Matches
convert_color_space.hpp
1#pragma once
2
3#include <memory>
4
5#include "../global.hpp"
6#include "../_cexports/c_img.h"
7#include "interpolator.hpp"
8
9namespace Cvb
10{
11 CVB_BEGIN_INLINE_NS
12
13 namespace Spectral
14 {
15
17
27 std::unique_ptr<Image> CubeToXYZ(const Cube &cube, const Interpolator &interpolator)
28 {
29 return Internal::DoResCallObjectOut<Image>(
30 [&](void *&obj) { return CVB_CALL_CAPI(CVSConvertCubeToXYZ(cube.Handle(), interpolator.Handle(), obj)); });
31 }
32
34
46 void CubeToXYZ(const Cube &cube, const Interpolator &interpolator, Image &xyzImageOut)
47 {
48 auto obj = xyzImageOut.Handle();
49 CVB_CALL_CAPI_CHECKED(CVSConvertCubeToXYZ(cube.Handle(), interpolator.Handle(), obj));
50 }
51
53
63 std::unique_ptr<Image> CubeToLab(const Cube &cube, const Interpolator &interpolator)
64 {
65 return Internal::DoResCallObjectOut<Image>(
66 [&](void *&obj) { return CVB_CALL_CAPI(CVSConvertCubeToLab(cube.Handle(), interpolator.Handle(), obj)); });
67 }
68
70
80 void CubeToLab(const Cube &cube, const Interpolator &interpolator, Image &LabImageOut)
81 {
82 auto obj = LabImageOut.Handle();
83 CVB_CALL_CAPI_CHECKED(CVSConvertCubeToLab(cube.Handle(), interpolator.Handle(), obj));
84 }
85
87
95 std::unique_ptr<Image> XYZToLab(const Image &xyzImage, const Interpolator &interpolator)
96 {
97 return Internal::DoResCallObjectOut<Image>(
98 [&](void *&obj) { return CVB_CALL_CAPI(CVSConvertXYZToLab(xyzImage.Handle(), interpolator.Handle(), obj)); });
99 }
100
102
110 std::unique_ptr<Image> LabToRGB8(const Image &LabImage, const Interpolator &interpolator)
111 {
112 return Internal::DoResCallObjectOut<Image>([&](void *&obj) {
113 return CVB_CALL_CAPI(CVSConvertLabToRGB8(LabImage.Handle(), interpolator.Handle(), obj));
114 });
115 }
116
117 } // namespace Spectral
118
119 CVB_END_INLINE_NS
120} // namespace Cvb
The Common Vision Blox image.
Definition decl_image.hpp:45
void * Handle() const noexcept
Classic API image handle.
Definition decl_image.hpp:232
Spectral Cube object.
Definition cube.hpp:59
void * Handle() const noexcept
Returns C-API style handle to the Cube.
Definition cube.hpp:316
Spectral Interpolator object.
Definition interpolator.hpp:23
void * Handle() const noexcept
Returns C-API style handle to the Interpolator.
Definition interpolator.hpp:121
Namespace for the Spectral package.
Definition arithmetic.hpp:14
std::unique_ptr< Image > CubeToXYZ(const Cube &cube, const Interpolator &interpolator)
Converts a normalized cube to an XYZ image.
Definition convert_color_space.hpp:27
std::unique_ptr< Image > LabToRGB8(const Image &LabImage, const Interpolator &interpolator)
Converts a Lab image to a sRGB 8bit image.
Definition convert_color_space.hpp:110
std::unique_ptr< Image > XYZToLab(const Image &xyzImage, const Interpolator &interpolator)
Converts an image from XYZ to Lab.
Definition convert_color_space.hpp:95
std::unique_ptr< Image > CubeToLab(const Cube &cube, const Interpolator &interpolator)
Converts a normalized cube to a Lab image.
Definition convert_color_space.hpp:63
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17