Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef OUTPUT_PROPERTIES_INCLUDED
Toshihiro Shimizu 890ddd
#define OUTPUT_PROPERTIES_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tfilepath.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TOONZLIB_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// forward declarations
Toshihiro Shimizu 890ddd
class TPropertyGroup;
Toshihiro Shimizu 890ddd
class TWidget;
Toshihiro Shimizu 890ddd
class TRenderSettings;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
//!The TOutputProperties class provides a container for output properties and gives all methods to access to these informations.
Toshihiro Shimizu 890ddd
/*!The class contains all features necessaries to compute output and provides a
Toshihiro Shimizu 890ddd
   collection of functions that return the various feature, and enable
Toshihiro Shimizu 890ddd
   manipulation of these.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   A path getPath() is used to manipulate output name and directory, path can be
Toshihiro Shimizu 890ddd
   changed using the setPath().
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   The getRange() function tells whether is set a range in output, if it's
Toshihiro Shimizu 890ddd
   so provides first frame, last frame, and step; this element can be changed
Toshihiro Shimizu 890ddd
   using setRange().
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   The getFrameRate() function return output frame rate, it can be set by
Toshihiro Shimizu 890ddd
   setFrameRate().
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   The getWhichLevels() function return a value is used to characterize which
Toshihiro Shimizu 890ddd
   levels are in output:
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   \li If value is TOutputProperties::AllLevels all levels are coputed in output.
Toshihiro Shimizu 890ddd
   \li If value is TOutputProperties::SelectedOnly only selectecd levels are coputed in output.
Toshihiro Shimizu 890ddd
   \li If value is TOutputProperties::AnimatedOnly only animated levels are coputed in output.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   It can be set by setWhichLevels().
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   The getFileFormatProperties(string ext) function return file of fomat \b ext
Toshihiro Shimizu 890ddd
   properties \b TPropertyGroup. It's possibile set different format and have
Toshihiro Shimizu 890ddd
   appropriete properties.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   The getRenderSettings() function return render settings \b TRenderSettings,
Toshihiro Shimizu 890ddd
   it can be change using setRenderSettings().
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TOutputProperties
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    This enum type is used to characterize which levels are in output.
Toshihiro Shimizu 890ddd
    Can set in output all lavel, only selectecd levels or only animated levels.
Toshihiro Shimizu 890ddd
    \sa getWhichLevels(), setWhichLevels()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	enum {
Toshihiro Shimizu 890ddd
		AllLevels,
Toshihiro Shimizu 890ddd
		SelectedOnly,
Toshihiro Shimizu 890ddd
		AnimatedOnly
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	enum MaxTileSizeValues {
Toshihiro Shimizu 890ddd
		LargeVal = 50,
Toshihiro Shimizu 890ddd
		MediumVal = 10,
Toshihiro Shimizu 890ddd
		SmallVal = 2
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	TFilePath m_path;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	std::map<string, *="" tpropertygroup=""> m_formatProperties; //!< [\p owned] Format properties by file extension.</string,>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRenderSettings *m_renderSettings;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	double m_frameRate;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int m_from, m_to;
Toshihiro Shimizu 890ddd
	int m_whichLevels;
Toshihiro Shimizu 890ddd
	int m_offset,
Toshihiro Shimizu 890ddd
		m_step;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int m_multimediaRendering;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int m_maxTileSizeIndex;
Toshihiro Shimizu 890ddd
	int m_threadIndex;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool m_subcameraPreview;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Constructs TOutputProperties with default value.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	TOutputProperties();
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Destroys the TOutputProperties object.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	~TOutputProperties();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Constructs a TOutputProperties object that is a copy of the TOutputProperties
Toshihiro Shimizu 890ddd
    object \a src.
Toshihiro Shimizu 890ddd
    \sa operator=()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	TOutputProperties(const TOutputProperties &src);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Assign the \a src object to this TOutputProperties object.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	TOutputProperties &operator=(const TOutputProperties &src);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return output path, name and directory where output file will be save.
Toshihiro Shimizu 890ddd
    \sa setPath()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	TFilePath getPath() const;
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Set output path to \b fp.
Toshihiro Shimizu 890ddd
    \sa getPath()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setPath(const TFilePath &fp);
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Set which levels are in output to \b state. State can be:
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
    \li TOutputProperties::AllLevels.
Toshihiro Shimizu 890ddd
    \li TOutputProperties::SelectedOnly.
Toshihiro Shimizu 890ddd
    \li TOutputProperties::AnimatedOnly.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
    \sa getWhichLevels()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setWhichLevels(int state) { m_whichLevels = state; }
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return which levels are in output.
Toshihiro Shimizu 890ddd
    \sa setWhichLevels()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	int getWhichLevels() const { return m_whichLevels; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return output offset.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	int getOffset() const { return m_offset; }
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Set output offset to \b off.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setOffset(int off);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return true if frame start <= than frame end. Set \b step 
Toshihiro Shimizu 890ddd
    to output step, \b r0 to first frame, \b r1 to last frame.
Toshihiro Shimizu 890ddd
    \sa setRange()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	bool getRange(int &r0, int &r1, int &step) const;
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Set first frame to \b r0, last frame to \b r1, step to \b step.
Toshihiro Shimizu 890ddd
    \sa getRange()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setRange(int r0, int r1, int step);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Set output frame rate.
Toshihiro Shimizu 890ddd
    \sa getFrameRate()
Toshihiro Shimizu 890ddd
   */
