void DoRGBtoLABConversion(int[] ubuff, double[] lvec, double[] avec, double[] bvec) {
        int sz = m_width * m_height;

        double[]labVal = new double[3];
        
        int i=0, r, g, b;
        for (int j=0; j<sz; j++) {
            if (10*j/sz > i) {
            i++;
            }
            r = (ubuff[j] >> 16) & 0xFF;
            g = (ubuff[j] >>  8) & 0xFF;
            b = (ubuff[j]      ) & 0xFF;

            RGB2LAB(r, g, b, labVal);
            
            lvec[j] = labVal[0];
            avec[j] = labVal[1];
            bvec[j] = labVal[2];
        }
    }