Rhino C++ API  8.7
Public Member Functions | List of all members
CRhRdkLinearWorkflow Class Reference

#include <RhRdkLinearWorkflow.h>

Inheritance diagram for CRhRdkLinearWorkflow:
IRhRdkLinearWorkflow CRhRdkLinearWorkflowEx

Public Member Functions

 CRhRdkLinearWorkflow ()
 
 CRhRdkLinearWorkflow (const IRhRdkLinearWorkflow &lw)
 
virtual void ApplyPostProcessGamma (CRhinoDib &dibInOut) const override
 
virtual void ApplyPreProcessGamma (CRhinoDib &dibInOut) const override
 
virtual void ApplyPreProcessGamma (CRhRdkColor &col, bool bForTexture) const override
 
virtual IRhRdkLinearWorkflowBeginChange (RhRdkChangeContext cc) const override
 
virtual ON__UINT32 ComputeCRC (void) const override
 
virtual void CopyFrom (const IRhRdkLinearWorkflow &lw) override
 
void CopyFrom (const ON_LinearWorkflow &lw)
 
virtual bool EndChange (void) override
 
virtual void * EVF (const wchar_t *, void *) override
 
virtual bool IsEqual (const IRhRdkLinearWorkflow &lw) const override
 
bool operator!= (const IRhRdkLinearWorkflow &lw) const
 
const CRhRdkLinearWorkflowoperator= (const IRhRdkLinearWorkflow &lw)
 
bool operator== (const IRhRdkLinearWorkflow &lw) const
 
virtual bool PostProcessFrameBuffer (void) const override
 
virtual float PostProcessGamma (void) const override
 
virtual float PostProcessGammaReciprocal (void) const override
 
virtual bool PreProcessColors (void) const override
 
virtual float PreProcessGamma (void) const override
 
virtual bool PreProcessTextures (void) const override
 
virtual void SetPostProcessFrameBuffer (bool b) override
 
virtual void SetPostProcessGamma (float fGamma) override
 
virtual void SetPreProcessColors (bool b) override
 
virtual void SetPreProcessGamma (float fGamma) override
 
virtual void SetPreProcessTextures (bool b) override
 
- Public Member Functions inherited from IRhRdkLinearWorkflow
virtual ~IRhRdkLinearWorkflow ()
 
bool PostProcessFrameBufferOn (void) const
 
bool PostProcessGammaOn (void) const
 
bool PreProcessColorsOn (void) const
 
bool PreProcessTexturesOn (void) const
 
void SetPostProcessFrameBufferOn (bool b)
 
void SetPostProcessGammaOn (bool)
 
void SetPreProcessColorsOn (bool b)
 
void SetPreProcessTexturesOn (bool b)
 

Additional Inherited Members

- Static Public Member Functions inherited from IRhRdkLinearWorkflow
static IRhRdkLinearWorkflowNew (void)
 

Detailed Description

This helper class provides simple gamma and linear workflow processing.

If you want to get the linear workflow or gamma settings being used by a document, please see CRhRdkDocument::LinearWorkflow().

Note that this does not support the EVF functions "PostProcessGammaOn" or "SetPostProcessGammaOn" mentioned in IRhRdkLinearWorkflow. Please use CRhRdkLinearWorkflowEx to solve this.

Constructor & Destructor Documentation

◆ CRhRdkLinearWorkflow() [1/2]

CRhRdkLinearWorkflow::CRhRdkLinearWorkflow ( )

◆ CRhRdkLinearWorkflow() [2/2]

CRhRdkLinearWorkflow::CRhRdkLinearWorkflow ( const IRhRdkLinearWorkflow lw)

Member Function Documentation

◆ ApplyPostProcessGamma()

virtual void CRhRdkLinearWorkflow::ApplyPostProcessGamma ( CRhinoDib dibInOut) const
overridevirtual

Modifies a DIB by applying gamma correction using the gamma reciprocal.

Note
This method replaces the NewGammaCorrectedBitmap() method.
Parameters
dibInOutis the DIB which is altered if gamma is not equal to 1.

Implements IRhRdkLinearWorkflow.

Reimplemented in CRhRdkLinearWorkflowEx.

◆ ApplyPreProcessGamma() [1/2]

virtual void CRhRdkLinearWorkflow::ApplyPreProcessGamma ( CRhinoDib dibInOut) const
overridevirtual

Applies pre-process gamma correction to a dib (i.e., an LDR texture) if PreProcessTextures is true.

Note
If this texture comes from a CRhRdkTexture, you should first check CRhRdkTexture::IsLinear(). If the texture is linear, it will require no further processing.

Implements IRhRdkLinearWorkflow.

◆ ApplyPreProcessGamma() [2/2]

virtual void CRhRdkLinearWorkflow::ApplyPreProcessGamma ( CRhRdkColor col,
bool  bForTexture 
) const
overridevirtual

Applies pre-process gamma correction to a color if linear workflow is active.

Parameters
bForTextureis true if the color is part of a texture. See notes below for checking CRhRdkTexture::IsLinear().

Implements IRhRdkLinearWorkflow.

◆ BeginChange()

virtual IRhRdkLinearWorkflow& CRhRdkLinearWorkflow::BeginChange ( RhRdkChangeContext  cc) const
overridevirtual

