#import <ARCameraStream.h>
Inherits NSObject, and <AVCaptureVideoDataOutputSampleBufferDelegate>.
The ARCameraStream is a singleton manager class for handling the camera stream. It can be used to gain access to the background camera texture or to provide camera events.
◆ addDelegate:
- Parameters
-
delegate | The delegate to add. Add a delegate for camera update event notifications. |
◆ averageColourFromData:withChannels:downsamplingWidth:height:
- (ARColour *) averageColourFromData: |
|
(NSData *) |
data |
withChannels: |
|
(int) |
channels |
downsamplingWidth: |
|
(int) |
width |
height: |
|
(int) |
height |
|
|
| |
Returns the average colour of an image expressed as a byte array. The image will be downsized before computation of the average. Smaller images will compute faster at the expense of accuracy. It is recommended to reduce image size as much as possible.
Example of use:
- Parameters
-
data | NSData object containing the image data. |
channels | The number of channels contained within the image data. For example, RGB data would contain 3 channels. |
width | The width, in pixels, to which the image will be scaled before computing the average. |
height | The height, in pixels, to which the image will be scaled before computing the average. |
- Returns
- Average colour of the image as an ARColour object.
◆ deinitialise
Deinitialise the camera. This is handled automatically when your view controller is a subclass of the ARCameraViewController.
Example of use:
◆ getInstance
Gets the instance of the camera stream singleton.
Example of use:
- Returns
- The singleton instance.
◆ initialise
Initialise the camera. This is handled automatically when your view controller is a subclass of the ARCameraViewController. When the ARCameraStream instance is initialised, it performs the following: Creates a reference to the renderer's texture cache. Creates a reference to a valid camera device. Sets up a new capture session with a valid camera input device. Sets the camera to "continous autofocus" mode, if supported.
Example of use:
◆ removeDelegate:
- Parameters
-
delegate | The delegate to remove. Remove a delegate from camera update event notifications. |
◆ removeDelegates
◆ start
Start the camera stream. This is handled automatically when your view controller is a subclass of the ARCameraViewController.
Example of use:
◆ stop
Stop the camera stream. This is handled automatically when your view controller is a subclass of the ARCameraViewController.
Example of use:
◆ cameraTexture
The full-colour camera texture, including all 3 channels.
◆ cameraTextureUV
Camera chroma texture. This texture includes both the U and V channels, which contain the colour information of the image. The is not a full colour texture, as the U and V channels are colour differences that depend on the luminance values of the Y channel to be correct.
◆ cameraTextureY
Camera luma texture. This texture only includes the Y(Luma) colour channel, meaning it will appear as a black-and-white image.
◆ delegates
◆ height
The height of the camera image, in pixels.
◆ padding
The thickness of padding around the camera image, in pixels. This effectively creates a border around the camera stream.
◆ width
The width of the camera image, in pixels.
The documentation for this class was generated from the following files:
- ARCameraStream.h
- ARCameraStream.mm