Question

Using OpenVG 1.1 I am trying to dump a VGImage to a file to confirm things are working but I am unsure how to access the raw RGBA data of the VGImage. Using vgReadPixels to capture the data to a char array does somewhat work but before I spend much more time getting the formatting correct on this I'd like to know if there's a better way to capture the VGImage data as captured with vgGetPixels.

This is being done on an i.MX53 in Linux using Freescale's BSP.

Was it helpful?

Solution

vgReadPixels lets you access data from the current drawing surface bypassing any VGImage. This function lets you dump the current image that would be presented into a color-image.

If you want to dump the content of an VGImage object vgReadPixels is not the function you want to use.

Instead call vgGetImageSubData on the VGImage object. For best precision you should use the same format as used in the vgCreate command. If you use a different format you will still get the content of the image, but it will be processed using a color-conversion process which might slightly degrade the image quality due to round-off effects that may happen during conversion.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top