/****************************************************************************************************

		IEx2DExportFilter.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	charles
		Date:	9/16/2005

****************************************************************************************************/

#ifndef __IEx2DExportFilter__
#define __IEx2DExportFilter__

#if CP_PRAGMA_ONCE
#pragma once
#endif

MCDEFINE_GUID_H(IID_IEx2DExportFilter);


struct IMCFile;
struct IShRasterLayer;
struct IShLayerList;
struct TGBuffer32List;

struct ImageExportCapabilities
{
	ImageExportCapabilities()
	{
		Clear();
	}

	void Clear()
	{
		fCanSaveAlphaChannel=false;
		fCanSave8BitGBuffers=false;
		fCanSave32BitsGBuffers=false;
		fCanSaveFragmentColor=false;
		fCanSaveFragmentDistance=false;
		fCanSaveFragmentCoverage=false;
		fCanSaveObjectIndex=false;
		fCanSaveVelocity=false;
		fCanSaveUVs=false;
		fCanSaveLayers=false;
		fHaveAdditionBlendMode=false;
		fHaveScreenBlendMode=false;
		fHaveHardLightBlendMode=false;
	}

	uint32		fCanSaveAlphaChannel:1;
	uint32		fCanSave8BitGBuffers:1;
	uint32		fCanSave32BitsGBuffers:1;
	uint32		fCanSaveFragmentColor:1;
	uint32		fCanSaveFragmentDistance:1;
	uint32		fCanSaveFragmentCoverage:1;
	uint32		fCanSaveObjectIndex:1;
	uint32		fCanSaveVelocity:1;
	uint32		fCanSaveUVs:1;

	uint32		fCanSaveLayers:1;
	uint32		fHaveAdditionBlendMode:1;
	uint32		fHaveScreenBlendMode:1;
	uint32		fHaveHardLightBlendMode:1;
};

struct TPSOptions;


struct IEx2DExportFilter : public IMCUnknown
{
	// ****************************************************************************
	//								Save
	// 
	/// Saves an image to a file.
	/// 
	/// \param file             The file where the image should be written.
	/// \param rasterLayer      The image.
	/// \param chunky           True if the image is stored in chunky format, false if it is plannar
	/// \param gBuffers         Pointers to a description of the GBuffers, NULL if there is no GBuffers to save
	/// \param psPluginOptions  Optional options for photoshop plugins (this should disappear in the future)
	/// \param displayOptions	If true will ask the user for the save options.
	/// 
	virtual boolean		MCCOMAPI Save(IMCFile* file,IShRasterLayer* rasterLayer,boolean chunky,
								  const TGBuffer32List* gBuffers,const TPSOptions* psPluginOptions,boolean displayOptions) = 0;

	// ****************************************************************************
	//								Save
	// 
	/// Saves an layer image to a file.
	/// 
	/// \param file             The file where the image should be written.
	/// \param layerList	    The layer list.
	/// \param chunky           True if the image is stored in chunky format, false if it is plannar
	/// \param gBuffers         Pointers to a description of the GBuffers, NULL if there is no GBuffers to save
	/// \param psPluginOptions  Optional options for photoshop plugins (this should disappear in the future)
	/// \param displayOptions	If true will ask the user for the save options.
	/// 
	virtual MCCOMErr	MCCOMAPI Save(IMCFile* file,IShLayerList* layerList,boolean chunky,
									  const TGBuffer32List* gBuffers, const TPSOptions* psPluginOptions,boolean displayOptions) = 0;

	// ****************************************************************************
	//								GetCapabilities
	// 
	/// Returns which buffers can be saved with this file format
	/// 
	/// \param capabitilities	Flags that are returned.
	/// \param psPluginOptions	Plugin options
	/// 
	virtual void		MCCOMAPI GetCapabilities(ImageExportCapabilities& capabitilities, const TPSOptions* psPluginOptions) = 0;

	// ****************************************************************************
	//								ShowOptions
	// 
	/// Show the option dialog
	/// 
	/// \param alphaChannel			True of the image has alpha channel
	/// \param numExtraPlanes		Number of extra plane in the image 
	/// \param psPluginOptions		Output
	/// 
	virtual MCCOMErr	MCCOMAPI ShowOptions(boolean alphaChannel, int32 numExtraPlanes, TPSOptions& psPluginOptions) = 0;

	// ****************************************************************************
	//								NeedOptions
	// 
	/// Returns true if the export filter needs options
	/// 
	virtual boolean		MCCOMAPI NeedOptions() = 0;
};


MCDEFINE_GUID_H(IID_I2DShExportFilter);


struct I2DShExportFilter : public IEx2DExportFilter
{
};






#endif
