Currently openjpeg allocates the buffer for the decoded pixel data. This requires the library consumer to copy data out of obj_image->comps and into its own buffer. In some cases, the library consumer will already have the buffer allocated that it wants to store the decode pixel data in. It would be great if openJPEG could decode into this externally supplied buffer to avoid unnecessary memory use and copying.
Any updates on this? I'm using openjpeg to decode many images on disk to display as a video stream and have my own allocated buffer. This feature would be really helpful to save the extra copy
Currently openjpeg allocates the buffer for the decoded pixel data. This requires the library consumer to copy data out of obj_image->comps and into its own buffer. In some cases, the library consumer will already have the buffer allocated that it wants to store the decode pixel data in. It would be great if openJPEG could decode into this externally supplied buffer to avoid unnecessary memory use and copying.