Handling Non-Uniform Downsampling Correctly
Please forgive what is probably a very stupid question, but even those of us who have made ludicrously complex plugins still need to go back to basics every once in a while!
My plugin draws thousands of circular particles. It also applies blurs. At one point in its history the plugin drew elliptical particles and non-uniform blurs in order to deal with non-square PARs and odd downsample ratios (who uses these ratios, seriously?). However it was pointed out that I should really work internally with square pixels, and then, if necessary, stretch the render back to the output dimensions, which is a logical suggestion.
Question is, how do you deal with non-uniform downsampling?
Say I have a layer that is 960x540. This is given to me as in_data->width = 960, in_data->height=540, regardless of the downsampling. Normally I'd just divide each of these by the requisite denominator in the in_data->downsample struct, so if I'm using a 2x downsample I'd end up with a working PF_EffectWorld with width = 480, height = 270 (which is also the dimensions of the output world). This is fine, as I'm still left with square pixels.
However once I get to a 2:1 or 1:2 downsample ratio, this seems to fall apart. 960 / 2 = 480, 540 / 1 = 540, so I have a working PF_EffectWorld of 480x540. This isn't square pixels - it's narrow pixels so any circles would end up as fat ellipses when displayed stretched in the comp viewer. Likewise 960x240 (1:2) is flat pixels that would result in a skinny ellipse.
Is it a dumb question? Should I even bother (Trapcode Particular doesn't draw correctly for these odd downsample ratios)? I'm a bit snow blind with the countless things going on in the code so the answer is probably staring me in the face!
Thanks
