Skip to content

Commit e32400a

Browse files
committed
this should behave like monochrome passthru but doesn't
1 parent 32d0cf3 commit e32400a

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

src/iop/demosaic.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2973,18 +2973,34 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29732973
{
29742974
for(size_t i = 0; i < roi_out->width; i++)
29752975
{
2976-
pout = 4 * ((roi_out->width * j) + i);
2976+
pout = (size_t)4 * ((roi_out->width * j) + i);
29772977
pin = (roi_in->width * (j + oy)) + ox + i;
29782978

2979+
if(pin >= 24000000)
2980+
{
2981+
fprintf(stderr,"input overflow\n");
2982+
}
2983+
2984+
if(pin >= 24000000)
2985+
{
2986+
fprintf(stderr,"input overflow\n");
2987+
}
2988+
2989+
if(pout >= ((size_t)4*roi_out->height*roi_out->width))
2990+
{
2991+
fprintf(stderr,"output overflow\n");
2992+
}
2993+
29792994
for(size_t c=0;c<3;++c)
29802995
{
29812996
out[pout+c] = (frames_in[0])[pin];
2997+
//out[pout+c] = (float) pin / ((float) roi_out->height * roi_out->width);
29822998
}
29832999

2984-
out[pout + 0] = (float) j / (float) roi_out->height;
3000+
/*out[pout + 0] = (float) j / (float) roi_out->height;
29853001
out[pout + 1] = (float) i / (float) roi_out->width;
29863002
out[pout + 2] = 0.0f;
2987-
out[pout + 3] = 0.0f;
3003+
out[pout + 3] = 0.0f;*/
29883004

29893005

29903006

@@ -3000,6 +3016,7 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
30003016
out[pout+3] = 0.0f;*/
30013017
}
30023018
}
3019+
fprintf(stderr,"pout: %lu\n", pout+4);
30033020
}
30043021

30053022

src/iop/rawprepare.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ static void convert_uint_float(const uint16_t *const in, float *const out, const
284284

285285
const int id = BL(roi_out, d, j, i);
286286
out[pout] = (in[pin] - d->sub[id]) / d->div[id];
287+
//out[pout] = ((j/10)%2)?1.0f:0.0f;
287288
}
288289
}
289290
}

0 commit comments

Comments
 (0)