Skip to content

Commit 4ef692e

Browse files
committed
looks ok, but still issues with frame offset
1 parent 302ac0c commit 4ef692e

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/develop/imageop.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ typedef struct dt_iop_roi_t
2828
{
2929
int x, y, width, height;
3030
float scale;
31+
int frame_offset;
3132
} dt_iop_roi_t;
3233

3334
#include "common/darktable.h"

src/iop/demosaic.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,8 +2950,7 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29502950
float const * frames_in[4];
29512951
for(int f = 0; f < 4; ++f)
29522952
{
2953-
/// TODO need original size here
2954-
frames_in[f] = in + (f * piece->buf_in.width * piece->buf_in.height);
2953+
frames_in[f] = in + (f * roi_in->width * roi_in->height);
29552954
}
29562955

29572956
if(piece->dsc_out.channels != 4)
@@ -2962,6 +2961,8 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29622961
fprintf(stderr, "pixelshift enabled, pipe type: %s\n", dt_pixelpipe_name(piece->pipe->type));
29632962
fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
29642963
fprintf(stderr, "roi out %d %d %d %d\n", roi_out->x, roi_out->y, roi_out->width, roi_out->height);
2964+
fprintf(stderr, "i: %p\n",in);
2965+
fprintf(stderr, "o: %p\n",out);
29652966

29662967
/*__asan_describe_address((void*)in);
29672968
fflush(stdout);
@@ -2989,7 +2990,7 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29892990

29902991
for(size_t c=0;c<3;++c)
29912992
{
2992-
out[pout+c] = (frames_in[1])[pin3];
2993+
out[pout+c] = (frames_in[0])[pin3];
29932994
}
29942995
}
29952996
}

src/iop/rawprepare.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ void modify_roi_out(dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, dt_iop
212212
const float scale = roi_in->scale / piece->iscale;
213213
roi_out->width -= (int)roundf((float)x * scale);
214214
roi_out->height -= (int)roundf((float)y * scale);
215+
216+
if(piece->pipe->type & (DT_DEV_PIXELPIPE_FULL | DT_DEV_PIXELPIPE_EXPORT))
217+
{
218+
if(piece->pipe->image.buf_dsc.frames > 1)
219+
{
220+
roi_out->frame_offset = roi_out->width * roi_out->height;
221+
}
222+
}
215223
}
216224

217225
void modify_roi_in(dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *const roi_out,
@@ -343,13 +351,13 @@ void process(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const
343351
{
344352
const dt_iop_rawprepare_data_t *const d = (dt_iop_rawprepare_data_t *)piece->data;
345353

346-
//fprintf(stderr,"rawprepare %s\n", dt_pixelpipe_name(piece->pipe->type));
347-
/*fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
354+
fprintf(stderr,"rawprepare %s\n", dt_pixelpipe_name(piece->pipe->type));
355+
fprintf(stderr, "roi in %d %d %d %d\n", roi_in->x, roi_in->y, roi_in->width, roi_in->height);
348356
fprintf(stderr, "roi out %d %d %d %d\n", roi_out->x, roi_out->y, roi_out->width, roi_out->height);
349-
fprintf(stderr,"frame size in: %d\n", roi_in->width * roi_in->height);
350-
fprintf(stderr,"frame size iout: %d\n", roi_out->width * roi_out->height);
357+
/*fprintf(stderr,"frame size in: %d\n", roi_in->width * roi_in->height);
358+
fprintf(stderr,"frame size iout: %d\n", roi_out->width * roi_out->height);*/
351359
fprintf(stderr,"i: %p\n",ivoid);
352-
fprintf(stderr,"o: %p\n",ovoid);*/
360+
fprintf(stderr,"o: %p\n",ovoid);
353361

354362
const int csx = compute_proper_crop(piece, roi_in, d->x);
355363
const int csy = compute_proper_crop(piece, roi_in, d->y);

0 commit comments

Comments
 (0)