简体   繁体   English

PDF功能2型指数插值方程

[英]PDF Functiontype 2 exponential interpolation equation

I'm modifying an application that does PDF manipulation. 我正在修改一个执行PDF操作的应用程序。 The function written to interpret functiontype 2s seems to produce a negative value far too frequently. 编写来解释功能类型2s的函数似乎经常产生负值。 The equation found in the PDF spec is: PDF规范中的公式为:

yj = C0j + x^N × (C1j − C0j), for 0 ≤ j < n. yj = C0j + x ^ N×(C1j − C0j),其中0≤j <n。

Now, I'm getting negative values when I process a function with C0=1 and C1=0. 现在,当我处理C0 = 1和C1 = 0的函数时,我得到的是负值。 I'm wondering if this is because I'm setting my own x value. 我想知道这是否是因为我正在设置自己的x值。 What is the x value supposed to be? x值应该是多少?

The function is computed like this: 该函数的计算如下:
1. Input value is cut to function domain: 1.输入值切入功能域:
input = input > domainMax ? domainMax : (input < domainMin ? domainMin : input)
2. Compute inputN = input^N 2.计算输入N =输入^ N
3. Compute each component of the output value (1 component in your situation) using the formula: 3.使用以下公式计算输出值的每个组成部分(您所处的情况为1个组成部分):
output[j] = C0[j] + inputN * (C1[j] − C0[j]), for 0 ≤ j < n.
4. Cut each output component to function range: 4.将每个输出组件切至功能范围:
output = output > rangeMax ? rangeMax : (output < rangeMin ? rangeMin : output)

Your function is a linear function (indeed can be used to define a gradient) and returns 0 when input is 1 and 1 when input is 0. Input values greater than 1 are invalid and they are cut to 1 before using them in calculation because the domain is [0, 1]. 您的函数是线性函数(实际上可用于定义渐变),并且在输入为1时返回0,在输入为0时返回1。大于1的输入值无效,并且在计算中使用它们之前将其切为1,因为域是[0,1]。
The application that parses spot color percentages might have to divide that percentage by 100 before feeding it to the function. 解析专色百分比的应用程序可能必须将该百分比除以100,然后才能将其提供给函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM