Skip to content

guozanhua/NatCam-iOS-Native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

NatCam-iOS-Native

A demonstration of using native code (C++) with the NatCam Native Pipeline. Powered by NatCam v1.2.

In this example, the camera preview data is sent to the native layer to convert Y data (lumincance) to greyscale. Since the Y channel already contains luminance data, all we have to do is fill an RGB24 texture with the data like so:

From Y4 (Y) to RGB24 (Y, Y, Y).

To do this, we use the OnNativePreviewUpdate event in NatCamNativeInterface. In order to get Y channel data in system memory, we must initialize NatCam with a Readable preview. Also, we will disable NatCam's rendering pipeline since we don't need NatCam to convert the raw camera luma and chroma data to ARGB32.

Native Code Example

Setup Instructions

Note

  • This demo is only compatible with NatCam 1.2. Older or newer versions will not work.
  • This demo works only on iOS. For Android, see here.
  • This demo requires Unity 5.3 and up.

About

A demonstration of using native code (C++) with the NatCam Native Pipeline on iOS. Powered by NatCam v1.2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published