From: Michael B. <mic...@gm...> - 2010-03-20 06:37:17
|
Hi folks, I'm working on putting some flesh onto the bones of InterpolationFunction which have been sitting in the render module for some time (thanks Jody for pointing me to this). I've got the basics of linear, cosine and cubic interpolation working for numeric values. Next it's on to Color and after that raster support. I'm following the Symbology Encoding 1.1 specs but they are silent on what to do in a few exceptional cases. In the following, 'interpolation point' refers to each of the data:value pairs provided to the function by the user... 1. What to do if no interpolation points are provided ? Be generous and just return the lookup value or be strict and throw an Exception ? 2. What to do if only one interpolation point is provided ? Use it's value as the return or throw an Exception ? 3. For cubic interpolation, if less than 4 points are provided I'm presently falling back to cosine interpolation and logging a warning, but perhaps it should be an Exception ? 4. For cubic interpolation we need an interpolation point on either side of the pair that define the segment defining the interval that contains the lookup value: o--------o----x----o--------o But what to do in cases like this... o--------o--------o----x----o Fall back to cosine ? Return the value of the second last point ? Michael |