<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/CameraRegionView",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit16CameraRegionViewV"
  },
  "title" : "CameraRegionView"
}
-->

# CameraRegionView

This view displays a stabilized region of interest within a person’s view and
provides passthrough camera feed for that selected region.

```
@MainActor @preconcurrency struct CameraRegionView
```

## Overview

`CameraRegionView` needs enterprise API access in order to be used. To use this
view, you need to apply for the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.arkit.camera-region.allow> entitlement. For more information, including how to apply for this
entitlement, see <doc://com.apple.documentation/documentation/visionOS/building-spatial-experiences-for-business-apps-with-enterprise-apis>.

This is a standalone view used in a `WindowGroup` that a person can freely
move and place in order to position the desired region of interest. Examples of
possible regions of interest are documents, user manuals, gauges, and displays.

The view also allows additional post-processing of passthrough camera
frames. These stabilized camera frames of the selected region of interest are
directly rendered into the view. The framework provides these frames to
enterprise developers before rendering them on screen, so developers can apply
any enhancements or modifications prior to the rendering within the view.

```swift
struct AppScene: Scene {
    var body: some Scene {
         // Enterprise use case which requires an enterprise license and
         // entitlement.
         WindowGroup(id: "WithEnterpriseLicense") {
             CameraRegionView() { result in
                 switch result {
                     case .success(let context):
                         let pixelBuffer = context.pixelBuffer

                         // Add desired changes to pixel buffer.
                        return pixelBuffer
                    case .failure(let error):
                       // Handle errors.
                       return nil
                }
             }
         }
         .windowResizability(.contentSize)
     }
 }
```

> Note: The frame rate within the `CameraRegionView` isn’t expected to match
> the frame rate of the passthrough view. The CameraRegionView’s base
> functionality and any post-processing requires additional computation time,
> so the frame rate runs slower in this view in exchange for providing
> additional stabilization and enhancement.

## Topics

### Creating a view

[`init(isContrastAndVibrancyEnhancementEnabled:pixelBufferProcessor:)`](/documentation/VisionKit/CameraRegionView/init(isContrastAndVibrancyEnhancementEnabled:pixelBufferProcessor:))

Creates a view that renders a spatial camera region and optionally applies contrast enhancement.

### Setting up frame processing in your view

[`PixelBufferProcessingContext`](/documentation/VisionKit/CameraRegionView/PixelBufferProcessingContext)

A context which provides the pixel buffer for a passthrough frame.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`View`](/documentation/SwiftUI/View)

---

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)