NSDrawBitmap v. GWorld, help help
NSDrawBitmap v. GWorld, help help
- Subject: NSDrawBitmap v. GWorld, help help
- From: Alex Curylo <email@hidden>
- Date: Fri, 22 Mar 2002 08:58:51 -0800
So I'm using the Sequence Grabber to get video from a DV camera into a
GWorld, and I want to blit from that to a custom NSView. I create the GWorld
with (my first try is in comments)
::QTNewGWorld(&fBuffer, k24RGBPixelFormat /*k32ARGBPixelFormat*/,
&fPreviewBounds, 0, nil, 0);
and blit it with
unsigned char *data[5] = { 0 };
data[0] = (unsigned char*)::GetPixBaseAddr(pixmap);
long rowBytes = (**pixmap).rowBytes & 0x3fff;
NSDrawBitmap(rect, width, height,
8, // bitsPerSample,
3 /*4*/, // samplesPerPixel,
24 /*32*/, // bitsPerPixel,
rowBytes, // bytesPerRow,
NO, // isPlanar,
NO /*YES*/, // hasAlpha,
NSDeviceRGBColorSpace, // colorSpace,
data); // const unsigned char *const data[5])
This seems to be almost right because I get a correctly sized image which is
recognizably the camera feed, but in 24-bit mode as above I get a ghosty
image over vertical RGB stripes, in 32-bit mode with the commented items
switched I get a reddish image (looks like it's expecting RGBA not ARGB
would be my guess, but there is no k32RGBAPixelFormat in non-Windows
QuickTime, I get a cDepthErr trying it here anyway).
I can't find any documentation that states clearly what kind of bitmap
organization NSDrawBitmap expects. Am I on the right track here at all? Or
is there a canonical way that's nothing like this to blit from an arbitrary
GWorld to an NSView?
--
Alex Curylo -- email@hidden --
http://alexc.webjump.com/
There's no such thing as strong coffee ... just weak people.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.