<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInInputImageSource/lockBufferRepresentation(withPixelFormat:colorSpace:forBounds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInInputImageSource(im)lockBufferRepresentationWithPixelFormat:colorSpace:forBounds:"
  },
  "title" : "lockBufferRepresentation(withPixelFormat:colorSpace:forBounds:)"
}
-->

# lockBufferRepresentation(withPixelFormat:colorSpace:forBounds:)

Creates a memory buffer representation from a subregion of the image source using the provided pixel format and color space.

```
func lockBufferRepresentation(withPixelFormat format: String!, colorSpace: CGColorSpace!, forBounds bounds: NSRect) -> Bool
```

## Parameters

`format`

A pixel format that is compatible with the color space.

`colorSpace`

A Quartz color space that is compatible with the pixel format.

`bounds`

The bounds of the subregion, expressed as pixels, and aligned to integer boundaries.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if successful; otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The content of the buffer is read-only. You should not attempt to modify it.

---

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)