/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#define VTK_WRAPPING_CXX
#define VTK_STREAMS_FWD_ONLY
#include <nan.h>

#include "vtkPointSetAlgorithmWrap.h"
#include "vtkWarpLensWrap.h"
#include "vtkObjectBaseWrap.h"
#include "vtkInformationWrap.h"
#include "../../plus/plus.h"

using namespace v8;

extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;
Nan::Persistent<v8::FunctionTemplate> VtkWarpLensWrap::ptpl;

VtkWarpLensWrap::VtkWarpLensWrap()
{ }

VtkWarpLensWrap::VtkWarpLensWrap(vtkSmartPointer<vtkWarpLens> _native)
{ native = _native; }

VtkWarpLensWrap::~VtkWarpLensWrap()
{ }

void VtkWarpLensWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkWarpLens").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("WarpLens").ToLocalChecked(), ConstructorGetter);
}

void VtkWarpLensWrap::ConstructorGetter(
	v8::Local<v8::String> property,
	const Nan::PropertyCallbackInfo<v8::Value>& info)
{
	InitPtpl();
	info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());
}

void VtkWarpLensWrap::InitPtpl()
{
	if (!ptpl.IsEmpty()) return;
	v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
	VtkPointSetAlgorithmWrap::InitPtpl( );
	tpl->Inherit(Nan::New<FunctionTemplate>(VtkPointSetAlgorithmWrap::ptpl));
	tpl->SetClassName(Nan::New("VtkWarpLensWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "FillInputPortInformation", FillInputPortInformation);
	Nan::SetPrototypeMethod(tpl, "fillInputPortInformation", FillInputPortInformation);

	Nan::SetPrototypeMethod(tpl, "GetCenter", GetCenter);
	Nan::SetPrototypeMethod(tpl, "getCenter", GetCenter);

	Nan::SetPrototypeMethod(tpl, "GetFormatHeight", GetFormatHeight);
	Nan::SetPrototypeMethod(tpl, "getFormatHeight", GetFormatHeight);

	Nan::SetPrototypeMethod(tpl, "GetFormatWidth", GetFormatWidth);
	Nan::SetPrototypeMethod(tpl, "getFormatWidth", GetFormatWidth);

	Nan::SetPrototypeMethod(tpl, "GetImageHeight", GetImageHeight);
	Nan::SetPrototypeMethod(tpl, "getImageHeight", GetImageHeight);

	Nan::SetPrototypeMethod(tpl, "GetImageWidth", GetImageWidth);
	Nan::SetPrototypeMethod(tpl, "getImageWidth", GetImageWidth);

	Nan::SetPrototypeMethod(tpl, "GetK1", GetK1);
	Nan::SetPrototypeMethod(tpl, "getK1", GetK1);

	Nan::SetPrototypeMethod(tpl, "GetK2", GetK2);
	Nan::SetPrototypeMethod(tpl, "getK2", GetK2);

	Nan::SetPrototypeMethod(tpl, "GetKappa", GetKappa);
	Nan::SetPrototypeMethod(tpl, "getKappa", GetKappa);

	Nan::SetPrototypeMethod(tpl, "GetP1", GetP1);
	Nan::SetPrototypeMethod(tpl, "getP1", GetP1);

	Nan::SetPrototypeMethod(tpl, "GetP2", GetP2);
	Nan::SetPrototypeMethod(tpl, "getP2", GetP2);

	Nan::SetPrototypeMethod(tpl, "GetPrincipalPoint", GetPrincipalPoint);
	Nan::SetPrototypeMethod(tpl, "getPrincipalPoint", GetPrincipalPoint);

	Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance);
	Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance);

	Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast);
	Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast);

	Nan::SetPrototypeMethod(tpl, "SetCenter", SetCenter);
	Nan::SetPrototypeMethod(tpl, "setCenter", SetCenter);

	Nan::SetPrototypeMethod(tpl, "SetFormatHeight", SetFormatHeight);
	Nan::SetPrototypeMethod(tpl, "setFormatHeight", SetFormatHeight);

	Nan::SetPrototypeMethod(tpl, "SetFormatWidth", SetFormatWidth);
	Nan::SetPrototypeMethod(tpl, "setFormatWidth", SetFormatWidth);

	Nan::SetPrototypeMethod(tpl, "SetImageHeight", SetImageHeight);
	Nan::SetPrototypeMethod(tpl, "setImageHeight", SetImageHeight);

	Nan::SetPrototypeMethod(tpl, "SetImageWidth", SetImageWidth);
	Nan::SetPrototypeMethod(tpl, "setImageWidth", SetImageWidth);

	Nan::SetPrototypeMethod(tpl, "SetK1", SetK1);
	Nan::SetPrototypeMethod(tpl, "setK1", SetK1);

	Nan::SetPrototypeMethod(tpl, "SetK2", SetK2);
	Nan::SetPrototypeMethod(tpl, "setK2", SetK2);

	Nan::SetPrototypeMethod(tpl, "SetKappa", SetKappa);
	Nan::SetPrototypeMethod(tpl, "setKappa", SetKappa);

	Nan::SetPrototypeMethod(tpl, "SetP1", SetP1);
	Nan::SetPrototypeMethod(tpl, "setP1", SetP1);

	Nan::SetPrototypeMethod(tpl, "SetP2", SetP2);
	Nan::SetPrototypeMethod(tpl, "setP2", SetP2);

	Nan::SetPrototypeMethod(tpl, "SetPrincipalPoint", SetPrincipalPoint);
	Nan::SetPrototypeMethod(tpl, "setPrincipalPoint", SetPrincipalPoint);

