It looks like you are outputting an image from a decklink card (I am assuming 
this is going to be for a digitizer / video input replacement?)

Assuming my assumption is correct, why not output the CVPIxelBufferRef ? It 
looks like you create one from the decklink IDeckLinkVideoInputFrame handler in 
your decklink callback, and make the patch be a provider, rather than a 
consumer and use the factory method

outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shouldColorMatch,
  or a custom QCPLuginOutputImageProvider class you implement and just output 
an image :)

QC will handle everything else you need and you can additionally use image 
filters, CI Filters and GLSL shaders on your output image.



On Oct 5, 2011, at 12:08 PM, Nisar Ahmed wrote:

> Yes you are correct, I added this and it worked but.....
> 
>                                  //Creating image from a CVImageBufferRef 
> (Format=PAL)
>               image = [[CIImage alloc] initWithCVImageBuffer:pixelBuffer];
> 
>                 //Resizing width and height of image to match input port's 
> width and height
>               width = [image extent].size.width*(self.inputWidth/2.0);
>               height = [image extent].size.height*(self.inputHeight/2.0);
>               
>               glViewport(self.inputX, self.inputY,  width, height);
>               glMatrixMode(GL_MODELVIEW);
>               glLoadIdentity();
>               
>               glMatrixMode(GL_PROJECTION);
>               glLoadIdentity();
>               glOrtho(0, width, 0, height, -1.0, 1.0);
>               [ciContext drawImage:image inRect:CGRectMake(0, 0, width, 
> height) fromRect:[image extent]];
> 
> Now I can see correct image inside. BUT the whole of QC View background is 
> painted in White and it's no more transparent like in other consumer patches. 
>  The image in question is in PAL format. 
> 
> I have also attached a screen shot for reference 
> 
> Thank you
> Nisar
> 
> 
> 
> On Wed, Oct 5, 2011 at 8:27 PM, Christopher Wright 
> <christopher_wri...@apple.com> wrote:
>> Now I am a little confused about inRect and fromRect parameters of drawImage 
>> since the coordinate system is different and which OpenGL function should I 
>> include or remove from this function for it to work.
>> 
>> I can only see a blank screen on top right corner of QC View
> 
> You'll probably want to change the Projection matrix, since QC will have it 
> set to something you probably aren't interested in.
> 
> --
> Christopher Wright
> christopher_wri...@apple.com
> 
> 
> <Screen shot 2011-10-05 at 9.07.16 PM.png> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com
> 
> This email sent to dokt...@mac.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to