AllenBarnett
Posts: 7
Joined: Thu Dec 26, 2013 9:48 pm

Square sqaures, Circular circles

Sun Jan 05, 2014 3:44 pm

My Pi is connected via the composite output to one of these tiny TVs: http://www.adafruit.com/products/946. I'm working on an application using OpenVG. I'm trying to find a combination of /boot/config.txt attributes, DISPMANX/EGL buffer size, and OpenVG view matrix such that drawing fills the TV screen and squares are square and circles are, well, circular. Does anybody have a suggestion for sdtv_mode|aspect, src/dst rect arguments to vc_dispmanx_element_add, and maybe vgLoadMatrix for this TV?

Thanks,
Allen

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Square sqaures, Circular circles

Mon Jan 06, 2014 3:14 am

Hi Allen,

I don't have one of these displays, but here is my thoughts. The display has 480x272 pixels and then displays either a NTSC or PAL analog signal from the Raspberry Pi. The composite signal will always be 720x480 @ 60Hz for NTSC and 720x576 @ 50Hz for PAL. So the display will re-sample the analog signal anyway. I had a look at sdtv_aspect in config.txt. Assuming the pixels in your display are square, I would assume that the best setting for sdtv_aspect would be sdtv_aspect=2 (giving a 16:9 aspect ratio) as this is the closest to the ratio 480/272. However, from my brief testing of sdtv_aspect it would appear that the setting only affects the framebuffer and has no effect on other DispmanX layers.

I think your idea of using the src and dst rectangles in vc_dispmanx_element_add() is a good one. Keep the src rect to the size of the actual element you are adding and then adjust the height in the dst rect until you achieve the required result. As I say I don't have the display, so I think your best bet is to draw a single square that takes up most of the screen and measure it. Adjust, the height of the dst rect until you get the desired result.

Hope that helps.

AllenBarnett
Posts: 7
Joined: Thu Dec 26, 2013 9:48 pm

Re: Square sqaures, Circular circles

Mon Jan 06, 2014 12:29 pm

Thanks for tip, Andy. I'll break out the tape measure.

(Still getting the hang of this forum interface.)

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Square sqaures, Circular circles

Mon Jan 06, 2014 3:56 pm

AllenBarnett wrote:My Pi is connected via the composite output to one of these tiny TVs: http://www.adafruit.com/products/946. I'm working on an application using OpenVG. I'm trying to find a combination of /boot/config.txt attributes, DISPMANX/EGL buffer size, and OpenVG view matrix such that drawing fills the TV screen and squares are square and circles are, well, circular. Does anybody have a suggestion for sdtv_mode|aspect, src/dst rect arguments to vc_dispmanx_element_add, and maybe vgLoadMatrix for this TV?

Thanks,
Allen
you may want to try a high-level library to help you: https://github.com/ajstarks/openvg

AllenBarnett
Posts: 7
Joined: Thu Dec 26, 2013 9:48 pm

Re: Square sqaures, Circular circles

Mon Jan 06, 2014 5:40 pm

ajstarks wrote: you may want to try a high-level library to help you: https://github.com/ajstarks/openvg
I was already looking at your rshapes example from another thread. The openvg library is very easy to use. I've now discovered that the TFT panel is not square to the TV's plastic frame :-) Thanks!

Return to “OpenVG”