On 10/17/06, Daniel Rogers <daniel@xxxxxxxxxxxxxxxxx> wrote:
I think you are mixing up interpolation and resampling. They are similar (abstractly anyway), but separate operations.
My claim is that interpolation and decimation both are resampling operations, and thus shuld be grouped together.
Geert's interpolation API is sufficient. Interpolation rarely takes or needs more than 16 pixels. A rescaling API needs to be able to declare the size of the neighborhood around the pixel (an interpolation API could probably use this). They probably both need another object for extending the region at the edges (copy, reflect, zeros, wrap, etc).
As I see it this needs to be handled by the buffer implementation and not the resamplers, each operation will only operate on a smaller region of the image any abyss behavior should already be applied to the data outside when data is mapped from storage to a linear buffer to be operated on. (currently the behavior is always zeroed out data)
Both these operations are similar in that they need a neighborhood and produce a new value based on that neighborhood, but mathematicaly they are acomplishing two very different goals. Interpolation doesn't affect resolution and is used for shifting and scaling up. Resampling is for downsampling (aka decimating) a signal and is a type of anti-aliasing. They are used in very different cases, and should probably have different interfaces to reflect that.
Both scaling up and scaling down is resampling, changing the spatial sampling rate of the image raster. Increasing the samling rate is interpolation, decreasing it is decimation, both of them are resampling. One place in the GIMP code where these are used is the transformation tools, the transformation code in GIMP uses a matrix to represent the entire transformation. In the case of a perspective transform you need to do both interpolation and decimation with the same resampler. What I was suggesting is to keep the same cache of pixels available both for the interpolation and decimation and use different functions for retrieving the data. /OEyvind K. -- «The future is already here. It's just not very evenly distributed» -- William Gibson http://pippin.gimp.org/ http://ffii.org/ _______________________________________________ Gegl-developer mailing list Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer