heya,

On Wed, May 9, 2018 at 12:27 PM, rawfiner <rawfi...@gmail.com> wrote:
> 2018-05-08 17:16 GMT+02:00 johannes hanika <hana...@gmail.com>:
>> i'm guessing you want to detect whether you are running a
>> DT_DEV_PIXELPIPE_FULL pipe in darkroom mode (as opposed to
>> DT_DEV_PIXELPIPE_PREVIEW or _EXPORT) and then do this downscaling
>> yourself before running your algorithm on reduced resolution.
>>
>
> Yes, and I would like to know the zoom factor in case of
> DT_DEV_PIXELPIPE_PREVIEW , in order to downscale only if the image is
> sufficiently zoomed out (for example, I don't want to downscale the image if
> the zoom is at 90%, but I want to downscale if it is below 50%).

right. to determine the total scale factor, you would need to do
something like for instance in sharpen.c:

const int rad = MIN(MAXR, ceilf(d->radius * roi_in->scale / piece->iscale));

which determines the pixel radius scaled by input buffer scaling
(iscale) and region of interest scaling (roi_in->scale).

note that the preview pipe is what fills the whole image but
downscaled (iscale != 1) in the navigation view in the top left
corner. the "full" pipeline fills the pixels in the center view of
darkroom mode, at exactly the scale and crop you see on screen (iscale
== 1 mostly but the other scale and bounds in roi_in will change with
the current view).

to find out whether you're running either one of the two you'd write
something similar to bilat.c:

if(self->dev->gui_attached && g && piece->pipe->type ==
DT_DEV_PIXELPIPE_PREVIEW)

cheers,
 jo
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Reply via email to