Why are kCIAttribute(Max|Min) and kCIAttributeSlider(Max|Min) sometimes different values

StackOverflow https://stackoverflow.com/questions/12224204

  •  29-06-2021
  •  | 
  •  

Domanda

In CoreImage a CIFilter has both a set of Max/Min values and a set of SliderMax/Min values.

The documentation for the Max/Min says "The maximum/minimum value for a filter parameter" and the SliderMax/Min says "The maximum/minimum value, specified as a floating-point value, to use for a slider that controls input values for a filter parameter."

I'm wondering why these might be different values, as they are, for example, for the inputAngle parameter of CIHueAdjust, where max/min are 0/0 but sliderMax/Min is 3.14/-3.14?

And also what is the use of having the max/min values at 0/0 like they are for most of the filters?

È stato utile?

Soluzione

I would wager that a value of 0 means there is no max/min, that any value representable by the datatype is valid for the filter.

As for why there's a separate slider value, it's because what you present to the user is often different than what's accepted. For example, the CIHueAdjust may accept any value for the actual adjustment, but a slider presented to the user has no reason to go outside the range of -3.14..3.14 (because anything outside this range is equivalent to a value inside the range).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top