---
title: "render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qcpluginoutputimageprovider/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.

## Declaration

```swift
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

Return Value true if the image is rendered successfully into the buffer; false on failure or if the image provider doesn’t support CPU rendering.

## Discussion

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.

## See Also

### Rendering an Image to a Destination

- [copyRenderedTexture(forCGLContext:pixelFormat:bounds:isFlipped:)](quartz/qcpluginoutputimageprovider/copyrenderedtexture(forcglcontext:pixelformat:bounds:isflipped:).md)
- [render(withCGLContext:forBounds:)](quartz/qcpluginoutputimageprovider/render(withcglcontext:forbounds:).md)
- [releaseRenderedTexture(_:forCGLContext:)](quartz/qcpluginoutputimageprovider/releaserenderedtexture(_:forcglcontext:).md)
