18 #ifndef PIC_COLORS_MATRIX_FORM_PRIMARIES_HPP 19 #define PIC_COLORS_MATRIX_FORM_PRIMARIES_HPP 21 #include "../base.hpp" 23 #ifndef PIC_DISABLE_EIGEN 24 #ifndef PIC_EIGEN_NOT_BUNDLED 25 #include "../externals/Eigen/Dense" 26 #include "../externals/Eigen/QR" 28 #include <Eigen/Dense> 47 float *white_point_XYZ,
51 if(red_XYZ == NULL || green_XYZ == NULL || blue_XYZ == NULL) {
59 #ifndef PIC_DISABLE_EIGEN 62 if(white_point_XYZ != NULL) {
68 Eigen::MatrixXf A(nRow, 9);
69 Eigen::VectorXf b(nRow);
75 for(
int j = 0; j < 3; j++) {
76 for(
int i = 0 ; i < 3; i++) {
77 A(j, j * 3 + i) = red_XYZ[i];
82 for(
int j = 0; j < 3; j++) {
83 for(
int i = 0 ; i < 3; i++) {
84 A(j + 3, j * 3 + i) = green_XYZ[i];
89 for(
int j = 0; j < 3; j++) {
90 for(
int i = 0 ; i < 3; i++) {
91 A(j + 6, j * 3 + i) = blue_XYZ[i];
97 for(
int j = 0; j < 3; j++) {
98 for(
int i = 0 ; i < 3; i++) {
99 A(j + 9, j * 3 + i) = white_point_XYZ[i];
124 Eigen::VectorXf x = A.colPivHouseholderQr().solve(b);
126 for(
int i = 0; i < 9; i++) {
Definition: bilateral_separation.hpp:25
float * createMatrixFromPrimaries(float *red_XYZ, float *green_XYZ, float *blue_XYZ, float *white_point_XYZ, float *ret=NULL)
createMatrixFromPrimaries computes a matrix for converting XYZ values into the defined color space (i...
Definition: matrix_from_primaries.hpp:44