| Thread Tools | Search this thread |
|---|
normanholz
| November 4, 2009 9:29 AM PST Problems encoding image data in a managed (.Net) byte array via UIC | ||||
Hi everyone, I am trying to encode image data from a managed byte array (.Net) via the UIC Samples / the "image" classes from the sample applications (picnic and transcoder). I thought about this: // execution status ExcStatus res, resOut; // image class --> after reading the raw data this holds the image information // image is param to 2. encoding step CIppImage img; // Parameter for the raw data reading step PARAMS_RAW param; // buffer in which the raw bytes are copied:( Ipp8u* buf; int len = imageData->Length; // 1. put data in CMemBuffInput (unmanaged code) CMemBuffInput cmi; buf = (Ipp8u*)ippMalloc(len); // use pinpointer to prevent data from being garbage collected pin_ptr<Byte> p = &imageData[0]; cmi.Open(p,len); //set raw params param.height = height; param.width = width; param.nchannels = 3; param.precision = 8; param.offset = 0; param.color = JC_RGB; // 2. use Raw::ReadImageRaw( res = ReadImageRAW(cmi, param, img); bool rawSuccess = IsOk(res); img.Color(JC_RGB); // 4. define output stream CMemBuffOutput mo; Ipp8u* bufOut; bufOut = (Ipp8u*)ippMalloc(len); mo.Open(bufOut, len); resOut = SaveImageRAW(img, param, mo); bool rawWriteSuccess = IsOk(resOut); PARAMS_BMP params_bmp; resOut = SaveImageBMP(img, params_bmp, mo); bool bmpWriteSuccess = IsOk(resOut); Question: Is this the way the UIC usage is intended? Unfortunately, the Saving as BMP returns no error code but crashes with Visual Studio complaining about a corrupted Heap with this message: HEAP[appname.exe]: Invalid Address specified to RtlFreeHeap( 00170000, 10015988 ) Windows has triggered a breakpoint in appname.exe. This may be due to a corruption of the heap, and indicates a bug in appname.exe or any of the DLLs it has loaded. Any hint on how to solve this problem or to tackle my encoding task would be highly appreciated, Many thanks in advance and kind regards, Norman | |||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
| 8493 users have contributed to 31630 threads and 100780 posts to date. |
|---|
| In the past 24 hours, we have 25 new thread(s) 126 new posts(s), and 162 new user(s). In the past 3 days, the most popular thread for everyone has been Implicite multithreading ??? The most posts were made to Crash when loading skeleton The post with the most views is Dear Steve, excuse me for a d Please welcome our newest member mdward |