- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an image buffer that has RGB data inside. I want to get only the data of one channel. It seems like the function ippiCopy_8u_C3C1R can do it, but there is no parameter the let me specify which channel to copy?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that the ippiCopy_8u_C3C1R function copies the "first" channel in the source buffer. By offsetting the source buffer, (by 1 or 2), you can choose which channel to copy...
Copy red channel:
ippiCopy(rgb, rgbStep, singleChannel, singleChannelStep, size);
Copy green channel:
ippiCopy(rgb+1, rgbStep, singleChannel, singleChannelStep, size);
Copy blue channel:
ippiCopy(rgb+2, rgbStep, singleChannel, singleChannelStep, size);
... otherwise, you can use ippiCopy_8u_C3P3R - however, this will copy all three channels to 3 separate buffers.
Copy red channel:
ippiCopy(rgb, rgbStep, singleChannel, singleChannelStep, size);
Copy green channel:
ippiCopy(rgb+1, rgbStep, singleChannel, singleChannelStep, size);
Copy blue channel:
ippiCopy(rgb+2, rgbStep, singleChannel, singleChannelStep, size);
... otherwise, you can use ippiCopy_8u_C3P3R - however, this will copy all three channels to 3 separate buffers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
absolutely correct
Thank you Thomas
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page