Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6763 Discussions

Cannot use ColorConversion with VC++ 2005 on Intel pentium D. (static link)

elevenmice
Beginner
472 Views
Hi guys,

I'm trying to use ippiRGBToHLS_8u_AC4R in my C++ program but i get a crash in disassembly.

here's my code:

// this is what i added at the top of the file

#define IPPAPI(type,name,arg) extern type __STDCALL w7_##name arg;
#define IPPCALL(name) w7_##name
#include
//#include
//#include


// this is inside my function

m_width = 320;
m_height = 240;

Ipp8u* unBuffer = new Ipp8u( m_width * m_height * 4 );

IppiSize size;
size.width = m_width;
size.height = m_height;


IPPCALL(ippiRGBToHLS_8u_AC4R)((Ipp8u*)(input[0]), nInStride * 4, unBuffer, m_width * 4, size );

//input[0] points to the first row of my frame. It has a stride of -320.

The libraries i added were:

ippccmerged.lib ippcorel.lib

I tried to do a static link with dispatch and added library ippccemerged.lib, but my program still crashes. Everything compiles fine but when i run it, it just blows up.

Am I doing something wrong here. I lost a whole day with this. please help. :(

cheers
chetan
0 Kudos
4 Replies
bendeguy
Beginner
472 Views

Hi!

Did you try to debug it? What happened? I know that can't be the problem, but in IPP you can allocate memory with ippsMalloc (for Ipp8u use ippsMalloc_8u) and free memory with ippsFree.
You forgot to call ippStaticInit. And I think you don't need the

#define IPPAPI(type,name,arg) extern type __STDCALL w7_##name arg;
#define IPPCALL(name) w7_##name

lines because you are using dispatching.

Greetings,

Bendeguy

0 Kudos
elevenmice
Beginner
472 Views
I made a really stupid mistake :(

Instead of writing:

Ipp8u* unBuffer = new Ipp8u( m_width * m_height * 4 );

I should have written

Ipp8u* unBuffer = new Ipp8u[ m_width * m_height * 4 ];


Now everything is working. :)

I was looking at the other posts and someone mentioned something about IPP not accepting negetive strides. I have tried it and so far it looks that IPP does allow negative strides. it work fine.

Alrite then.
chetan
0 Kudos
elevenmice
Beginner
472 Views
hey guys i got one more question,

I have the HLS values in unbuffer. So i was wondering how do i retrieve them?

H should vary from 0 to 360
L from 0 to 1
S from 0 to 1

Does H take 2 bytes
And S and L take one byte each?

I mean what's the order of things?
0 Kudos
Vladimir_Dudnik
Employee
472 Views

Hello,

readying of IPP manual could help in understanding of this. In IPP we use AC4 to mark images with alpha channel. Image processing functions do not touch alpha pixels if they really do not need it, it means alpha channel will stay unchanged.

Regards,
Vladimir

0 Kudos
Reply