ARGear SDK Documentations
  • Introduction
  • Android
    • 1. Quickstart
    • 2. Configuration Settings
    • 3. ARGear Overview
    • 4. ARGSession
    • 5. Camera
    • 6. Rendering
    • 7. CMS Service
    • 8. Download Contents
    • 9. Set Contents
    • 10. Media
    • 11. Switch Camera Face
    • 12. Enable Debugging Mode
    • 13. ARCore Connect API
    • 14. API Reference
  • iOS
    • 1. Quickstart
    • 2. Configuration Settings
    • 3. ARGear Overview
    • 4. ARGSession
    • 5. Camera
    • 6. Rendering
    • 7. CMS Service
    • 8. Download Contents
    • 9. Set Contents
    • 10. Media
    • 11. Switch Camera Face
    • 12. Enable Debugging Mode
    • 13. ARKit Connect API
    • 14. API Reference
  • Unity
    • 1. Quickstart
    • 2. Configuration Settings
    • 3. ARGear Plugin Overview
    • 4. ARGearManager
    • 5. ARGearCamera
    • 6. CMS Service
    • 7. Download Contents
    • 8. Set Contents
    • 9. Switch Camera Face
    • 10. Enable Debugging Mode
    • 11. API Reference
Powered by GitBook
On this page

Was this helpful?

  1. iOS

6. Rendering

Previous5. CameraNext7. CMS Service

Last updated 5 years ago

Was this helpful?

The rendering process starts by passing the image sampleBuffer and metadataObjects to the ARGSession. Once ARGear renders the frame, ARGSession calls the didUpdateFrame function of ARGSessionDelegate and with the parameter. The renderedPixelBuffer of ARGFrame contains final rendered data in the CVPixelBuffer data type.

The rendered frames can be drawn to a view using the data from ARGFrame.

The sample code below shows how to obtain renderedPixelBuffer in ARGFrame from didUpdateFrame. ARGScene is implemented in the Sample App and uses an OpenGL View to draw the frame.

// Sample Code.Obtaining ARGFrame from didUpdateFrame

ARGScene *sceneView = [[ARGScene alloc] initSceneviewAt:self.view withViewTransform:displayTramsform];
 
- (void)didUpdateFrame:(ARGFrame *)frame {
 
    if ([frame renderedPixelBuffer]) {
        [sceneView displayPixelBuffer:[frame renderedPixelBuffer]];;
    }
}
// Sample Code.Obtaining ARGFrame from didUpdateFrame

public func didUpdate(_ arFrame: ARGFrame) {
    guard let renderedPixelbuffer = arFrame.renderedPixelBuffer else {
        return
    }
    // draw sublayer(CALayer())'s contents
    self.cameraPreviewCALayer.contents = renderedPixelbuffer
}

ARGFrame