[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] camera module: yuv, hsb, controllers and poc game



Hello,

Since, GSOX is drawing into a close I though I post an other update on my progress.

First of all, I have added support for yuv and hsb color output with different color depths by using the color transform functions.

I have looked into the flip controller, and the only function I could find in the Quicktime API that should be able to do this is SGSetChannelMatrix(channel, matrix) [0]. However when I try to set an mirror matrix (a scale + translate matrix) it return an error that indicates that the transformation matrix isn't supported.
Here is the code sniped:

MatrixRecord matrix;
Fixed minusOne = Long2Fix(-1L);
Fixed PlusOne = Long2Fix(1L);
Fixed zero = Long2Fix(0L);

ScaleMatrix(matrix, fixed1, minusOne, 0, 0);
TranslateMatrix(matrix, Long2Fix(self->boundsRect.right), 0);
SGSetChannelMatrix(self->channel, &matrix);

You can find more context in the file src/camera_mac.m:133

Nirav, since you joined Apple, maybe you can ask the good people in Cupertino, how they intended this to be done :P

In case there is no way that qt support this controller, should I just keep them out and use transform.flip instead?


I have been testing the camera games by nirav (bouncy bal, pointillism, reflectionrejection), pointillism runs very slow, about 2,5 frames a second, and the other don't display an image frame. I haven't found the problem yet.


[0] http://developer.apple.com/documentation/QuickTime/Reference/QTRef_SequenceGrabber/Reference/reference.html#/ /apple_ref/c/func/SGSetChannelMatrix

Grtz