QRCodeScanner Class

Inherits: FrameFilter

Description

QRCodeScanner实现了二维码(QRCode)扫描与识别功能。

你需要首先调用 attachStreamerFrameStreamer 连接到QRCodeScanner上,然后 FrameStreamer 的图像将被用来进行识别。你可以调用start/stop来开启/关闭扫描。start和stop是非常轻量的调用。

可以使用 FrameStreamer.peek 来获取一帧 Frame 。Frame中包含当前的camera图像和识别出的二维码字符串。

Constructor

C: void easyar_QRCodeScanner__ctor(easyar_QRCodeScanner * * Return)
C++11: QRCodeScanner()
Traditional C++: QRCodeScanner()
Java: public QRCodeScanner()
Objective-C: + (easyar_QRCodeScanner *) create
Swift (since EasyAR SDK 2.1.0): public convenience init()

attachStreamer

FrameStreamer 连接到QRCodeScanner。QRCodeScanner在有 FrameStreamer 连接之前不会开始扫描。

Attach null object 将会断开QRCodeScanner之前与 FrameStreamer 的连接。

C: bool easyar_QRCodeScanner_attachStreamer(easyar_QRCodeScanner * This, easyar_FrameStreamer * obj)
C++11: bool attachStreamer(std::shared_ptr<FrameStreamer> obj)
Traditional C++: bool attachStreamer(FrameStreamer * obj)
Java: public native boolean attachStreamer(FrameStreamer obj)
Objective-C: - (bool)attachStreamer:(easyar_FrameStreamer *)obj
Swift (since EasyAR SDK 2.1.0): public override func attachStreamer(_ obj: FrameStreamer?) -> Bool

start

开始扫描。扫描过程在有 FrameStreamer 连接之前不会开始。

C: bool easyar_QRCodeScanner_start(easyar_QRCodeScanner * This)
C++11: bool start()
Traditional C++: bool start()
Java: public native boolean start()
Objective-C: - (bool)start
Swift (since EasyAR SDK 2.1.0): public override func start() -> Bool

stop

停止扫描。调用start来重新开始扫描。

C: bool easyar_QRCodeScanner_stop(easyar_QRCodeScanner * This)
C++11: bool stop()
Traditional C++: bool stop()
Java: public native boolean stop()
Objective-C: - (bool)stop
Swift (since EasyAR SDK 2.1.0): public override func stop() -> Bool