本文整理汇总了C#中biz.ritter.javapi.getNumComponents方法的典型用法代码示例。如果您正苦于以下问题:C# biz.ritter.javapi.getNumComponents方法的具体用法?C# biz.ritter.javapi.getNumComponents怎么用?C# biz.ritter.javapi.getNumComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类biz.ritter.javapi
的用法示例。
在下文中一共展示了biz.ritter.javapi.getNumComponents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadScalingData
/**
* Use this method only for double of float transfer types.
* Extracts scaling data from the color space signature
* and other tags, stored in the profile
* @param pf - ICC profile
*/
public void loadScalingData(java.awt.color.ICC_Profile pf)
{
// Supposing double or float transfer type
isTTypeIntegral = false;
nColorChannels = pf.getNumComponents();
// Get min/max values directly from the profile
// Very much like fillMinMaxValues in ICC_ColorSpace
float[] maxValues = new float[nColorChannels];
float[] minValues = new float[nColorChannels];
switch (pf.getColorSpaceType())
{
case java.awt.color.ColorSpace.TYPE_XYZ:
minValues[0] = 0;
minValues[1] = 0;
minValues[2] = 0;
maxValues[0] = MAX_XYZ;
maxValues[1] = MAX_XYZ;
maxValues[2] = MAX_XYZ;
break;
case java.awt.color.ColorSpace.TYPE_Lab:
minValues[0] = 0;
minValues[1] = -128;
minValues[2] = -128;
maxValues[0] = 100;
maxValues[1] = 127;
maxValues[2] = 127;
break;
default:
for (int i = 0; i < nColorChannels; i++)
{
minValues[i] = 0;
maxValues[i] = 1;
}
break;
}
channelMinValues = minValues;
channelMulipliers = new float[nColorChannels];
invChannelMulipliers = new float[nColorChannels];
for (int i = 0; i < nColorChannels; i++)
{
channelMulipliers[i] =
MAX_SHORT / (maxValues[i] - channelMinValues[i]);
invChannelMulipliers[i] =
(maxValues[i] - channelMinValues[i]) / MAX_SHORT;
}
}