A question about "dcraw_make_mem_image"

Hi Alex,

For the image data generated from "dcraw_make_mem_image()", I see it is of "uchar" type according to the documentation:

"
unsigned char data[] Data array itself.
Should be interpreted as RGB triplets for bitmap type and as JPEG file for JPEG type.
"

For 16-bit image, when I need to convert "uchar" data array to "float" data array, the "original" values won't stay so the image won't convert correctly.

I am just wondering are there any functions that return "floating-point" data array after "dcraw_process()" is called.

I am aware that in dcraw, it has something like "ushort curve[ ]" and a function of "write_ppm_tiff()" to handle the difference between 8-bit and 16-bit output, specifically the section of code from line#19365 to line#19374 in "LibRaw/dcraw.c"

Thanks,

Mio

Forums: 

LibRaw is internally 16-bit

LibRaw is internally 16-bit unsigned int, so float conversion looks useless.
For 16-bit output just use explicit type conversion to (ushort*) for libraw_processed_image_t->data.

-- Alex Tutubalin

Hi Alex,

Hi Alex,

Thanks for replying!

I actually used the conversion to "ushort *" right after posting the question. It seemed to work fine.

Have a nice day!

Mio