cool, seems to work fine.

one question, what's with:

-    roi_in->x += interpolation->width;
-    roi_in->y += interpolation->width;
-    roi_in->width -= 2*interpolation->width;
-    roi_in->height -= 2*interpolation->width;
+    //roi_in->x += interpolation->width;
+    //roi_in->y += interpolation->width;
+    //roi_in->width -= 2*interpolation->width;
+    //roi_in->height -= 2*interpolation->width;
     *roi_out = *roi_in;

     // correct keystone correction factors by resolution of this buffer
@@ -670,11 +751,11 @@ void modify_roi_in(struct dt_iop_module_t *self,
struct dt_dev_pixelpipe_iop_t *
   }

   // adjust roi_in to minimally needed region
-  const struct dt_interpolation* interpolation =
dt_interpolation_new(DT_INTERPOLATION_USERPREF);
-  roi_in->x      = aabb_in[0] - interpolation->width;
-  roi_in->y      = aabb_in[1] - interpolation->width;
-  roi_in->width  = aabb_in[2]-aabb_in[0]+2*interpolation->width;
-  roi_in->height = aabb_in[3]-aabb_in[1]+2*interpolation->width;
+  //const struct dt_interpolation* interpolation =
dt_interpolation_new(DT_INTERPOLATION_USERPREF);
+  roi_in->x      = aabb_in[0];// - interpolation->width;
+  roi_in->y      = aabb_in[1];// - interpolation->width;
+  roi_in->width  = aabb_in[2]-aabb_in[0];//+2*interpolation->width;
+  roi_in->height = aabb_in[3]-aabb_in[1];//+2*interpolation->width;

wasn't that what parafin fixed the other day? was it causing trouble?

also that commented out code portion here:

+    /*// parse config param:
     if(g->current_aspect == -1.0f)
     {
       g->current_aspect =
dt_conf_get_float("plugins/darkroom/clipping/custom_aspect");
@@ -1261,7 +1363,7 @@ aspect_presets_changed (GtkWidget *combo,
dt_iop_module_t *self)
     // user is typing, don't overwrite it.
     g->current_aspect = -2.0f;
     // reset to free aspect ratio:
-    dt_conf_set_int("plugins/darkroom/clipping/aspect_preset", -1);
+    dt_conf_set_int("plugins/darkroom/clipping/aspect_preset", -1);*/

can probably now be deleted (we still have it in git if we need it).
that applies to a handful of lines of code more i guess.

cheers,
 jo

On Sat, Mar 2, 2013 at 9:20 AM, AlicVB <alic...@gmail.com> wrote:
> Le 01/03/2013 15:03, Richard Levitte a écrit :
>> Hi,
> hi
>> I just had a closer look, and summary of it all: I like!
>>
>> I have found one thing that differs from before...  not sure if this
>> is something you care about or not, but...  before your changes, the
>> code would adapt the aspect ratio to the original picture format.  For
>> example, if I chose 5:4 and the picture is vertical (portrait), the
>> aspect ratio would automagically be auto-flipped to 4:5.  This isn't
>> happening in your branch.  It's really a small thing, I'm not even
>> sure if I'd be annoyed...
> I've dropped that because it was quite difficult to do this correctly.
> If the image has no distortion applied, no pb. but if the image has been
> flipped, rotated, keystoned, or whatever, this is really more difficult.
> Especially because some of the distortions can come from the same iop...
>>
>> Also, while speaking of flipping the aspect ratio, I've always
>> wondered if the aspect flipping shouldn't be saved...  from looking at
>> your code, all the needed changes would be in aspect_presets_changed,
>> all that's needed is to care about the sign of d and p->ratio_d,
>> wouldn't it?
> You mean, saving the ration flipping in params or in the conf file. For
> the first, it's done, but I don't think it's a good idea to save it in
> the conf file. the next image you open may not have the same orientation.
>>
>> Last comment, from the pure code management point of view; I noticed
>> that the aspect ratio data exists in three places in the code.  My gut
>> feeling says that this can be a source of errors (inconsistent updates
>> of numbers).  I'd suggest having those numbers in a constant array,
>> ratios[RATIO_COUNT][2] or something like that and use those...
> You're right, will try that asap.
>>
>> The way I see it, this does replace PR 159.  I'll simply delete the
>> corresponding branch.
>>
>> Cheers,
>> Richard
> Aldric
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> darktable-devel mailing list
> darktable-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/darktable-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
darktable-devel mailing list
darktable-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to