Skip to content

Commit 25a1ea5

Browse files
committed
corrected problem with margins
1 parent f3157b6 commit 25a1ea5

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/iop/demosaic.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,9 +2853,15 @@ void modify_roi_in(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *
28532853
const gboolean passthrough = (method == DT_IOP_DEMOSAIC_PASSTHROUGH_MONOCHROME) ||
28542854
(method == DT_IOP_DEMOSAIC_PASSTHR_MONOX);
28552855

2856-
// set position to closest sensor pattern snap
2857-
if(!passthrough)
2856+
if(data->pixelshift_enable)
28582857
{
2858+
//pixelshift requires 1px margin
2859+
roi_in->width = MIN(roi_in->width + 1, piece->pipe->image.width);
2860+
roi_in->height = MIN(roi_in->height + 1, piece->pipe->image.height);
2861+
}
2862+
else if(!passthrough)
2863+
{
2864+
// set position to closest sensor pattern snap
28592865
const int aligner = (piece->pipe->dsc.filters != 9u) ? BAYER_SNAPPER : XTRANS_SNAPPER;
28602866
const int dx = roi_in->x % aligner;
28612867
const int dy = roi_in->y % aligner;
@@ -2995,9 +3001,9 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29953001
const size_t col_offset = 1;
29963002
const size_t row_offset = roi_out->width;
29973003

2998-
for(size_t j = 1; j < roi_out->height-1; j++)
3004+
for(size_t j = 0; j < roi_out->height-1; j++)
29993005
{
3000-
for(size_t i = 1; i < roi_out->width-1; i++)
3006+
for(size_t i = 0; i < roi_out->width-1; i++)
30013007
{
30023008
size_t pout = (size_t)4 * (((size_t)roi_out->width * j) + i);
30033009
size_t pin = (roi_in->width * j) + i;
@@ -3034,8 +3040,8 @@ void process(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const
30343040
dt_dev_clear_rawdetail_mask(piece->pipe);
30353041

30363042
fprintf(stderr, "demosaic, %s\n", dt_pixelpipe_name(piece->pipe->type));
3037-
//fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
3038-
//fprintf(stderr, "roi out %d %d %d %d\n", roi_out->x, roi_out->y, roi_out->width, roi_out->height);
3043+
fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
3044+
fprintf(stderr, "roi out %d %d %d %d\n", roi_out->x, roi_out->y, roi_out->width, roi_out->height);
30393045
dt_iop_roi_t roi = *roi_in;
30403046
dt_iop_roi_t roo = *roi_out;
30413047
roo.x = roo.y = 0;

src/iop/rawprepare.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ void process(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const
356356
const dt_iop_rawprepare_data_t *const d = (dt_iop_rawprepare_data_t *)piece->data;
357357

358358
fprintf(stderr,"rawprepare %s\n", dt_pixelpipe_name(piece->pipe->type));
359-
//fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
360-
//fprintf(stderr, "roi out %d %d %d %d\n", roi_out->x, roi_out->y, roi_out->width, roi_out->height);
359+
fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
360+
fprintf(stderr, "roi out %d %d %d %d\n", roi_out->x, roi_out->y, roi_out->width, roi_out->height);
361361
/*fprintf(stderr,"frame size in: %d\n", roi_in->width * roi_in->height);
362362
fprintf(stderr,"frame size iout: %d\n", roi_out->width * roi_out->height);*/
363363
//fprintf(stderr,"i: %p\n",ivoid);

0 commit comments

Comments
 (0)