<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInOutputImageProvider/render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInOutputImageProvider(im)renderToBuffer:withBytesPerRow:pixelFormat:forBounds:"
  },
  "title" : "render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)"
}
-->

# render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)

Renders a subregion of the image into  the supplied memory buffer using the specified pixel format.

```
optional func render(toBuffer baseAddress: UnsafeMutableRawPointer!, withBytesPerRow rowBytes: Int, pixelFormat format: String!, forBounds bounds: NSRect) -> Bool
```

## Parameters

`baseAddress`

The base address of the memory buffer. The Quartz Composer engine passes you an address that is aligned on a 16-byte boundary.

`rowBytes`

The number of bytes per row of the image data. The Quartz Composer engine guarantees this value is a multiple of 16.

`format`

The pixel format of the image data.

`bounds`

The bounds of the subregion.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the image is rendered successfully into the buffer; <doc://com.apple.documentation/documentation/Swift/false> on failure or if the image provider doesn’t support CPU rendering.

## Discussion

The Quartz Composer engine calls this method when it needs pixels. It gives you the base address, the number of row bytes, and the format. Then, you write pixels to the buffer.

---

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)