void RGB2XYZ(int sR, int sG, int sB, double[] XYZ) {
        double R = sR/255.0;
        double G = sG/255.0;
        double B = sB/255.0;

        double r, g, b;
        if (R<=0.04045) {
            r=R/12.92;
        } else {
            r= Math.pow((R+0.055)/1.055, 2.4);
        }
        if (G<=0.04045) {
            g=G/12.92;
        } else {
            g=Math.pow((G+0.055)/1.055, 2.4);
        }
        if (B<=0.04045) {
            b=B/12.92;
        } else {
            b=Math.pow((B+0.055)/1.055, 2.4);
        }
        XYZ[0] = r*0.4124564 + g*0.3575761 + b*0.1804375;
        XYZ[1] = r*0.2126729 + g*0.7151522 + b*0.0721750;
        XYZ[2] = r*0.0193339 + g*0.1191920 + b*0.9503041;
    }