Re: Getting bits from NSQuickDrawView
Re: Getting bits from NSQuickDrawView
- Subject: Re: Getting bits from NSQuickDrawView
- From: Josh Anon <email@hidden>
- Date: Sat, 8 Mar 2003 18:20:51 -0600
Hi,
Yes, it's getting that port correctly. If I just run the SGDataProc
Cocoa example, for instance, things appear correctly. What I'm wanting
to do in the end--video never actually drawn to screen--isn't working
(code that I'm trying to do, based on trying to combine the Cocoa
SGDataProc + the technote "Decompressing DV and accessing pixels"
included below--that problem is prob more appropriate for discussion on
the QT lists).
As an alternative, to just get something working, I'd be happy if I
could just get the bits from the NSQuickDrawView subclass, but getting
the base address from the gPGWorld variable in MyQuickDrawView doesn't
work. Is there a way to get the raw bits from [view qdPort] call
somehow?
Thanks,
Josh
--
code pretty much straight from the example code, my comments/attempted
changes are indicated by //**
/* Set up getting grabbed data into the Window */
//**the DecompressFrame relies on having the size of the compressed
image, so let's get that
hPixMap = GetGWorldPixMap(gPGWorld);
err = MakeImageDescriptionForPixMap(hPixMap, &imageDesc);
gImageSize = (GetPixRowBytes(hPixMap) * (*imageDesc)->height); //
((**hPixMap).rowBytes & 0x3fff) * (*desc)->height;
DisposeHandle((Handle)imageDesc);
imageDesc = NULL;
//**where we really want to draw is into an off-screen context.
MakeGWorld from TechNote2044)
// GetPixBounds(hPixMap,&bounds);
MakeGWorld(720, 480, &destGWorld);
gDrawSeq = 0;
// returns an image description for the GWorlds PixMap
// on entry the imageDesc is NULL, on return it is correctly filled
out
// you are responsible for disposing it
//err = MakeImageDescriptionForPixMap(hPixMap, &imageDesc);
//**from TN2044
imageDesc = MakeImageDescriptionForNTSCDV();
BailErr(err);
Rect theSrcBounds ={0, 0};
Rect theDestBounds;
GetPortBounds(destGWorld, &theDestBounds);
theSrcBounds.right = (*imageDesc)->width;
theSrcBounds.bottom = (*imageDesc)->height;
RectMatrix(&scaleMatrix, &theSrcBounds, &theDestBounds);
//**since DecompressSequenceBegin is obsolete, let's try using
DecompressSequenceBeginS
err = DecompressSequenceBeginS(
&gDrawSeq, // pointer to
field to receive
// unique ID for
sequence
imageDesc, // handle to image
description
// structure
NULL, // pointer to
compressed image
// data (used
// for preflight)
0, // image data size
destGWorld, // port for the
DESTINATION image
NULL, // grahics device
handle, if
// port is set, set
// this to NULL
NULL, // source
rectangle defining
// the portion of
the image
// to decompress -
NULL for
// the entire
source image
&scaleMatrix, //
transformation matrix
srcCopy, // transfer mode
specifier
(RgnHandle)NULL, // clipping region
in dest.
// coordinate
system to use as
// a mask
0, // flags
codecLowQuality, // accuracy in
decompression
anyCodec); // compressor
identifier or
// special
identifiers
// ie.
bestSpeedCodec
/*
// begin the process of decompressing a sequence of frames - see
above notes on this call.
// destination is specified as the QuickDraw port for our NSView
DecompressSequenceBegin(&gDrawSeq,
imageDesc,
[self qdPort], // Use the QuickDraw
port for our NSView as destination!
NULL,
&bounds,
NULL,
ditherCopy,
NULL,
0,
codecNormalQuality,
anyCodec); */
BailErr(err);
--
email@hidden ||
http://www.areax.net
"BASIC is the Computer Science equivalent of `Scientific Creationism'."
--Fortune
_______________________________________________
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.