Toshihiro Shimizu 890ddd
	void setFrameRate(double);
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return output frame rate.
Toshihiro Shimizu 890ddd
    \sa setFrameRate()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	double getFrameRate() const { return m_frameRate; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return const \b TRenderSettings.
Toshihiro Shimizu 890ddd
    \sa setRenderSettings()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	const TRenderSettings &getRenderSettings() const
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		return *m_renderSettings;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Set render settings to \b renderSettings.
Toshihiro Shimizu 890ddd
    \sa getRenderSettings()
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setRenderSettings(const TRenderSettings &renderSettings);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Return \b TPropertyGroup, file format \b ext (Extension) properties.
Toshihiro Shimizu 890ddd
    If extension there isn't is created.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	TPropertyGroup *getFileFormatProperties(string ext);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    Insert in \b v all extension in format properties of output settings.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void getFileFormatPropertiesExtensions(std::vector<string> &v) const;</string>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//! Sets the rendering behaviour to 'Multimedia'.
Toshihiro Shimizu 890ddd
	void setMultimediaRendering(int mode) { m_multimediaRendering = mode; }
Toshihiro Shimizu 890ddd
	int getMultimediaRendering() const { return m_multimediaRendering; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*! Sets the granularity of raster allocations for rendering processes.
Toshihiro Shimizu 890ddd
      The specified value refers to an index associated with const values,
Toshihiro Shimizu 890ddd
      spanning from 0 (no bound, ie giant rasters are allowed) to 3 (highly
Toshihiro Shimizu 890ddd
      restrictive, only small rasters are allocated). The value should be
Toshihiro Shimizu 890ddd
      high for complex scenes.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setMaxTileSizeIndex(int idx) { m_maxTileSizeIndex = idx; }
Toshihiro Shimizu 890ddd
	int getMaxTileSizeIndex() const { return m_maxTileSizeIndex; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*! Sets index for a combo selection of threads running for rendering processes.
Toshihiro Shimizu 890ddd
      Possible values are: 0 (1 thread, safe mode), 1 (half), 2 (max - number of
Toshihiro Shimizu 890ddd
      machine's CPU).
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setThreadIndex(int idx) { m_threadIndex = idx; }
Toshihiro Shimizu 890ddd
	int getThreadIndex() const { return m_threadIndex; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isSubcameraPreview() const { return m_subcameraPreview; }
Toshihiro Shimizu 890ddd
	void setSubcameraPreview(bool enabled) { m_subcameraPreview = enabled; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif