Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Antialiasing in OpenVG - on QNX ARM platform (IMX35 hardware): (4 Items)
   
Antialiasing in OpenVG - on QNX ARM platform (IMX35 hardware)  
Hello,

I am pretty new in the OpenVG application development. I am using OpenVG1.1 libraries for the same. I need to improve 
the line drawing quality in my existing QNX/ARM/IMX35 based application. 

The line drawing quality is not good in the existing app, therefore I want to apply Multi-sampling on the drawing, but 
not sure the correct method of applying it in OpenVG.

Following are the EGL config attributes I'm using in my application:

EGLint egl_conf_attr[] = {
    EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
    EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
    EGL_DEPTH_SIZE, EGL_DONT_CARE,
    EGL_LEVEL, EGL_DONT_CARE,
    EGL_TRANSPARENT_TYPE, EGL_DONT_CARE,
    EGL_RED_SIZE, EGL_DONT_CARE,
    EGL_GREEN_SIZE, EGL_DONT_CARE,
    EGL_BLUE_SIZE, EGL_DONT_CARE,
    EGL_ALPHA_SIZE, EGL_DONT_CARE,
    EGL_BUFFER_SIZE, EGL_DONT_CARE,
    EGL_SAMPLE_BUFFERS, 0, /* value 1 doesn't work*/
    EGL_STENCIL_SIZE, EGL_DONT_CARE,
    EGL_SAMPLES, EGL_DONT_CARE,
    EGL_CONFIG_ID, EGL_DONT_CARE,
    EGL_NONE
};

I have already been using vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_BETTER) API so that OpenVG applies anti-aliasing, 
but the line quality is still poor and lines are jagged.

As per OpenVG/EGL documents i.e. "openvg-1.1.pdf" and "eglspec.1.4.withchanges.20090422.pdf", EGL_SAMPLE_BUFFERS 
attribute can be used for multisampling. But setting the value of EGL_SAMPLE_BUFFERS as 1 (default is 0), fails the 
eglChooseConfig() API.  

Can someone let me know how to use multisampling (antialiasing) in OpenVG image drawing? Some sample code/example would 
be really helpful. Attached is the sample code I am using for the proof of concept which draws two diagonal lines.


Thanks a lot.
Shivendra
Attachment: Text OVGTest1.cc 20.95 KB
Re: Antialiasing in OpenVG - on QNX ARM platform (IMX35 hardware)  
Just to add that the sample code i.e. "tiger" app given by OpenVG/Kornos has following configuration attributes:

EGLint egl_conf_attr[] = {
 	EGL_RED_SIZE,		8,
	EGL_GREEN_SIZE, 	8,
	EGL_BLUE_SIZE,		8,
	EGL_ALPHA_SIZE, 	8,
	EGL_LUMINANCE_SIZE, EGL_DONT_CARE,			
	EGL_SURFACE_TYPE,	EGL_WINDOW_BIT,
	EGL_SAMPLES,		1,
	EGL_NONE
}; 


The above configuration attributes dont work on my application. they fail at eglChooseConfig() call. Do I need to 
configure my hardware or do I need some different library for the same?

-Shivendra
RE: Antialiasing in OpenVG - on QNX ARM platform (IMX35 hardware)  
Hi Shivendra,
	Unfortunately, the OpenVG driver for the iMX35 doesn't currently support multisampling, and that explains why you 
cannot choose a config with EGL_SAMPLE_BUFFERS set to 1.

Cheers,
Gaétan

-----Original Message-----
From: Shivendra Tiwari [mailto:community-noreply@qnx.com] 
Sent: June 18, 2009 4:58 PM
To: openvg-graphics
Subject: Antialiasing in OpenVG - on QNX ARM platform (IMX35 hardware)

Hello,

I am pretty new in the OpenVG application development. I am using OpenVG1.1 libraries for the same. I need to improve 
the line drawing quality in my existing QNX/ARM/IMX35 based application. 

The line drawing quality is not good in the existing app, therefore I want to apply Multi-sampling on the drawing, but 
not sure the correct method of applying it in OpenVG.

Following are the EGL config attributes I'm using in my application:

EGLint egl_conf_attr[] = {
    EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
    EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
    EGL_DEPTH_SIZE, EGL_DONT_CARE,
    EGL_LEVEL, EGL_DONT_CARE,
    EGL_TRANSPARENT_TYPE, EGL_DONT_CARE,
    EGL_RED_SIZE, EGL_DONT_CARE,
    EGL_GREEN_SIZE, EGL_DONT_CARE,
    EGL_BLUE_SIZE, EGL_DONT_CARE,
    EGL_ALPHA_SIZE, EGL_DONT_CARE,
    EGL_BUFFER_SIZE, EGL_DONT_CARE,
    EGL_SAMPLE_BUFFERS, 0, /* value 1 doesn't work*/
    EGL_STENCIL_SIZE, EGL_DONT_CARE,
    EGL_SAMPLES, EGL_DONT_CARE,
    EGL_CONFIG_ID, EGL_DONT_CARE,
    EGL_NONE
};

I have already been using vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_BETTER) API so that OpenVG applies anti-aliasing, 
but the line quality is still poor and lines are jagged.

As per OpenVG/EGL documents i.e. "openvg-1.1.pdf" and "eglspec.1.4.withchanges.20090422.pdf", EGL_SAMPLE_BUFFERS 
attribute can be used for multisampling. But setting the value of EGL_SAMPLE_BUFFERS as 1 (default is 0), fails the 
eglChooseConfig() API.  

Can someone let me know how to use multisampling (antialiasing) in OpenVG image drawing? Some sample code/example would 
be really helpful. Attached is the sample code I am using for the proof of concept which draws two diagonal lines.


Thanks a lot.
Shivendra

_______________________________________________
OpenVG
http://community.qnx.com/sf/go/post32076
Re: RE: Antialiasing in OpenVG - on QNX ARM platform (IMX35 hardware)  
Hi Gaétan,

Thank you so much for your reply.

Is there some work around for IMX35 so that we can have quality line drawing?

Any ideas and help would be appreciated.

Thanks,
Shivendra