<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInContext/outputImageProviderFromTexture(withPixelFormat:pixelsWide:pixelsHigh:name:flipped:releaseCallback:releaseContext:colorSpace:shouldColorMatch:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInContext(im)outputImageProviderFromTextureWithPixelFormat:pixelsWide:pixelsHigh:name:flipped:releaseCallback:releaseContext:colorSpace:shouldColorMatch:"
  },
  "title" : "outputImageProviderFromTexture(withPixelFormat:pixelsWide:pixelsHigh:name:flipped:releaseCallback:releaseContext:colorSpace:shouldColorMatch:)"
}
-->

# outputImageProviderFromTexture(withPixelFormat:pixelsWide:pixelsHigh:name:flipped:releaseCallback:releaseContext:colorSpace:shouldColorMatch:)

Returns an image provider from an OpenGL texture.

```
func outputImageProviderFromTexture(withPixelFormat format: String!, pixelsWide width: Int, pixelsHigh height: Int, name: GLuint, flipped: Bool, releaseCallback callback: QCPlugInTextureReleaseCallback!, releaseContext context: UnsafeMutableRawPointer!, colorSpace: CGColorSpace!, shouldColorMatch colorMatch: Bool) -> Any!
```

## Parameters

`format`

The pixel format of the texture. This must be compatible with the color space.

`width`

The width, in bytes, of the texture.

`height`

The height, in bytes, of the texture.

`name`

An OpenGL texture of type `GL_TEXTURE_RECTANGLE_EXT` that is valid on the Quartz Composer OpenGL context. Your application must make sure that the texture exists for the life cycle of the image provider.

`flipped`

<doc://com.apple.documentation/documentation/Swift/true> to have Quartz Composer flip the contents of the texture vertically.

`callback`

The release callback.  Your callback must use this type definition:

```objc
typedef void (*QCPlugInTextureReleaseCallback)(CGLContextObj cgl_ctx, GLuint name, void* context);
```

    If you name your callback function     `MyQCPlugInTextureReleaseCallback`    , you would declare it like this:

```objc
void MyQCPlugInTextureReleaseCallback (CGLContextObj cgl_ctx,
              GLuint name,
              void* context);
```

    Quartz Composer invokes your callback when the memory buffer is no longer needed. The callback can be called from any thread at any time

`context`

The context to pass to the release callback.

`colorSpace`

The color space of the texture. This must be compatible with the pixel format.

`colorMatch`

A Boolean that specifies whether Quartz Composer should color match the texture. Pass  <doc://com.apple.documentation/documentation/Swift/false> if the texture is a mask or gradient or should not be color matched for some other reason. Otherwise, pass <doc://com.apple.documentation/documentation/Swift/true>.

## Return Value

An image provider.

## Discussion

You must not modify the texture until the release callback is invoked.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)