Access RGB values from libraw_processed_image_t

I am under way to build libraw support for another media management system called Photoslide ( and wanted to add libraw support.

Using java and the foreign memory api I can access libraw without any issues.

Nevertheless I am facing the issue how I can access the rgb (rgba) values of the in memory image because I do not want to write first a tiff file and then read the pixels again from the temp file.

Therefore I have seen it is possible to use the libraw_dcraw_make_mem_image to create a representation of the pixels in memory. But the documentation say's that I am getting back a struct libraw_processed_image_t which includes data[] as field. But there is no documentation what is realy given back (array of bytes, array of ints, array of floats).
Please can you help me with the format of the data or can you point me where I can get the data otherwise if this method should not be used ?

I am not a C developer and maybe this is a beginners question but I would appreciate to get an answer.

Target would be to get processed pixels in 8-bit or 16-bit rgb (rgba) values.

Thank you in advance.


&data[0] is pointer to start

&data[0] is pointer to start of data
Actual data is either 1 or 2 bytes per pixel (depends on imgdata.params.output_bps), no extra padding.

See mem-image.cpp sample, it covers all/most cases (1/3 channels, 8 and 16 bits)

-- Alex Tutubalin @LibRaw LLC

Thank you for the hint. I

Thank you for the hint. I managed now to get the data but actually the resulted image is greyscale and cut off but the root cause could be something different. I will post some code here after it works to help people using the java foreign memory api.