vendor/ar.js
function(width, height, camera) {
		var id;
		var w = width, h = height;

		this.orientation = 'landscape';

		this.listeners = {};

		if (typeof width !== 'number') {
			var image = width;
			camera = height;
			w = image.videoWidth || image.width;
			h = image.videoHeight || image.height;
			this.image = image;
		}

		this.defaultMarkerWidth = 1;
		this.patternMarkers = {};
		this.barcodeMarkers = {};
		this.transform_mat = new Float32Array(16);

		this.canvas = document.createElement('canvas');
		this.canvas.width = w;
		this.canvas.height = h;
		this.ctx = this.canvas.getContext('2d');

		this.videoWidth = w;
		this.videoHeight = h;

		if (typeof camera === 'string') {

			var self = this;
			this.cameraParam = new ARCameraParam(camera, function() {
				self._initialize();
			}, function(err) {
				console.error("ARController: Failed to load ARCameraParam", err);
			});

		} else {

			this.cameraParam = camera;
			this._initialize();

		}
	}
function(width, height, camera) {
		var id;
		var w = width, h = height;

		this.orientation = 'landscape';

		this.listeners = {};

		if (typeof width !== 'number') {
			var image = width;
			camera = height;
			w = image.videoWidth || image.width;
			h = image.videoHeight || image.height;
			this.image = image;
		}

		this.defaultMarkerWidth = 1;
		this.patternMarkers = {};
		this.barcodeMarkers = {};
		this.transform_mat = new Float32Array(16);

		this.canvas = document.createElement('canvas');
		this.canvas.width = w;
		this.canvas.height = h;
		this.ctx = this.canvas.getContext('2d');

		this.videoWidth = w;
		this.videoHeight = h;

		if (typeof camera === 'string') {

			var self = this;
			this.cameraParam = new ARCameraParam(camera, function() {
				self._initialize();
			}, function(err) {
				console.error("ARController: Failed to load ARCameraParam", err);
			});

		} else {

			this.cameraParam = camera;
			this._initialize();

		}
	}
function ( width , height , camera ) { var id ; var w = width , h = height ; this . orientation = 'landscape' ; this . listeners = { } ; if ( typeof width !== 'number' ) { var image = width ; camera = height ; w = image . videoWidth || image . width ; h = image . videoHeight || image . height ; this . image = image ; } this . defaultMarkerWidth = 1 ; this . patternMarkers = { } ; this . barcodeMarkers = { } ; this . transform_mat = new Float32Array ( 16 ) ; this . canvas = document . createElement ( 'canvas' ) ; this . canvas . width = w ; this . canvas . height = h ; this . ctx = this . canvas . getContext ( '2d' ) ; this . videoWidth = w ; this . videoHeight = h ; if ( typeof camera === 'string' ) { var self = this ; this . cameraParam = new ARCameraParam ( camera , function ( ) { self . _initialize ( ) ; } , function ( err ) { console . error ( "ARController: Failed to load ARCameraParam" , err ) ; } ) ; } else { this . cameraParam = camera ; this . _initialize ( ) ; } }
The ARController is the main object for doing AR marker detection with JSARToolKit.

To use an ARController, you need to tell it the dimensions to use for the AR processing canvas and
pass it an ARCameraParam to define the camera parameters to use when processing images.
The ARCameraParam defines the lens distortion and aspect ratio of the camera used.
See https://www.artoolworks.com/support/library/Calibrating_your_camera for more information about AR camera parameteters and how to make and use them.

If you pass an image as the first argument, the ARController uses that as the image to process,
using the dimensions of the image as AR processing canvas width and height. If the first argument
to ARController is an image, the second argument is used as the camera param.

The camera parameters argument can be either an ARCameraParam or an URL to a camera definition file.
If the camera argument is an URL, it is loaded into a new ARCameraParam, and the ARController dispatches
a 'load' event and calls the onload method if it is defined.

@exports ARController
@constructor

@param {number} width The width of the images to process.
@param {number} height The height of the images to process.
@param {ARCameraParam | string} camera The ARCameraParam to use for image processing. If this is a string, the ARController treats it as an URL and tries to load it as a ARCameraParam definition file, calling ARController#onload on success.
The ARController is the main object for doing AR marker detection with JSARToolKit .