Hi
I asked similar questions some time ago, please find bellow the answers
that Johannes gave me.
Regards,
rawfiner

About scales:

> What is the difference between:
> -roi_out->scale

that is the current output region of interest scale, relating what
would happen when you had processed the full resolution image vs. what
is actually being processed in the pipe now. sorry i forget which way
around scale = a/b or = b/a it is.

> -piece->iscale

this is the input scale factor, i.e. how much did the pipeline where
the current piece belongs to downsize the real input (raw image)
before throwing it into the pipeline. this should be 1.0 for the full
and export pipelines and may be different for the preview. again i
forgot whether this should be < or > 1 in that case.

> -self->dev->preview_pipe->iscale

if the piece is a piece of the preview pipeline, these last two should
be the same (the piece copies iscale and iwidth/iheight for
convenience. also there were places at least in the past where you
would have the piece but not the whole pipe)

> And the difference between:
> -roi_out->width

the size of the output buffer that is passed to process() for
instance. note that these may be different for each module, because
some require some padding or need to run on full res bayer data, do
distortions etc.

> -piece->iwidth

see above. width of the prescaled input. should be == raw resolution
unless you're running a preview pipeline.


> -self->dev->preview_pipe->processed_width

that's the output size of the fully processed image, i.e. what would
be stored on disk if you were running an export pipeline. this is
needed up front to get scale to fit work correctly for instance. it's
computed by a chain of modify_roi_out() which is run in a first pass
with the full input buffer resolution and full region of interest.

> -self->dev->width

that is the size of the develop view. i.e. if you need to determine
the scale factor for the pipeline, you would relate this view window
size to the processed_width above, and then run the pipeline.


About roi:

1) a pass of modify_roi_out() from raw to screen output is performed.
this is done full resolution, full region of interest, to determine
the hypothetical size of the output image when processed in full.

2) given the size and region of interest of the view window, the
develop module requests a certain input to be able to render the
output. this is done by calling a chain of modify_roi_in() from view
window back to raw image. this is only done on the exact pixels that
are needed on screen right now, i.e. scaled and cropped.

3) process() is called with about exactly the ROI that were computed
in pass number 2. i think there are some minor sanity checks done, so
you shouldn't rely on what you asked for in modify_roi_in but use what
you get in process().



Le mer. 3 oct. 2018 à 10:58, <buligin...@yandex.ru> a écrit :

> Hello!
>
> I want to rewrite the module "shadhi.c". In every iop module are described
> function process() with input arguments "struct dt_dev_pixelpipe_iop_t
> *piece" and "const struct dt_iop_roi_t *const roi_in".
>
> Could you explain pls how variables roi_in and piece are chosen? These
> values are constantly changing every time. I can't find it in the code.
>
> What does "roi_in->scale" and "piece->iscale" mean?
>
> Thank you.
>

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

Reply via email to