123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962 |
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2015 Autodesk, Inc. All rights reserved.
- //
- // Use of this software is subject to the terms of the Autodesk license
- // agreement provided at the time of installation or download, or which
- // otherwise accompanies this software in either electronic or hard copy form.
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // This API extends AcGi to support backgrounds, environmental objects
- // and render settings
- //
- #pragma once
- #include "acgi.h"
- #include "AcGiLightTraits.h"
- #pragma pack (push, 8)
- #ifdef ACGIENVIRONMENT_IMPL
- #define ACGIENV_IMPEXP __declspec(dllexport)
- #else
- #define ACGIENV_IMPEXP __declspec(dllimport)
- #endif
- class ACDB_PORT AcGiSolidBackgroundTraits : public AcGiNonEntityTraits
- //
- // This class enables solid background definitions to be elaborated to
- // AcGi implementations
- //
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiSolidBackgroundTraits);
- // solid background
- virtual void setColorSolid (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorSolid (void) const = 0;
- };
- class ACDB_PORT AcGiGradientBackgroundTraits : public AcGiNonEntityTraits
- //
- // This class enables gradient background definitions to be elaborated to
- // AcGi implementations
- //
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiGradientBackgroundTraits);
- virtual void setColorTop (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorTop (void) const = 0;
- virtual void setColorMiddle (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorMiddle (void) const = 0;
- virtual void setColorBottom (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorBottom (void) const = 0;
- virtual void setHorizon (double horizon) = 0;
- virtual double horizon (void) const = 0;
- virtual void setHeight (double height) = 0;
- virtual double height (void) const = 0;
- virtual void setRotation (double rotation) = 0;
- virtual double rotation (void) const = 0;
- };
- class ACDB_PORT AcGiImageBackgroundTraits : public AcGiNonEntityTraits
- //
- // This class enables image background definitions to be elaborated to
- // AcGi implementations
- //
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiImageBackgroundTraits);
- virtual void setImageFilename (const ACHAR* filename) = 0;
- virtual const ACHAR * imageFilename (void) const = 0;
- virtual void setFitToScreen (bool bFitToScreen) = 0;
- virtual bool fitToScreen (void) const = 0;
- virtual void setMaintainAspectRatio (bool bMaintainAspectRatio) = 0;
- virtual bool maintainAspectRatio (void) const = 0;
- virtual void setUseTiling (bool bUseTiling) = 0;
- virtual bool useTiling (void) const = 0;
- virtual void setXOffset (double xOffset) = 0;
- virtual double xOffset (void) const = 0;
- virtual void setYOffset (double yOffset) = 0;
- virtual double yOffset (void) const = 0;
- virtual void setXScale (double xScale) = 0;
- virtual double xScale (void) const = 0;
- virtual void setYScale (double yScale) = 0;
- virtual double yScale (void) const = 0;
- };
- class ACDB_PORT AcGiGroundPlaneBackgroundTraits : public AcGiNonEntityTraits
- //
- // This class enables ground plane background definitions to be elaborated to
- // AcGi implementations
- //
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiGroundPlaneBackgroundTraits);
- virtual void setColorSkyZenith (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorSkyZenith (void) const = 0;
- virtual void setColorSkyHorizon (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorSkyHorizon (void) const = 0;
- virtual void setColorUndergroundHorizon (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorUndergroundHorizon (void) const = 0;
- virtual void setColorUndergroundAzimuth (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorUndergroundAzimuth (void) const = 0;
- virtual void setColorGroundPlaneNear (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorGroundPlaneNear (void) const = 0;
- virtual void setColorGroundPlaneFar (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor colorGroundPlaneFar (void) const = 0;
- };
- /// <summary>
- /// This class enables sky background definitions to be elaborated to
- /// AcGi implementations.
- /// </summary>
- ///
- class ACDB_PORT AcGiSkyBackgroundTraits : public AcGiNonEntityTraits
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiSkyBackgroundTraits);
- /// <summary>
- /// Sets the sky parameters for this light.
- /// </summary>
- ///
- /// <param name="params">
- /// An AcGiSkyParameters object that contains the sky properties used
- /// by this background.
- /// </param>
- virtual void setSkyParameters(const AcGiSkyParameters& params) = 0;
- /// <summary>
- /// Provides access to sky parameters for this light.
- /// </summary>
- ///
- /// <param name="params">
- /// An AcGiSkyParameters object that contains the sky properties used
- /// by this background.
- /// </param>
- virtual void skyParameters(AcGiSkyParameters& params) const = 0;
- };
- /// <summary>
- /// This class enables IBL background definitions to be elaborated to
- /// AcGi implementations.
- /// </summary>
- ///
- class ACDB_PORT AcGiIBLBackgroundTraits : public AcGiNonEntityTraits
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiIBLBackgroundTraits);
- /// <summary>
- /// Sets whether IBL is currently active
- /// </summary>
- /// <param name="name">
- /// True if active
- /// </param>
- virtual void setEnable (const bool bEnable) = 0;
- /// <summary>
- /// Gets whether IBL is currently active
- /// </summary>
- /// <returns>
- /// True if active
- /// </returns>
- virtual bool enable (void) const = 0;
- /// <summary>
- /// Sets the image used for IBL
- /// </summary>
- /// <param name="name">
- /// Name of IBL image
- /// </param>
- virtual void setIBLImageName (const AcString& name) = 0;
- /// <summary>
- /// Gets the image used for IBL
- /// </summary>
- /// <returns>
- /// Name of IBL image
- /// </returns>
- virtual AcString IBLImageName (void) const = 0;
- /// <summary>
- /// Sets the rotation value for the IBL image
- /// -180 to 180 degrees
- /// </summary>
- /// <param name="rotation">
- /// Rotation value in degrees (-180 to 180)
- /// </param>
- virtual void setRotation (const double rotation) = 0;
- /// <summary>
- /// Gets the rotation value for the IBL image
- /// </summary>
- /// <returns>
- /// Rotation value in degrees
- /// </returns>
- virtual double rotation (void) const = 0;
- /// <summary>
- /// Sets whether to display the IBL image as the background
- /// </summary>
- /// <param name="bdisplay">
- /// Set to true to display IBL image in background
- /// </param>
- virtual void setDisplayImage (const bool bdisplay) = 0;
- /// <summary>
- /// Gets whether to display the IBL image as the background
- /// </summary>
- /// <returns>
- /// True if IBL image is to be displayed as background
- /// </returns>
- virtual bool displayImage (void) const = 0;
- /// <summary>
- /// Sets the background to display when DisplayImage is set to false
- /// Limited to 2D backgrounds only - Solid, Gradient, Image
- /// </summary>
- /// <param name="bg">
- /// Background db Id
- /// </param>
- virtual void setSecondaryBackground (const AcDbObjectId bg) = 0;
- /// <summary>
- /// Gets the background to display when DisplayImage is set to false
- /// </summary>
- /// <returns>
- /// Background db Id
- /// </returns>
- virtual AcDbObjectId secondaryBackground (void) const = 0;
- };
- class AcGiMaterialTexture;
- class ACDB_PORT AcGiRenderEnvironmentTraits : public AcGiNonEntityTraits
- //
- // This class enables render environment definitions to be elaborated to
- // AcGi implementations
- //
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiRenderEnvironmentTraits);
- virtual void setEnable (const bool bEnable) = 0;
- virtual bool enable (void) const = 0;
- virtual void setIsBackground (const bool bEnable) = 0;
- virtual bool isBackground (void) const = 0;
- virtual void setFogColor (const AcCmEntityColor & color) = 0;
- virtual AcCmEntityColor fogColor (void) const = 0;
- virtual void setNearDistance (const double nearDist) = 0;
- virtual double nearDistance (void) const = 0;
- virtual void setFarDistance (const double farDist) = 0;
- virtual double farDistance (void) const = 0;
- virtual void setNearPercentage (const double nearPct) = 0;
- virtual double nearPercentage (void) const = 0;
- virtual void setFarPercentage (const double farPct) = 0;
- virtual double farPercentage (void) const = 0;
- virtual void setEnvironmentMap (const AcGiMaterialTexture * map) = 0;
- virtual AcGiMaterialTexture * environmentMap (void) const = 0;
- };
- class ACDB_PORT AcGiRenderSettingsTraits : public AcGiNonEntityTraits
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiRenderSettingsTraits);
- virtual void setMaterialEnabled(bool enabled) = 0;
- virtual bool materialEnabled() const = 0;
- virtual void setTextureSampling(bool enabled) = 0;
- virtual bool textureSampling() const = 0;
- virtual void setBackFacesEnabled(bool enabled) = 0;
- virtual bool backFacesEnabled() const = 0;
- virtual void setShadowsEnabled(bool enabled) = 0;
- virtual bool shadowsEnabled() const = 0;
- virtual void setDiagnosticBackgroundEnabled(bool enabled) = 0;
- virtual bool diagnosticBackgroundEnabled() const = 0;
- // Model scale relative to meters. For example, if model is drawn in mm,
- // scaleFactor is 0.001.
- virtual void setModelScaleFactor (double scaleFactor) = 0;
- virtual double modelScaleFactor (void) const = 0;
- };
- // The available filtering methods (kernels) used to combine samples into
- // a pixel color.
- //
- typedef enum {
- krBox = 0,
- krTriangle,
- krGauss,
- krMitchell,
- krLanczos
- } AcGiMrFilter;
- // The available methods for computing ray-traced shadows.
- //
- typedef enum {
- krSimple = 0,
- krSorted,
- krSegments
- } AcGiMrShadowMode;
- typedef enum {
- krOff = 0,
- krGrid,
- krPhoton,
- krSamples,
- krBSP
- } AcGiMrDiagnosticMode;
- typedef enum {
- krObject = 0,
- krWorld,
- krCamera
- } AcGiMrDiagnosticGridMode;
- typedef enum {
- krDensity = 0,
- krIrradiance
- } AcGiMrDiagnosticPhotonMode;
- typedef enum {
- krDepth = 0,
- krSize
- } AcGiMrDiagnosticBSPMode;
- typedef enum {
- krHilbert = 0,
- krSpiral,
- krLeftToRight,
- krRightToLeft,
- krTopToBottom,
- krBottomToTop
- } AcGiMrTileOrder;
- typedef enum {
- krAutomatic = 0,
- krLogarithmic
- } AcGiMrExposureType;
- typedef enum {
- krFinalGatherOff = 0,
- krFinalGatherOn,
- krFinalGatherAuto
- } AcGiMrFinalGatheringMode;
- typedef enum {
- krExportMIOff = 0,
- krExportMIWithRender,
- krExportMIOnly
- } AcGiMrExportMIMode;
- class ACDB_PORT AcGiMentalRayRenderSettingsTraits : public AcGiRenderSettingsTraits
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiMentalRayRenderSettingsTraits);
- virtual void setSampling(int min, int max) = 0;
- virtual void sampling(int& min, int& max) const = 0;
- virtual void setSamplingFilter(AcGiMrFilter filter, double width, double height) = 0;
- virtual void SamplingFilter(AcGiMrFilter& filter, double& width, double& height) const = 0;
- virtual void setSamplingContrastColor(float r, float g, float b, float a) = 0;
- virtual void samplingContrastColor(float& r, float& g, float& b, float& a) const = 0;
- virtual void setShadowMode(AcGiMrShadowMode mode) = 0;
- virtual AcGiMrShadowMode shadowMode() const = 0;
-
- virtual void setShadowMapEnabled(bool enabled) = 0;
- virtual bool shadowMapEnabled() const = 0;
-
- virtual void setRayTraceEnabled(bool enabled) = 0;
- virtual bool rayTraceEnabled() const = 0;
-
- virtual void setRayTraceDepth(int reflection, int refraction, int sum) = 0;
- virtual void rayTraceDepth(int& reflection, int& refraction, int& sum) const = 0;
- virtual void setGlobalIlluminationEnabled(bool enabled) = 0;
- virtual bool globalIlluminationEnabled() const = 0;
-
- virtual void setGISampleCount(int num) = 0;
- virtual int giSampleCount() const = 0;
-
- virtual void setGISampleRadiusEnabled(bool enabled) = 0;
- virtual bool giSampleRadiusEnabled() const = 0;
-
- virtual void setGISampleRadius(double radius) = 0;
- virtual double giSampleRadius() const = 0;
- virtual void setGIPhotonsPerLight(int num) = 0;
- virtual int giPhotonsPerLight() const = 0;
-
- virtual void setPhotonTraceDepth(int reflection, int refraction, int sum) = 0;
- virtual void photonTraceDepth(int& reflection, int& refraction, int& sum) const = 0;
-
- virtual void setFinalGatheringEnabled(bool enabled) = 0;
- virtual bool finalGatheringEnabled() const = 0;
-
- virtual void setFGRayCount(int num) = 0;
- virtual int fgRayCount() const = 0;
- virtual void setFGRadiusState(bool bMin, bool bMax, bool bPixels) = 0;
- virtual void fgSampleRadiusState(bool& bMin, bool& bMax, bool& bPixels) = 0;
-
- virtual void setFGSampleRadius(double min, double max) = 0;
- virtual void fgSampleRadius(double& min, double& max) const = 0;
-
- virtual void setLightLuminanceScale(double luminance) = 0;
- virtual double lightLuminanceScale() const = 0;
-
- virtual void setDiagnosticMode(AcGiMrDiagnosticMode mode) = 0;
- virtual AcGiMrDiagnosticMode diagnosticMode() const = 0;
- virtual void setDiagnosticGridMode(AcGiMrDiagnosticGridMode mode, float fSize) = 0;
- virtual void diagnosticGridMode(AcGiMrDiagnosticGridMode& mode, float& fSize) const = 0;
- virtual void setDiagnosticPhotonMode(AcGiMrDiagnosticPhotonMode mode) = 0;
- virtual AcGiMrDiagnosticPhotonMode diagnosticPhotonMode() const = 0;
-
- virtual void setDiagnosticBSPMode(AcGiMrDiagnosticBSPMode mode) = 0;
- virtual AcGiMrDiagnosticBSPMode diagnosticBSPMode() const = 0;
-
- virtual void setExportMIEnabled(bool enabled) = 0;
- virtual bool exportMIEnabled() const = 0;
-
- virtual void setExportMIFileName(const ACHAR* miName) = 0;
- virtual const ACHAR* exportMIFileName() const = 0;
- virtual void setTileSize(int size) = 0;
- virtual int tileSize() const = 0;
- virtual void setTileOrder(AcGiMrTileOrder order) = 0;
- virtual AcGiMrTileOrder tileOrder() const = 0;
- virtual void setMemoryLimit(int limit) = 0;
- virtual int memoryLimit() const = 0;
- virtual void setEnergyMultiplier(float fScale) = 0;
- virtual float energyMultiplier() const = 0;
- virtual void setProgressMonitor(void* pMonitor) = 0;
- virtual const void* progressMonitor(void) const = 0;
- virtual void setExposureType(AcGiMrExposureType type) = 0;
- virtual AcGiMrExposureType exposureType() const = 0;
- virtual void setFinalGatheringMode(AcGiMrFinalGatheringMode mode) = 0;
- virtual AcGiMrFinalGatheringMode finalGatheringMode() const = 0;
- virtual void setShadowSamplingMultiplier(double multiplier) = 0;
- virtual double shadowSamplingMultiplier() const = 0;
- virtual void setExportMIMode(AcGiMrExportMIMode mode) = 0;
- virtual AcGiMrExportMIMode exportMIMode() const = 0;
- };
- /// <summary>
- /// Render Quit Conditions
- /// </summary>
- typedef enum
- {
- /// <summary>
- /// Use render iteration as a quit condition
- /// The corresponding render level value needs to be set
- /// </summary>
- krEQuitByRenderLevel = 0,
- /// <summary>
- /// Use render time as a quit condition
- /// The corresponding target render time needs to be set
- /// </summary>
- krEQuitByRenderTime
- }AcGiQuitCondition;
- /// <summary>
- /// Lighting Mode.
- /// </summary>
- typedef enum
- {
- /// <summary>
- /// Global illumination off.
- /// Glossy reflection and refraction off.
- /// Simplified strategy for reflections/refractions to reduce noise.
- /// The trade off is that reflections and refractions may be less accurate compared to the Basic and Advanced lighting modes.
- /// </summary>
- krESimplistic = 0,
- /// <summary>
- /// Global illumination (indirect diffuse lighting) on.
- /// Glossy reflection and refraction off.
- /// </summary>
- krEBasic,
- /// <summary>
- /// Global illumination (indirect diffuse lighting) on.
- /// Glossy reflection and refraction on.
- /// </summary>
- krEAdvanced
- }AcGiLightingMode;
- /// <summary>
- /// Filter Type.
- /// </summary>
- typedef enum
- {
- /// <summary>
- /// Box filter type
- /// Default size: 1.0
- /// </summary>
- krEBox = 0,
- /// <summary>
- /// Triangle filter type
- /// Default size: 2.0
- /// </summary>
- krETriangle,
- /// <summary>
- /// Gaussian filter type
- /// Default size: 3.0
- /// </summary>
- krEGaussian,
- /// <summary>
- /// Lanczos filter type
- /// Default size: 4.0
- /// </summary>
- krELanczos,
- /// <summary>
- /// Mitchell filter type
- /// Default size: 4.0
- /// </summary>
- krEMitchell
- }AcGiFilterType;
- /// <summary>
- /// Abstract interface class that controls all the rendering settings.
- /// </summary>
- class ACDB_PORT AcGiRapidRTRenderSettingsTraits : public AcGiNonEntityTraits
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiRapidRTRenderSettingsTraits);
- /// <summary>
- /// Two general options are provided to control the rendering quality.
- /// One is by rendering time, the other by rendering level.
- /// For either option, the bigger value set, the better quality we can get, which also means longer rendering time.
- /// This function is to set the option.
- /// /summary>
- /// <param name="quitCondition">Set the quit condition that controls the rendering option, either by time or by level. </param>
- /// <returns>void</returns>
- virtual void setQuitCondition(AcGiQuitCondition quitCondition) = 0;
- /// <summary>Get the quit condition</summary>
- /// <returns>Return the quit condition</returns>
- virtual AcGiQuitCondition quitCondition() const = 0;
- /// <summary>
- /// If choosing to use the option of render time to control render quality, we can use this function to set the desired rendering time.
- /// </summary>
- /// <param name="renderTime">Desired render time to be set, which is by second. The range is from 1 minute to 1440 minutes.</param>
- /// <returns>void</returns>
- virtual void setDesiredRenderTime(int renderTime) = 0;
- /// <summary>Get the desired render time.</summary>
- /// <returns>Return the desired render time.</returns>
- virtual int desiredRenderTime() const = 0;
- /// <summary>If choosing to use the option of render level to control render quality, we can use this function to set the desired rendering level.</summary>
- /// <param name="renderLevel">Desired render level to be set. The range is from 1 to 50.</param>
- /// <returns>void</returns>
- virtual void setDesiredRenderLevel(int renderLevel) = 0;
- /// <summary>Get the desired render level.</summary>
- /// <returns>Return the desired render level.</returns>
- virtual int desiredRenderLevel() const = 0;
- /// <summary>
- /// Turn on basic lighting or advanced lighting according the lighting mode set.
- /// Basic lighting uses ambient occlusion and a simpler model for ambient light and IBL.
- /// Advanced lighting uses full global illumination and a more advanced model for ambient light and IBL.
- /// </summary>
- /// <param name="mode">Desired lighting mode to be set.</param>
- /// <returns>void</returns>
- virtual void setLightingMode(AcGiLightingMode mode) = 0;
- /// <summary>Get the lighting mode being set.</summary>
- /// <returns>Return the lighting mode being set.</returns>
- virtual AcGiLightingMode lightingMode() const = 0;
- /// <summary>
- /// Set the filter type applied to the image samples when super sampling. Different filter type favors different filter width / height.
- /// </summary>
- /// <param name="filterInfo">Filter type to be set.</param>
- /// <returns>void</returns>
- virtual void setFilterType(AcGiFilterType filterInfo) = 0;
- /// <summary>Get the current filter type.</summary>
- /// <returns>Return the current filter type.</returns>
- virtual AcGiFilterType filterType() const = 0;
- /// <summary>
- /// Sets the filter width. 1.0 means one pixel (image sample).
- /// Recommended default sizes: box = 1.0, triangle = 2.0, Gaussian = 3.0, Lanczos = 4.0, Mitchell = 4.0
- /// </summary>
- /// <param name="width">Filter width to be set.</param>
- /// <returns>void</returns>
- virtual void setFilterWidth(float width) = 0;
- /// <summary>Get the current filter width.</summary>
- /// <returns>Return the current filter width.</returns>
- virtual float filterWidth() const = 0;
- /// <summary>
- /// Sets the filter height. 1.0 means one pixel (image sample).
- /// Recommended default sizes: box = 1.0, triangle = 2.0, Gaussian = 3.0, Lanczos = 4.0, Mitchell = 4.0
- /// </summary>
- /// <param name="height">Filter height to be set.</param>
- /// <returns>void</returns>
- virtual void setFilterHeight(float height) = 0;
- /// <summary>
- /// Get the current filter height
- /// </summary>
- /// <returns>Current filter height</returns>
- virtual float filterHeight() const = 0;
- };
- /// <summary>
- /// Container class for all tone operator parameters.
- /// </summary>
- ///
- class ACDB_PORT AcGiToneOperatorParameters : public AcRxObject
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiToneOperatorParameters);
- AcGiToneOperatorParameters();
- virtual ~AcGiToneOperatorParameters();
- AcGiToneOperatorParameters& operator=(const AcGiToneOperatorParameters& params);
- bool operator==(const AcGiToneOperatorParameters& params) const;
- /// <summary>
- /// Indicates whether or not the tone operator is active.
- /// </summary>
- ///
- /// <param name="active">
- /// If true, the tone operator is active.
- /// </param>
- virtual void setIsActive(bool active);
- /// <summary>
- /// Is the tone operator active?
- /// </summary>
- ///
- /// <returns>
- /// True if the tone operator is active.
- /// </returns>
- virtual bool isActive() const;
- /// <summary>
- /// Reserved for future use.
- /// </summary>
- virtual void setChromaticAdaptation(bool enable);
- /// <summary>
- /// Reserved for future use.
- /// </summary>
- virtual bool chromaticAdaptation() const;
-
- /// <summary>
- /// Reserved for future use.
- /// </summary>
- virtual void setColorDifferentiation(bool enable);
- /// <summary>
- /// Reserved for future use.
- /// </summary>
- virtual bool colorDifferentiation() const;
- /// <summary>
- /// Sets the reference white color
- /// </summary>
- /// <param name="color">Reference White</param>
- virtual void setWhiteColor(const AcCmColor& color);
- /// <summary>
- /// Gets the reference white color
- /// </summary>
- virtual AcCmColor whiteColor() const;
-
- /// <summary>
- /// Specifies if the background should be processed by exposure control at render time.
- /// </summary>
- ///
- /// <param name="processBG">
- /// Set to true to enable background processing, otherwise false.
- /// </param>
- ///
- /// <remarks>
- /// Only applies if the tone operator is active.
- /// </remarks>
- virtual void setProcessBackground(bool processBG);
- /// <summary>
- /// Is background processing enabled?
- /// </summary>
- ///
- /// <returns>
- /// True if background processing is enabled.
- /// </returns>
- ///
- /// <remarks>
- /// Only applies if the tone operator is active.
- /// </remarks>
- virtual bool processBackground() const;
- /// <summary>
- /// Sets the brightness for the tone operator.
- /// </summary>
- ///
- /// <param name="brightness">
- /// The brightness for the tone operator.
- /// </param>
- ///
- /// <returns>
- /// Returns true if a valid brightness value is passed in.
- /// </returns>
- ///
- /// <remarks>
- /// This value only applies if the tone operator is active.
- /// </remarks>
- virtual bool setBrightness(double brightness);
- /// <summary>
- /// The brightness for the tone operator.
- /// </summary>
- ///
- /// <returns>
- /// The brightness for the tone operator.
- /// </returns>
- ///
- /// <remarks>
- /// Only applies if the tone operator is active.
- /// </remarks>
- virtual double brightness() const;
- /// <summary>
- /// Sets the contrast for the tone operator.
- /// </summary>
- ///
- /// <param name="contrast">
- /// The contrast for the tone operator.
- /// </param>
- ///
- /// <returns>
- /// Returns true if a valid contrast value is passed in.
- /// </returns>
- ///
- /// <remarks>
- /// This value only applies if the tone operator is active.
- /// </remarks>
- virtual bool setContrast(double contrast);
- /// <summary>
- /// The contrast for the tone operator.
- /// </summary>
- ///
- /// <returns>
- /// The contrast for the tone operator.
- /// </returns>
- ///
- /// <remarks>
- /// Only applies if the tone operator is active.
- /// </remarks>
- virtual double contrast() const;
- /// <summary>
- /// Sets the mid tones for the tone operator.
- /// </summary>
- ///
- /// <param name="midTones">
- /// The mid tones for the tone operator.
- /// </param>
- ///
- /// <returns>
- /// Returns true if a valid midtones value is passed in.
- /// </returns>
- ///
- /// <remarks>
- /// This value only applies if the tone operator is active.
- /// </remarks>
- virtual bool setMidTones(double midTones);
- /// <summary>
- /// The mid tones for the tone operator.
- /// </summary>
- ///
- /// <returns>
- /// The mid tones for the tone operator.
- /// </returns>
- ///
- /// <remarks>
- /// Only applies if the tone operator is active.
- /// </remarks>
- virtual double midTones() const;
-
- /// <summary>
- /// The exterior daylight mode.
- /// </summary>
- enum ExteriorDaylightMode {
- /// <summary>
- /// Off.
- /// </summary>
- kDaylightOff = 0,
- /// <summary>
- /// On.
- /// </summary>
- kDaylightOn,
- /// <summary>
- /// Auto - key off of the sun/sky background status.
- /// </summary>
- kDaylightAuto
- };
- /// <summary>
- /// Indicates whether or not exterior daylight is enabled.
- /// </summary>
- ///
- /// <param name="mode">
- /// If kDaylightOff, daylight is disabled. If kDaylightOn, daylight is enabled. If kDaylightAuto, exterior daylight is enabled if a sky background or a sun light is enabled.
- /// </param>
- ///
- /// <returns>
- /// Returns true if a valid exterior daylight mode is passed in.
- /// </returns>
- ///
- /// <remarks>
- /// This value only applies if the tone operator is active.
- /// </remarks>
- virtual bool setExteriorDaylight(ExteriorDaylightMode mode);
- /// <summary>
- /// Is exterior daylight enabled?
- /// </summary>
- ///
- /// <returns>
- /// True if exterior daylight is enabled.
- /// </returns>
- ///
- /// <remarks>
- /// Only applies if the tone operator is active.
- /// </remarks>
- virtual ExteriorDaylightMode exteriorDaylight() const;
-
- /// <summary>
- /// Copies member data from source object
- /// </summary>
- ///
- /// <returns>
- /// Acad::eOk if copy is successful
- /// </returns>
- virtual Acad::ErrorStatus copyFrom(const AcRxObject* other) override;
- private:
- bool mbIsActive;
- bool mbChromaticAdaptation;
- bool mbColorDifferentiation;
- AcCmColor mWhiteColor;
- bool mbProcessBackground;
- double mBrightness;
- double mContrast;
- double mMidTones;
- ExteriorDaylightMode mExteriorDaylight;
- };
- /// <summary>
- /// Container class for all photographic exposure parameters.
- /// </summary>
- /// <remarks>
- /// Properties defined here used by RENDERENGINE=1.
- /// Base class properties used by RENDERENGINE=0.
- /// </remarks>
- class ACDB_PORT AcGiPhotographicExposureParameters : public AcGiToneOperatorParameters
- {
- public:
- ACRX_DECLARE_MEMBERS(AcGiPhotographicExposureParameters);
- AcGiPhotographicExposureParameters();
- virtual ~AcGiPhotographicExposureParameters();
- AcGiPhotographicExposureParameters& operator=(const AcGiPhotographicExposureParameters& params);
- bool operator==(const AcGiPhotographicExposureParameters& params) const;
- /// <summary>
- /// Sets Exposure Value for photographic exposure parameters.
- /// This value is a combination of a camera's shutter speed (exposure time) and f-number (depth of field)
- /// and determines the amount of motion blur in a scene.
- /// </summary>
- ///
- /// <param name="exposure">
- /// Exposure Value for photographic exposure parameters.
- /// </param>
- bool setExposure(double exposure);
- /// <summary>
- /// Gets Exposure for photographic exposure parameters.
- /// </summary>
- ///
- /// <returns>
- /// Exposure for photographic exposure parameters
- /// </returns>
- double exposure(void) const;
- /// <summary>
- /// Sets White Point for photographic exposure parameters in Kelvins
- /// Affects the chromaticity of a scene
- /// </summary>
- ///
- /// <param name="whitePoint">
- /// Temperature of White Point in Kelvins
- /// </param>
- bool setWhitePoint(double whitePoint);
- /// <summary>
- /// Gets White Point for photographic exposure parameters
- /// </summary>
- ///
- /// <returns>
- /// Temperature of White Point in Kelvins
- /// </returns>
- double whitePoint(void) const;
- /// <summary>
- /// Calculates and returns a RGB approximation of the White Point (using CIE 1964 10 degree)
- /// </summary>
- /// <returns>Approximated RGB color to White Point</returns>
- AcCmColor whitePointToColor(void) const;
- /// <summary>
- /// Sets exact brightness and updates exposure calculated from brightness
- /// </summary>
- virtual bool setBrightness (double) override;
- /// <summary>
- /// Copies member data from source object
- /// </summary>
- ///
- /// <returns>
- /// Acad::eOk if copy is successful
- /// </returns>
- virtual Acad::ErrorStatus copyFrom (const AcRxObject*) override;
- public:
- /// <summary>
- /// Converts EV to a calibrated Brightness value
- /// </summary>
- /// <param name="exp">Exposure Value</param>
- /// <returns>Brightness value</returns>
- static double convertExposureToBrightness (double exp);
- /// <summary>
- /// Converts Brightness value to EV
- /// </summary>
- /// <param name="brt">Brightness Value</param>
- /// <returns>Exposure value</returns>
- static double convertBrightnessToExposure (double brt);
- private:
- double mExposure;
- double mWhitePoint;
- };
- #pragma pack (pop)
|