Using libraw_dcraw_make_mem_image
I need to get the image as simple rgb-array and it seems that libraw_dcraw_make_mem_image() is the right function for that.
But how to use it? I mean, what is the minimum output-parameters to set? I tried (in c# with SharpLibRaw):
var handler = libraw_init(LibRaw_init_flags.LIBRAW_OPTIONS_NONE); libraw_open_file(handler, "DSC08185.ARW"); libraw_unpack(handler); libraw_dcraw_process(handler); var pointer = libraw_dcraw_make_mem_image(handler, ref errc); var image= PtrToStructure<libraw_processed_image_t>(pointer ); libraw_dcraw_clear_mem(pointer ); libraw_close(handler);
Now I have these values in image-struct:
bits 8 ushort colors 3 ushort @data {byte[1]} byte[] data_size 72721728 uint height 4024 ushort @type LIBRAW_IMAGE_BITMAP LibRAW.RAWLib.LibRaw_image_formats width 6024 ushort
data is unfortunate empty. How to get the rgb-pixels in data?
Recent comments