Am Montag, den 26.08.2019, 22:43 +0200 schrieb Pascal Obry: > Hi Jens-Hanno, > > > i started correcting the dt problem with masks borders displayed at a wrong > > position. > > > > There is a detail i don't understand and currently dont't know how to do. > > > > Lets assume i have a point p(x,y), x and y are both in the 0->1 range > > covering the whole > > raw data (no lensfun applied). > > > > So my question: > > How can i calculate the position (also 0->1 range for both) **after** > > lensfun correction? > > This is done by a transform function in the IOP. Actually each IOP must > provide a distort_transform() and distort_backtransform() function that > will transform a set of points. > > Fact is lens.cc seems to have the very same implementation in transform > and backtransform which is obviously pretty wrong. I had started fixing > that, but it seems there is something more. I can create a PR with what > I have now if you want to start from that, let me know. Pascal, Yes please. I ran into the lens.cc code as it is called in masks.c and
I think we could need an explicit raw-xy->lenscorrected function somwhow. Let#s stay with the circle mask for a moment as it becomes pretty obvious what the problem is. As long as you drag the visible mask circle arount everything is fine. When you release the button the current position of the circle is transformed to raw space of course. After releasing the button the circle will be displayed at coordinates in **raw** space via the dt_circle_events_post_expose code. (Lines after the (gui->creation) section) So the mask circle immediately moves away after release! Voila. If we can calculate the offset at that point we could use the dx and dy offsets. > When mask needs it calls a generic transform function in one direction > or the other in the pipe and this will trigger calls to transform > functions for each active IOP. > > Hope this helps, Thanks a lot, Hanno ___________________________________________________________________________ darktable developer mailing list to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org