Shinya Kitaoka 810553
#pragma once
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;
shun-iwasawa cd4694
class BoardSettings;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Shinya Kitaoka 120a6e
//! The TOutputProperties class provides a container for output properties and
luz paz 6454c4
//! gives all methods to access to these information.
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
luz paz 6454c4
   \li If value is TOutputProperties::AllLevels all levels are computed in
Shinya Kitaoka 120a6e
   output.
Shinya Kitaoka 120a6e
   \li If value is TOutputProperties::SelectedOnly only selectecd levels are
luz paz 6454c4
   computed in output.
Shinya Kitaoka 120a6e
   \li If value is TOutputProperties::AnimatedOnly only animated levels are
luz paz 6454c4
   computed in output.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
   It can be set by setWhichLevels().
Toshihiro Shimizu 890ddd
luz paz 6454c4
   The getFileFormatProperties(string ext) function return file of format \b ext
Toshihiro Shimizu 890ddd
   properties \b TPropertyGroup. It's possibile set different format and have
luz paz 6454c4
   appropriate 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
Shinya Kitaoka 120a6e
class DVAPI TOutputProperties {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
This enum type is used to characterize which levels are in output.
luz paz 6454c4
Can set in output to all levels, only selectecd levels or only animated levels.
Shinya Kitaoka 120a6e
\sa getWhichLevels(), setWhichLevels()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  enum { AllLevels, SelectedOnly, AnimatedOnly };
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  enum MaxTileSizeValues { LargeVal = 50, MediumVal = 10, SmallVal = 2 };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  TFilePath m_path;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  std::map<std::string, *="" tpropertygroup=""></std::string,>
Shinya Kitaoka 120a6e
      m_formatProperties;  //!< [\p owned] Format properties by file extension.
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TRenderSettings *m_renderSettings;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  double m_frameRate;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int m_from, m_to;
Shinya Kitaoka 120a6e
  int m_whichLevels;
Shinya Kitaoka 120a6e
  int m_offset, m_step;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int m_multimediaRendering;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int m_maxTileSizeIndex;
Shinya Kitaoka 120a6e
  int m_threadIndex;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool m_subcameraPreview;
Toshihiro Shimizu 890ddd
shun-iwasawa cd4694
  BoardSettings *m_boardSettings;
shun-iwasawa cd4694
shun-iwasawa fc0d80
  // templateFId in preview settings is used for "input" file format
shun-iwasawa fc0d80
  // such as new raster level, captured images by camera capture feature, etc.
shun-iwasawa fc0d80
  TFrameId m_formatTemplateFId;
shun-iwasawa fc0d80
shun-iwasawa 481b59
  // if true, channel width, linear color space and color space gamma will be
shun-iwasawa 481b59
  // shared between output and preview settings.
shun-iwasawa 481b59
  bool m_syncColorSettings;
shun-iwasawa 481b59
  // for restoring bpp when setting the color space back to nonlinear
shun-iwasawa 481b59
  int m_nonlinearBpp;
shun-iwasawa 481b59
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Constructs TOutputProperties with default value.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  TOutputProperties();
shun-iwasawa 481b59
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Destroys the TOutputProperties object.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  ~TOutputProperties();
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Constructs a TOutputProperties object that is a copy of the TOutputProperties
Shinya Kitaoka 120a6e
object \a src.
Shinya Kitaoka 120a6e
\sa operator=()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  TOutputProperties(const TOutputProperties &src);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Assign the \a src object to this TOutputProperties object.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  TOutputProperties &operator=(const TOutputProperties &src);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return output path, name and directory where output file will be save.
Shinya Kitaoka 120a6e
\sa setPath()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  TFilePath getPath() const;
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Set output path to \b fp.
Shinya Kitaoka 120a6e
\sa getPath()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setPath(const TFilePath &fp);
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Set which levels are in output to \b state. State can be:
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
\li TOutputProperties::AllLevels.
Shinya Kitaoka 120a6e
\li TOutputProperties::SelectedOnly.
Shinya Kitaoka 120a6e
\li TOutputProperties::AnimatedOnly.
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
\sa getWhichLevels()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setWhichLevels(int state) { m_whichLevels = state; }
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return which levels are in output.
Shinya Kitaoka 120a6e
\sa setWhichLevels()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  int getWhichLevels() const { return m_whichLevels; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return output offset.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  int getOffset() const { return m_offset; }
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Set output offset to \b off.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setOffset(int off);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return true if frame start <= than frame end. Set \b step
Shinya Kitaoka 120a6e
to output step, \b r0 to first frame, \b r1 to last frame.
Shinya Kitaoka 120a6e
\sa setRange()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  bool getRange(int &r0, int &r1, int &step) const;
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Set first frame to \b r0, last frame to \b r1, step to \b step.
Shinya Kitaoka 120a6e
\sa getRange()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setRange(int r0, int r1, int step);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Set output frame rate.
Shinya Kitaoka 120a6e
\sa getFrameRate()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setFrameRate(double);
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return output frame rate.
Shinya Kitaoka 120a6e
\sa setFrameRate()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  double getFrameRate() const { return m_frameRate; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return const \b TRenderSettings.
Shinya Kitaoka 120a6e
\sa setRenderSettings()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  const TRenderSettings &getRenderSettings() const { return *m_renderSettings; }
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Set render settings to \b renderSettings.
Shinya Kitaoka 120a6e
\sa getRenderSettings()
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setRenderSettings(const TRenderSettings &renderSettings);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Return \b TPropertyGroup, file format \b ext (Extension) properties.
Shinya Kitaoka 120a6e
If extension there isn't is created.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  TPropertyGroup *getFileFormatProperties(std::string ext);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Insert in \b v all extension in format properties of output settings.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void getFileFormatPropertiesExtensions(std::vector<std::string> &v) const;</std::string>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  //! Sets the rendering behaviour to 'Multimedia'.
Shinya Kitaoka 120a6e
  void setMultimediaRendering(int mode) { m_multimediaRendering = mode; }
Shinya Kitaoka 120a6e
  int getMultimediaRendering() const { return m_multimediaRendering; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*! Sets the granularity of raster allocations for rendering processes.
Shinya Kitaoka 120a6e
The specified value refers to an index associated with const values,
Shinya Kitaoka 120a6e
spanning from 0 (no bound, ie giant rasters are allowed) to 3 (highly
Shinya Kitaoka 120a6e
restrictive, only small rasters are allocated). The value should be
Shinya Kitaoka 120a6e
high for complex scenes.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setMaxTileSizeIndex(int idx) { m_maxTileSizeIndex = idx; }
Shinya Kitaoka 120a6e
  int getMaxTileSizeIndex() const { return m_maxTileSizeIndex; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*! Sets index for a combo selection of threads running for rendering
Shinya Kitaoka 120a6e
processes.
Shinya Kitaoka 120a6e
Possible values are: 0 (1 thread, safe mode), 1 (half), 2 (max - number of
Shinya Kitaoka 120a6e
machine's CPU).
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  void setThreadIndex(int idx) { m_threadIndex = idx; }
Shinya Kitaoka 120a6e
  int getThreadIndex() const { return m_threadIndex; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  bool isSubcameraPreview() const { return m_subcameraPreview; }
Shinya Kitaoka 120a6e
  void setSubcameraPreview(bool enabled) { m_subcameraPreview = enabled; }
shun-iwasawa cd4694
shun-iwasawa cd4694
  BoardSettings *getBoardSettings() const { return m_boardSettings; }
shun-iwasawa fc0d80
shun-iwasawa fc0d80
  TFrameId &formatTemplateFId() { return m_formatTemplateFId; }
shun-iwasawa 481b59
shun-iwasawa 481b59
  bool isColorSettingsSynced() { return m_syncColorSettings; }
shun-iwasawa 481b59
  void syncColorSettings(bool sync) { m_syncColorSettings = sync; }
shun-iwasawa 481b59
  int getNonlinearBpp() { return m_nonlinearBpp; }
shun-iwasawa 481b59
  void setNonlinearBpp(int bpp) { m_nonlinearBpp = bpp; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif