Dear List,

I am trying to draw an image inside QCPlugin execute function with the
following code

- (BOOL) execute:(id<QCPlugInContext>)context atTime:(NSTimeInterval)time
withArguments:(NSDictionary*)arguments

{

 CGLContextObj cgl_ctx = [context CGLContextObj];

     GLint             saveMode;

    GLenum      error;

     if(cgl_ctx == NULL)

        return NO;

 CVImageBufferRef pixelBuffer = deckLinkController->getFrameBuffer();

      // Save and set the modelview matrix.

    glGetIntegerv(GL_MATRIX_MODE, &saveMode);

    glMatrixMode(GL_MODELVIEW);

    glPushMatrix();

    // Translate the matrix

    glTranslatef(self.inputX, self.inputY, self.inputZ);

glScaled(self.inputWidth, self.inputHeight, 1.0);

    // Rotate the matrix

    glRotatef(self.inputAngle, 0.0, 1.0, 0.0);

 if(pixelBuffer)

{

  CIImage* image = [CIImage imageWithCVImageBuffer:pixelBuffer];

 NSLog(@"%0.0f, %0.0f", [context bounds].size.width, [context bounds].size.
height);

 [ciContext drawImage:image inRect:CGRectMake(0, 0, [context bounds].size.
width, [context bounds].size.height) fromRect:[image extent]];

  }

     // Restore the modelview matrix.

    glMatrixMode(GL_MODELVIEW);

    glPopMatrix();

    glMatrixMode(saveMode);

     // Check for OpenGL errors and log them if there are errors.

    if(error = glGetError())

        [context logMessage:@"OpenGL error %04X", error];

     return (error ? NO : YES);

}
 _______________________________________________
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