From: Scott W. <sco...@sb...> - 2013-11-15 16:15:33
|
How do I use this function? I would rather take advantage of jpeg_mem_dest, then directing through the file system with the 'stdio' versions. unsigned long size; /* Not set? */ unsigned char *dest; jpeg_mem_dest(&cinfo,&dest,&size); /* dest points to memory that who is responsible for freeing? */ Specifically, who owns the memory, and does it go out of scope on "destroy" or "finish"? Do I need to copy the buffer to my own memory before calling the destroy_compress function? Or is the memory persistent, and I need to free it on my own? Does the size argument have to be initialized to anything? And is the size pointer "remembered" so that it contains the correct value at "finish_compress"? No other call is needed to get the final size? The header file has is value in answering this question. (In a windows DLL, if the DLL owns memory, my program would not be able to free it... This isn't a windows project yet, but may be ported over) And more generally, is there a good reference doc for these functions available? As an example, the LibTiff doc gives in depth descriptions of the functions. I'd really find something equivalent very useful for LibJpeg. Thanks. -Scott Weber |