MisterAqua Posted March 31, 2018 Posted March 31, 2018 Hi, i'm wondering how polar inversion works. is Paint.net setting the r coordonate with the x and set ϕ to y (eg: A (x, y) -> A' (1/x, y). I don't know where the inversion goes, but i'm 90% sure the effect invert the "r coordonate" cause the center is infinite. Also i don't know what the "quantity parameter" do I want to reproduce the effect with python to modify some things cause i want another result (like increasing quantity to -10 or more) Thanks for reading Mister_Aqua_ Quote
MJW Posted March 31, 2018 Posted March 31, 2018 Here is the disassembled transform code: protected override void InverseTransform(ref WarpEffectBase.TransformData data) { double x = data.X; double y = data.Y; double invertDistance = DoubleUtil.Lerp(1.0, base.DefaultRadius2 / (x * x + y * y), this.amount); data.X = x * invertDistance; data.Y = y * invertDistance; } That's the transformation that's applied to each subpixel. It takes the destination subpixel address and calculates the corresponding source subpixel address. The Quality setting determines the number of subsamples per pixel. The total subsamples per pixel is Quality squared, since that's the number of subsamples in each direction. So a setting of 10 would compute 100 subsamples per pixel. The X and Y values are floating point, not ints, to allow the transform to process subpixels. Lerp linearly interpolates between the first (1.0) and the second value, to determine the strength of the effect. The default radius is half the minimum of the height and width. DefaultRadius2 is that value squared. 1 Quote
MJW Posted April 1, 2018 Posted April 1, 2018 I think it might be easier to write a plugin using CodeLab then it would be to use Python. Also, as I recall, Python is an interpreted language, so doing 100 subsamples per pixel would probably run like a dog (or I should say, "run like a tortoise" -- dogs run pretty darned quickly). Quote
MisterAqua Posted April 5, 2018 Author Posted April 5, 2018 Merci bien pour cette réponse rapide, je vais essayer CodeLab Quote
MisterAqua Posted April 5, 2018 Author Posted April 5, 2018 Finaly i found a way faster way to do it xD I use some of my hacker skill to inject a "multiply by 8" in the code to do what i wanted. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.