dispmanx genius desperately needed!


5 posts
by Moose » Wed Feb 06, 2013 1:24 am
src_rect in vc_dispmanx_element_add and vc_dispmanx_element_change_attributes...

I am hoping to animate an element by setting the width and height in src_rect to the size of individual images stored in a resource and then just selecting the image I want by src_rect’s x and y coordinates but I’m having no joy whatsoever. Now dest_rect behaves correctly and generally everything else I'm doing in dispmanx is working as expected but it seems that no matter what values I stuff in src_rect, the whole resource is always processed.
Am I just a duffer and misinterpreting the purpose of src-rect in these functions? Does anyone have this working?

Also for bonus points, is there a way to disable the over-zealous interpolation of scaled up images in dispmanx?

Ta in advance for any help that can be tossed this way!

Moose.
Posts: 6
Joined: Sat May 26, 2012 12:07 pm
by -rst- » Wed Feb 06, 2013 2:25 pm
Haven't tried anything but 'full src_rect' yet... I can only report that vc_dispmanx_element_change_source() works fine. This is possibly too simple to even ask, but you are doing the vc_dispmanx_element_change_attributes() between vc_dispmanx_update_start() and vc_dispmanx_update_submit_sync(), aren't you?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 904
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by Moose » Wed Feb 06, 2013 3:12 pm
Haven't tried anything but 'full src_rect' yet... I can only report that vc_dispmanx_element_change_source() works fine. This is possibly too simple to even ask, but you are doing the vc_dispmanx_element_change_attributes() between vc_dispmanx_update_start() and vc_dispmanx_update_submit_sync(), aren't you?


I've yet to find any code on-line that does anything but full src-rect operations... but yes, it's properly wrapped in update calls and other changes including dst_rect all work fine. Not that I need to go that far as it happens in the initial vc_dispmanx_element_add() call too.

The source image size is a multiple of 16 pixels in both axes and the rect has been fed 16.16 fixed point coords (I've actually tried all manner of figures in the rect to try to get some response from it) but I always get the full image.

I'll post a source frag when I get home tonight if it'll help.

Moose.
Posts: 6
Joined: Sat May 26, 2012 12:07 pm
by -rst- » Wed Feb 06, 2013 5:15 pm
I cannot promise for sure, but I will try to take a look, as I am working on some of this stuff anyway... not that I would think of myself as anything like 'dispmanx genius' :roll:
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 904
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by Moose » Wed Feb 06, 2013 5:39 pm
In desperation I flashed a new sd-card, copied the source over and compiled it… and now it works as expected. *sigh* I must have snapped something with my endless prodding of things that weren't meant to be prodded by mortal men.

Thanks for the offer of help though, it was greatly appreciated.

Helpful Hint #314: Avoid looking like a total spanner by always reproducing on clean install before hitting the forums.

Moose.
Posts: 6
Joined: Sat May 26, 2012 12:07 pm