/** * Extracts scaling data from the color space * @param cs - color space */ public void loadScalingData(java.awt.color.ColorSpace cs) { nColorChannels = cs.getNumComponents(); channelMinValues = new float[nColorChannels]; channelMulipliers = new float[nColorChannels]; invChannelMulipliers = new float[nColorChannels]; for (int i = 0; i < nColorChannels; i++) { channelMinValues[i] = cs.getMinValue(i); channelMulipliers[i] = MAX_SHORT / (cs.getMaxValue(i) - channelMinValues[i]); invChannelMulipliers[i] = (cs.getMaxValue(i) - channelMinValues[i]) / MAX_SHORT; } }