Call this method to get a non-const object upon which you can call non-const methods. Calls to this method are counted; you must call EndChange() once for every call to BeginChange(). Please do not use const_cast or any other means of circumventing this requirement.

Implements IRhRdkLinearWorkflow.

◆ ComputeCRC()

virtual ON__UINT32 CRhRdkLinearWorkflow::ComputeCRC ( void  ) const
overridevirtual
Returns
CRC of gamma and linear workflow active state.

Implements IRhRdkLinearWorkflow.

◆ CopyFrom() [1/2]

virtual void CRhRdkLinearWorkflow::CopyFrom ( const IRhRdkLinearWorkflow lw)
overridevirtual

Copy another linear workflow object to this one.

Implements IRhRdkLinearWorkflow.

◆ CopyFrom() [2/2]

void CRhRdkLinearWorkflow::CopyFrom ( const ON_LinearWorkflow lw)

◆ EndChange()

virtual bool CRhRdkLinearWorkflow::EndChange ( void  )
overridevirtual

Implements IRhRdkLinearWorkflow.

◆ EVF()

virtual void* CRhRdkLinearWorkflow::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
inlineoverridevirtual

Emergency virtual function for future expansion. Currently implemented wszFunc: "PostProcessGammaOn" (pvData = null; returns pointer to bool). "SetPostProcessGammaOn" (pvData is pointer to bool).

Implements IRhRdkLinearWorkflow.

Reimplemented in CRhRdkLinearWorkflowEx.

◆ IsEqual()

virtual bool CRhRdkLinearWorkflow::IsEqual ( const IRhRdkLinearWorkflow lw) const
overridevirtual
Returns
true if this object is equal to another one.

Implements IRhRdkLinearWorkflow.

◆ operator!=()

bool CRhRdkLinearWorkflow::operator!= ( const IRhRdkLinearWorkflow lw) const

◆ operator=()

const CRhRdkLinearWorkflow& CRhRdkLinearWorkflow::operator= ( const IRhRdkLinearWorkflow lw)

◆ operator==()

bool CRhRdkLinearWorkflow::operator== ( const IRhRdkLinearWorkflow lw) const

◆ PostProcessFrameBuffer()

virtual bool CRhRdkLinearWorkflow::PostProcessFrameBuffer ( void  ) const
overridevirtual
Returns
whether the frame buffer should be gamma corrected.

Implements IRhRdkLinearWorkflow.

◆ PostProcessGamma()

virtual float CRhRdkLinearWorkflow::PostProcessGamma ( void  ) const
overridevirtual
Returns
post-process gamma for frame buffer. This is not the value applied, this is the value that appears in the UI.
See also
PostProcessGammaReciprocal().

Implements IRhRdkLinearWorkflow.

◆ PostProcessGammaReciprocal()

virtual float CRhRdkLinearWorkflow::PostProcessGammaReciprocal ( void  ) const
overridevirtual
Returns
gamma reciprocal for frame buffer. This is the value that is applied to each color channel for post-process and is supplied here as an optimization.

Implements IRhRdkLinearWorkflow.

◆ PreProcessColors()

virtual bool CRhRdkLinearWorkflow::PreProcessColors ( void  ) const
overridevirtual
Returns
linear workflow active state for individual colors.

Implements IRhRdkLinearWorkflow.

◆ PreProcessGamma()

virtual float CRhRdkLinearWorkflow::PreProcessGamma ( void  ) const
overridevirtual
Returns
pre-process gamma for input textures and colors.

Implements IRhRdkLinearWorkflow.

◆ PreProcessTextures()

virtual bool CRhRdkLinearWorkflow::PreProcessTextures ( void  ) const
overridevirtual
Returns
linear workflow active state for textures (also check IsLinear()).

Implements IRhRdkLinearWorkflow.

◆ SetPostProcessFrameBuffer()

virtual void CRhRdkLinearWorkflow::SetPostProcessFrameBuffer ( bool  b)
overridevirtual

Set linear workflow (pre-process) active state for individual colors.

Implements IRhRdkLinearWorkflow.

◆ SetPostProcessGamma()

virtual void CRhRdkLinearWorkflow::SetPostProcessGamma ( float  f)
overridevirtual

Set post-process gamma. This will generally be >= 1.0 (usually 2.2). The actual value to be applied in post-process is the reciprocal.

Implements IRhRdkLinearWorkflow.

◆ SetPreProcessColors()

virtual void CRhRdkLinearWorkflow::SetPreProcessColors ( bool  b)
overridevirtual

Set linear workflow (pre-process) active state for individual colors.

Implements IRhRdkLinearWorkflow.

◆ SetPreProcessGamma()

virtual void CRhRdkLinearWorkflow::SetPreProcessGamma ( float  f)
overridevirtual

Set pre-process gamma. This will generally be >= 1.0 (usually 2.2). This is the actual value applied in pre-process.

Implements IRhRdkLinearWorkflow.

◆ SetPreProcessTextures()

virtual void CRhRdkLinearWorkflow::SetPreProcessTextures ( bool  b)
overridevirtual

Set linear workflow (pre-process) active state for textures.

Implements IRhRdkLinearWorkflow.