Claire/include/color_conversion.hpp

24 lines
1.2 KiB
C++
Raw Normal View History

#ifndef __COLOR_CONVERSION_HPP__
#define __COLOR_CONVERSION_HPP__
#include <cstdint>
#include <tuple>
std::tuple<float, float, float> rgb_to_xyz(uint8_t p_red, uint8_t p_green, uint8_t p_blue);
std::tuple<uint8_t, uint8_t, uint8_t> xyz_to_rgb(float p_x, float p_y, float p_z);
std::tuple<float, float, float> xyz_to_cieluv(float p_x, float p_y, float p_z);
std::tuple<float, float, float> cieluv_to_xyz(float p_l_star, float p_u_star, float p_v_star);
std::tuple<float, float, float> cieluv_to_cielchuv(float p_l_star, float p_u_star, float p_v_star);
std::tuple<float, float, float> cielchuv_to_cieluv(float p_l_star, float p_c_star, float p_h_star);
bool is_xyz_in_rgb_range(float p_x, float p_y, float p_z);
bool is_cieluv_in_rgb_range(float p_l_star, float p_u_star, float p_v_star);
bool is_cielchuv_in_rgb_range(float p_l_star, float p_c_star, float p_h_star);
std::tuple<float, float, float> map_cielchuv_to_visible_color(float p_l_star, float p_c_star, float p_h_star);
std::tuple<float, float, float> rgb_to_cielchuv(uint8_t p_red, uint8_t p_green, uint8_t p_blue);
std::tuple<uint8_t, uint8_t, uint8_t> cielchuv_to_rgb(float p_l_star, float p_c_star, float p_h_star);
#endif // __COLOR_CONVERSION_HPP__