#ifdef __API_INTERN__
	#include "operatingsystem.h"
#endif
#include "c4d_videopost.h"
#include "c4d_raytrace.h"
#include "c4d_memory.h"
#include "c4d_basecontainer.h"
#include "c4d_basebitmap.h"
#include "c4d_file.h"
#include "c4d_general.h"
#include "c4d_gui.h"
#include "c4d_resource.h"

Bool VideoPostData::Draw(BaseVideoPost *node, BaseDraw *bd, BaseDrawHelp *bh)
{
	return TRUE;
}

void VideoPostData::CalcVolumetric(BaseVideoPost *node, VolumeData *vd)
{
}

void VideoPostData::CalcShadow(BaseVideoPost *node, VolumeData *vd)
{
}

void VideoPostData::AllocateBuffers(BaseVideoPost *node, Render *render, BaseDocument *doc)
{
}

VIDEOPOSTINFO VideoPostData::GetRenderInfo(BaseVideoPost *node)
{
	return VIDEOPOSTINFO_0;
}

RENDERRESULT VideoPostData::Execute(BaseVideoPost *node, VideoPostStruct *vps)
{
	return RENDERRESULT_OK;
}

void VideoPostData::ExecuteLine(BaseVideoPost *node, PixelPost *pp)
{
}

void VideoPostData::ExecutePixel(BaseVideoPost *node, PixelPost *pp, LONG x, LONG subx, LONG suby)
{
}

Bool VideoPostData::GlDraw(BaseVideoPost *node, BaseDraw *bd, GlFrameBuffer* fbuf, LONG colortex, LONG depthtex, VIDEOPOST_GLDRAW flags)
{
	return TRUE;
}

VIDEOPOST_GLINFO VideoPostData::GetGlInfo(BaseVideoPost *node, BaseDocument* doc, BaseDraw *bd)
{
	return VIDEOPOST_GLINFO_0;
}

void VideoPostData::SetDiffuseWeight(BaseVideoPost *node, LONG cpu_index, Real weight)
{
}

Vector VideoPostData::ComputeDiffuseGI(BaseVideoPost *node, VolumeData *vd, Real receive_strength)
{
	return 0.0;
}

Vector VideoPostData::ComputeDiffuseCaustic(BaseVideoPost *node, VolumeData *vd, Real sampleradius, LONG accuracy)
{
	return 0.0;
}

Vector VideoPostData::ComputeVolumeCaustic(BaseVideoPost *node, const LVector &p, LONG cpu_index)
{
	return 0.0;
}

void VideoPostData::CreateRay(Ray *dst, Real x, Real y)
{
}

void VideoPostData::CreateExtendedRay(Ray *dst, Real x, Real y, Real lensx, Real lensy, Real time)
{
}

LONG VideoPostData::StereoGetCameraCountEditor(BaseVideoPost *node, BaseDocument* doc, BaseDraw *bd)
{
	return NOTOK;
}

LONG VideoPostData::StereoGetCameraCountRenderer(BaseVideoPost *node, BaseDocument* doc, RenderData* rd)
{
	return NOTOK;
}

Bool VideoPostData::StereoGetCameraInfo(BaseVideoPost *node, BaseDocument* doc, BaseDraw *bd, RenderData* rd, LONG index, StereoCameraInfo& info)
{
	return FALSE;
}

LONG VideoPostData::StereoGetSceneHookID(BaseVideoPost *node)
{
	return 0;
}

Bool VideoPostData::StereoMergeImages(BaseVideoPost *node, BaseBitmap* dest, const BaseBitmap* const* source, LONG cnt, const BaseContainer &settings, COLORSPACETRANSFORMATION transform)
{
	return FALSE;
}

Bool VideoPostData::RenderEngineCheck(BaseVideoPost *node, LONG id)
{
	return TRUE;
}

Bool RegisterVideoPostPlugin(LONG id, const String &str, LONG info, DataAllocator *g, const String &description, LONG disklevel, LONG priority, void *emulation)
{
	if (description.Content() && !RegisterDescription(id,description)) return FALSE;

	VIDEOPOSTPLUGIN np;
	ClearMem(&np,sizeof(np));

	FillNodePlugin(&np,info,g,NULL,disklevel,emulation);

	np.priority					= priority;
	np.Draw							= &VideoPostData::Draw;
	np.GlDraw						= &VideoPostData::GlDraw;
	np.GetGlInfo				= &VideoPostData::GetGlInfo;
	np.AllocateBuffers	= &VideoPostData::AllocateBuffers;
	np.GetRenderInfo		= &VideoPostData::GetRenderInfo;
	np.Execute					= &VideoPostData::Execute;
	np.ExecuteLine			= &VideoPostData::ExecuteLine;
	np.ExecutePixel			= &VideoPostData::ExecutePixel;
	np.CalcVolumetric   = &VideoPostData::CalcVolumetric;
	np.CalcShadow			  = &VideoPostData::CalcShadow;
	np.ComputeDiffuseGI = &VideoPostData::ComputeDiffuseGI;
	np.ComputeDiffuseCaustic = &VideoPostData::ComputeDiffuseCaustic;
	np.ComputeVolumeCausticEx = NULL;
	np.ComputeVolumeCaustic  = &VideoPostData::ComputeVolumeCaustic;
	np.CreateRay        = &VideoPostData::CreateRay;
	np.CreateExtendedRay = &VideoPostData::CreateExtendedRay;
	np.StereoGetCameraCountEditor = &VideoPostData::StereoGetCameraCountEditor;
	np.StereoGetCameraCountRenderer = &VideoPostData::StereoGetCameraCountRenderer;
	np.StereoGetCameraInfo  = &VideoPostData::StereoGetCameraInfo;
	np.StereoGetSceneHookID = &VideoPostData::StereoGetSceneHookID;
	np.StereoMergeImages    = &VideoPostData::StereoMergeImages;
	np.RenderEngineCheck		= &VideoPostData::RenderEngineCheck;
	np.SetDiffuseWeight			= &VideoPostData::SetDiffuseWeight;

	return GeRegisterPlugin(PLUGINTYPE_VIDEOPOST,id,str,&np,sizeof(np));
}
