libsrc/Helper.cpp
unsigned *Helper::getIntegerScaledCIELabFromCIELab(float *cieLab, unsigned *cieLabScaled) {
    // per PS 3.3 C.10.7.1.1 ... scale same way as ICC profile encodes them
    cieLabScaled[0] = (int) floor(cieLab[0] * 65535. / 100. + .5);
    cieLabScaled[1] = (int) floor((cieLab[1] + 128) * 65535. / 255. + .5);
    cieLabScaled[2] = (int) floor((cieLab[2] + 128) * 65535. / 255. + .5);
    return cieLabScaled;
  }
/**
   *  <p>Convert floating point CIELab values to the 16 bit fractional
   * integer scaled representation used in ICC profiles and DICOM.</p>
   *
   * <p>See ICC v4.3 Tables 12 and 13, and DICOM PS 3.3 C.10.7.1.1.</p>
   *
   * @param cieLab  array of length 3 containing L*,a*,b* values with L*
   * from 0.0 to 100.0, and a* and b* from -128.0 to +127.0
   * return   array of length 3 containing 16 bit scaled L*,a*,b*
   * values from  0 to 65535
   **/
Convert floating point CIELab values to the 16 bit fractional
integer scaled representation used in ICC profiles and DICOM.




Convert floating point CIELab values to the 16 bit fractional integer scaled representation used in ICC profiles and DICOM .
unsigned *Helper::getIntegerScaledCIELabFromCIELab(float *cieLab, unsigned *cieLabScaled) {
    cieLabScaled[0] = (int) floor(cieLab[0] * 65535. / 100. + .5);
    cieLabScaled[1] = (int) floor((cieLab[1] + 128) * 65535. / 255. + .5);
    cieLabScaled[2] = (int) floor((cieLab[2] + 128) * 65535. / 255. + .5);
    return cieLabScaled;
  }
unsigned * Helper :: getIntegerScaledCIELabFromCIELab ( float * cieLab , unsigned * cieLabScaled ) { cieLabScaled [ 0 ] = ( int ) floor ( cieLab [ 0 ] * 65535. / 100. + .5 ) ; cieLabScaled [ 1 ] = ( int ) floor ( ( cieLab [ 1 ] + 128 ) * 65535. / 255. + .5 ) ; cieLabScaled [ 2 ] = ( int ) floor ( ( cieLab [ 2 ] + 128 ) * 65535. / 255. + .5 ) ; return cieLabScaled ; }
<p>Convert floating point CIELab values to the 16 bit fractional
 integer scaled representation used in ICC profiles and DICOM.</p>
<p > Convert floating point CIELab values to the 16 bit fractional integer scaled representation used in ICC profiles and DICOM . < / p >
// per PS 3.3 C.10.7.1.1 ... scale same way as ICC profile encodes them