03/27/2009 1:41 AM
Although we don't have much sample OpenVG code apart from the Tiger, I've attached a small sample that I've just made
to demonstrate the use of scaling, rotation and translation features that OpenVG provides. I've put a lot of comments
in the code so it should be pretty easy to follow, but I think the best way to understand the effects of matrix
manipulation is to start with a very simple sample application and manipulate the matrix gradually.
In the general case, when doing translations and rotations, the coordinate system's origin and axes get affected, and
most following vg (drawing) calls are affected (refer to Khronos' standard to know the exact list). What was drawn
before the matrix manipulation is left untouched. Matrix changes are cumulative and non-interchangeable, so two
translations followed by a rotation is not equivalent to a rotation followed by two translations.
In terms of "plane transformation", there's really nothing to build from scratch here, as the vg API provides all you
need through the use of rotations, translations, etc. and through the use of vgLoadMatrix and vgGetMatrix to save and
restore your matrix manipulations. Of course my explanation is a bit oversimplified, but all that to say that all the
basics are already provided.
Note that in my code, I haven't put any error checking (using vgGetError()) as it would have cluttered the sample too
Note also that the code is by no means optimized --- it's really just a series of matrix manipulations (rotations,
translations, scaling) and in many cases, the code could have been "compressed" through re-use of paths and sub-
I hope this helps.
From: Dave Bott [mailto:firstname.lastname@example.org]
Sent: March 26, 2009 1:42 PM
Subject: OpenVG test code ?
My customer is consulting for another QNX customer. He's using an i.mx35.
Do we have any test code or examples that might help him ?
I have been running some unit test code on the OpenVG calls and I need a to setup test to see how I can zoom in and out
of some video clips in jpg format without impacting the graphics quality and clocking the CPU utilization as well.
I have looked at the Tiger sample code that you send me a while ago and in the code they are performing transformation
on the plane instead of object coordinates for zooming and rotating, and the picture quality is also clean on various
zoom and rotation level. Do you know of any other sample code that has more details on setting up these plane
f you have any internal test codes for openVG please let me know. I have looked around the OpenVG web site and was not
able to find much which really helps what I need to do. If you do not think there is anything out there let me know so I
can allocate time to build this plane transformation code from scratch.