Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Could anyone tell me about format conversion of PXCImage

krishna_m_1
Beginner
652 Views

hi,

How to convert the   PXCImage in PIXEL_FORMAT_RGB32  to PXCImage in PIXEL_FORMAT_RGB24 ??

0 Kudos
1 Reply
jb455
Valued Contributor II
652 Views

I haven't tried this myself but from looking at the docs, you may have some luck using the CopyImage method. So if you have a 32 bit image (oldImage), you could try creating a new 24 bit image and copying the former to the latter. Something like:

 

PXCMImage.ImageInfo iinfo=new PXCMImage.ImageInfo() {
    width=oldImage.Width, height=oldImage.Height, format=PXCMImage.ColorFormat.COLOR_FORMAT_RGB24
};

PXCMImage newImage=session.CreateImage(iinfo);
if(newImage.Copy(oldImage) != PXCMStatus.
STATUS_PARAM_UNSUPPORTED)
   //
The function returned successfully.
else
   //
Failed to copy image due to unsupported pixel format conversion.

Again, no idea if this will work, but worth a try maybe? 

0 Kudos
Reply