artoolkitX API overview - hipandayu/artoolkitx GitHub Wiki

artoolkitX has a number of application programming interfaces (APIs). This page gives an overview of the APIs available and their high-level layout and struture.

The main APIs are:

  • The primary high-level API in artoolkitX is a C++ exposed by the ARX library. Add #include <ARX/ARController.h> to your C++ source.
  • A full-featured simplified C API is also available to the ARX library. Add #include <ARX/ARX_c.h> to your C/C++ source.
  • A Java API is exposed in the ARXJ project. It is implemented via a JNI interface to libARX.
  • A C# API is exposed in artoolkitX for Unity. It is implemented via a P/Invoke interface to libARX.

The ARX API deals in a number of key abstractions:

  • controller
  • videosource
  • tracker
  • trackable
  • videoview

API example

#include <ARX/ARController.h>
ARController *c = new ARController();
c->initialiseBase();
ARTrackable *t = findTrackable(c->addTrackable("single;hiro.patt;80.0"));
c->startRunning();
while (!done) {
    if (c->capture()) {
        c->update();
            if (t->visible) {
                draw(t->transformationMatrix());
            }
        }
    }
}
c->stopRunning();
c->shutdown();