#ifdef VTK_NODE_PLUS_VTKWARPLENSWRAP_INITPTPL
	VTK_NODE_PLUS_VTKWARPLENSWRAP_INITPTPL
#endif
	ptpl.Reset( tpl );
}

void VtkWarpLensWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	if(!info.IsConstructCall())
	{
		Nan::ThrowError("Constructor not called in a construct call.");
		return;
	}

	if(info.Length() == 0)
	{
		vtkSmartPointer<vtkWarpLens> native = vtkSmartPointer<vtkWarpLens>::New();
		VtkWarpLensWrap* obj = new VtkWarpLensWrap(native);
		obj->Wrap(info.This());
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

	info.GetReturnValue().Set(info.This());
}

void VtkWarpLensWrap::FillInputPortInformation(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsObject() && (Nan::New(VtkInformationWrap::ptpl))->HasInstance(info[1]))
		{
			VtkInformationWrap *a1 = ObjectWrap::Unwrap<VtkInformationWrap>(info[1]->ToObject());
			int r;
			if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			r = native->FillInputPortInformation(
				info[0]->Int32Value(),
				(vtkInformation *) a1->native.GetPointer()
			);
			info.GetReturnValue().Set(Nan::New(r));
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::GetCenter(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetCenter();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 2 * sizeof(double));
	Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 2);
	memcpy(ab->GetContents().Data(), r, 2 * sizeof(double));
	info.GetReturnValue().Set(at);
}

void VtkWarpLensWrap::GetFormatHeight(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetFormatHeight();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetFormatWidth(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetFormatWidth();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetImageHeight(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetImageHeight();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetImageWidth(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetImageWidth();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetK1(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetK1();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetK2(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetK2();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetKappa(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetKappa();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetP1(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetP1();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetP2(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetP2();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkWarpLensWrap::GetPrincipalPoint(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	double const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetPrincipalPoint();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 2 * sizeof(double));
	Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 2);
	memcpy(ab->GetContents().Data(), r, 2 * sizeof(double));
	info.GetReturnValue().Set(at);
}

void VtkWarpLensWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	vtkWarpLens * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->NewInstance();
	VtkWarpLensWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkWarpLensWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkWarpLensWrap *w = new VtkWarpLensWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkWarpLensWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectBaseWrap::ptpl))->HasInstance(info[0]))
	{
		VtkObjectBaseWrap *a0 = ObjectWrap::Unwrap<VtkObjectBaseWrap>(info[0]->ToObject());
		vtkWarpLens * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->SafeDownCast(
			(vtkObjectBase *) a0->native.GetPointer()
		);
		VtkWarpLensWrap::InitPtpl();
		v8::Local<v8::Value> argv[1] =
			{ Nan::New(vtkNodeJsNoWrap) };
		v8::Local<v8::Function> cons =
			Nan::New<v8::FunctionTemplate>(VtkWarpLensWrap::ptpl)->GetFunction();
		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
		VtkWarpLensWrap *w = new VtkWarpLensWrap();
		w->native = r;
		w->Wrap(wo);
		info.GetReturnValue().Set(wo);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetCenter(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetCenter(
				info[0]->NumberValue(),
				info[1]->NumberValue()
			);
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetFormatHeight(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetFormatHeight(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetFormatWidth(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetFormatWidth(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetImageHeight(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetImageHeight(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetImageWidth(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetImageWidth(
			info[0]->Int32Value()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetK1(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetK1(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetK2(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetK2(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetKappa(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetKappa(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetP1(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetP1(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetP2(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetP2(
			info[0]->NumberValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkWarpLensWrap::SetPrincipalPoint(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkWarpLensWrap *wrapper = ObjectWrap::Unwrap<VtkWarpLensWrap>(info.Holder());
	vtkWarpLens *native = (vtkWarpLens *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsFloat64Array())
	{
		v8::Local<v8::Float64Array>a0(v8::Local<v8::Float64Array>::Cast(info[0]->ToObject()));
		if( a0->Length() < 2 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetPrincipalPoint(
			(double *)(a0->Buffer()->GetContents().Data())
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsArray())
	{
		v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject()));
		double b0[2];
		if( a0->Length() < 2 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

		for( i = 0; i < 2; i++ )
		{
			if( !a0->Get(i)->IsNumber() )
			{
				Nan::ThrowError("Array contents invalid.");
				return;
			}
			b0[i] = a0->Get(i)->NumberValue();
		}
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetPrincipalPoint(
			b0
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetPrincipalPoint(
				info[0]->NumberValue(),
				info[1]->NumberValue()
			);
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

