File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -280,9 +280,10 @@ void dng_save(std::vector<libcamera::Span<uint8_t>> const &mem, StreamInfo const
280
280
for (unsigned int x = 0 ; x < (info.width >> 4 ); x++)
281
281
{
282
282
unsigned int off = (y * info.width + x) << 4 ;
283
- int grey = buf[off] + buf[off + 1 ] + buf[off + info.width ] + buf[off + info.width + 1 ];
284
- grey = white * sqrt (grey / (double )white); // fake "gamma"
285
- thumb_buf[3 * x] = thumb_buf[3 * x + 1 ] = thumb_buf[3 * x + 2 ] = grey >> (bayer_format.bits - 6 );
283
+ uint32_t grey = buf[off] + buf[off + 1 ] + buf[off + info.width ] + buf[off + info.width + 1 ];
284
+ grey = (grey << 14 ) >> bayer_format.bits ;
285
+ grey = sqrt ((double )grey); // simple "gamma correction"
286
+ thumb_buf[3 * x] = thumb_buf[3 * x + 1 ] = thumb_buf[3 * x + 2 ] = grey;
286
287
}
287
288
if (TIFFWriteScanline (tif, &thumb_buf[0 ], y, 0 ) != 1 )
288
289
throw std::runtime_error (" error writing DNG thumbnail data" );
You can’t perform that action at this time.
0 commit comments